If you read the previous post I wrote about ApplicationComposers run method you surely wonder what a service could look like using groovy and @Grab to resolve maven dependencies?
Here is a quick post showing it:
If you read the previous post I wrote about ApplicationComposers run method you surely wonder what a service could look like using groovy and @Grab to resolve maven dependencies?
Here is a quick post showing it:
Cucumber supports since few days a Java 8 API.
If you didn’t see it yet here what it looks like (taken from cucumber-java8 tests):
import cucumber.api.Scenario; import cucumber.api.java8.En; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; public class LambdaStepdefs implements En { private static LambdaStepdefs lastInstance; public LambdaStepdefs() { Before((Scenario scenario) -> { assertNotSame(this, lastInstance); lastInstance = this; }); Given("I have (\\d+) cukes in my (.*)", (Integer cukes, String what) -> { assertEquals(42, cukes.intValue()); assertEquals("belly", what); }); } }
This is great but does it work with Arquillian?
TomEE supports “environment integration” through several solutions (altdd support, external configuration using conf/system.properties etc….). But how to configure a JAXRS provider depending the environment?
First why should I need it? Suppose you configured a JSON provider, quite common for a JAX-RS application no? You want your application to be efficient in production so you use “flat” JSON but in dev you surely prefer to get formatted (“pretty”) JSON to keep it readable.
How to do it with TomEE?
I spoke a lot of ApplicationComposers on this blog. If you don’t know it yet in two words it is originally a way to fully define its EE application programmatically and then run test against this described application.
However with a trivial main you can make it run your application!
Tomcat Valve mecanism is a way to have a kind of servlet filter but before the servlet chain. In two words it is commonly used for container and security usages/needs.
Main issue is the common way to add a valve is to configure it in server.xml or context.xml. Even if this last one can be packaged in a war, the valve itself can’t since this file is used before the webapp classloader is setup to build the webapp setup/context.
To solve it TomEE now provides a LazyValve implementation.
Using JSon for a configuration file is very tempting but there is a big drawback: you can’t comment anything with a strict JSon parser.
This is something which is blocking for a configuration IMO because you often need to explain why you configured something in the way it is.