This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void code() { | |
System.out.println("Hello World"); // <1> Prints Hello World | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servers> | |
<server>a</server> <!-- 1 defines the server name --> | |
<name>b</name> | |
<name>c</name> | |
</servers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi Viktor, | |
thank you so much and sorry for disturbing you. I am developing the integration between asciidoctor.js and asciidoctorJ, so users can choose between using JRuby or Javascript. | |
Look basically I need to be able to create an Opal hash object and fill with options. My first approach works but I don't like so much: | |
```java | |
ScriptObjectMirror hash = (ScriptObjectMirror) engine.eval("Opal.hash2(['header_footer', 'attributes'], { 'header_footer': true, 'attributes': ['icons=font'] }); ", asciidoctorScriptCompilerCtx); | |
asciidoctorScriptCompilerCtx.getBindings(ScriptContext.ENGINE_SCOPE).put("options", hash); | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
During the compilation of an ArquillianExtension I am receiving next error from Maven (but not from Eclipse which compiles succesful) | |
[ERROR] symbol: class AbstractCommand | |
[ERROR] /home/alex/Downloads/arquillian-mock-server-master/arquillian-mock-server-wiser/src/main/java/org/jboss/arquillian/mockserver/wiser/client/WiserDeployer.java:[45,27] cannot find symbol | |
[ERROR] symbol: method setResult(org.jboss.arquillian.mockserver.common.api.DeploymentInfo) | |
[ERROR] location: variable wiserHostPortEvent of type org.jboss.arquillian.mockserver.wiser.api.HostPortCommand | |
[ERROR] /home/alex/Downloads/arquillian-mock-server-master/arquillian-mock-server-wiser/src/main/java/org/jboss/arquillian/mockserver/wiser/container/WiserResourceTestEnricherByCommand.java:[50,35] method execute in interface org.jboss.arquillian.container.test.spi.command.CommandService cannot be applied to given types; | |
[ERROR] required: org.jboss.arquillian.container.test.spi.command.Command<T> | |
[ERROR] found: org.jboss.arquillian.mockserver.wiser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently I am developing the integration between asciidoctorjs and nashorn. But I have found a problem which because of my no experience on Nashorn I don't know how to fix it. Let me paste the code: | |
ScriptEngineManager engineManager = | |
new ScriptEngineManager(); | |
ScriptEngine engine = | |
engineManager.getEngineByName("nashorn"); | |
SimpleScriptContext simpleScriptContext = new SimpleScriptContext(); | |
Bindings bindings = new SimpleBindings(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZoneId MADRID = ZoneId.of("Europe/Madrid"); | |
LocalDate date = LocalDate.of(2014, Month.OCTOBER, 20); | |
LocalTime start = LocalTime.of(9, 45); | |
LocalTime end = LocalTime.of(10, 30); | |
Duration duration = Duration.ofMinutes(45); | |
assertThat(Duration.between(ZonedDateTime.of(date, end, MADRID), ZonedDateTime.of(date, start, MADRID)), is(duration)); | |
Why it is different? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaArchive mainJar; | |
JavaArchive[] deps = Maven.resolver()... | |
Arrays.stream(deps).forEach(mainJar::merge); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShrinkWrap.create(JavaArchive.class) | |
.addAsManifestResource(()-> new CheckedInputStream(urlInputStream, crc32), "persistence.xml"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HelloWorldCommand extends HystrixCommand<String> { | |
public HelloWorldCommand() { | |
super(HystrixCommandGroupKey.Factory.asKey("HelloWorld")); | |
} | |
@Override | |
protected String run() throws Exception { | |
return "Hello World"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<String> helloWorldResult = new HelloWorldCommand().queue(); | |
//some more work | |
Stirng message = helloWorldResult.get(); |