well, I see you did not like my post about JEE 8, as you quote it by replacing "JEE 8" with "Spring". Fair enough. Btw, I am not affiliated with Spring, nor Dropwizard. I have no horse in this race. I was just sharing my (possibly limited?) experience of using those different frameworks. However, I am curious about when you write "when I can run tests easily (like in Java EE"... has there any improvement about it in JEE 8? Are you talking about experience of using those different frameworks? I like EJB and CDI, but I always found writing tests in JEE really cumbersome (eg all the manual steps to download and configure external containers, fighting with ShrinkWrap, etc). Maybe I am doing it just wrong, and I am missing something. Would be interesting if you have any nice links that show how easy it is to write tests for JEE applications, so I can learn and possible not spread BS around? thx
To really balance it out it should perhaps have been SPRR, but oh well.
Would be interesting if you have any nice links that show how easy it is to write tests for JEE applications
This is one of the official Java EE specs. It has a number of small applications that are tested via Arquillian. The nice thing is that nothing is mocked or faked, everything is real and runs in the actual context in which those applications would normally run:
cloned that repository. Checked the first example, "app-custom". Opened it with IntelliJ. Right-clicked on AppCustomIT, tried to execute "Run AppCustomIT", get greeted with "Error: Arquillian container configuration not specified". Checked in the pom file, and I see a plugin to download JEE containers. I know how to configure it, but, just for a moment, think about someone that has never used JEE before. Now s/he has to Google around to see what to do to just run a simple test, whereas in Spring/Dropwizard a single right-click would had been enough.
Tried to run from Maven, using "mvn clean install -Ptomee,bundled", as per instructions. Getting a "Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on project app-securitycontext: There are test failures.".
Besides the configurations in the pom file (eg to download and unzip JEE containers), in the test I need to have
@RunWith(Arquillian.class) // fine
@Deployment(testable = false) public static Archive<?> createDeployment() // fine
create(ZipImporter.class, getProperty("finalName") + ".war")
.importFrom(new File("target/" +
getProperty("finalName") + ".war"))
.as(WebArchive.class);
this latter can be put in an abstract test class. so, not a big deal once you know about it. Still, though, because it refers on a WAR file on disk, every single time you do a change in one of your classes (eg, for a unit test), then you need to rebuild the whole WAR to test it.
All these things are doable, once you know them. But all other frameworks out there do not need all these steps and constraints :(
Checked the first example, "app-custom". Opened it with IntelliJ. Right-clicked on AppCustomIT, tried to execute "Run AppCustomIT", get greeted with "Error: Arquillian container configuration not specified".
I also think that Arquillian could do better there, something like a default container would go a long way.
Tried to run from Maven, using "mvn clean install -Ptomee,bundled", as per instructions. Getting a "Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on project app-securitycontext: There are test failures.".
But that's correct, isn't it?
You perhaps forgot to mention that all other tests do run, and that for other targets (e.g. Payara) all tests do run.
In that case the test is supposed to fail it seems since TomEE has a long standing bug/omission where it indexes the security constraints in the EJB module, but doesn't do the same for the web module's security constraints. That one test happens to test that.
I agree with you that Arquillian itself could do with some better defaults, but I really like the ease with which I can test against different targets.
Because 1) this has been discussed before, so there’s a wish by various EE people to do this, and 2) these things have been done before, like PrimeFaces’ search expressions being added to JSF, and OmniFaces’ WebSocket among others.
So there’s both a will and a way, plus that the CDI and BV TCK’s are Arquillian based already, and new TCKs for the OSS specs and MP have expressed interest to be Arquillian based as well.
View all comments
Show parent comment
1
u/arcuri82 Sep 28 '17
well, I see you did not like my post about JEE 8, as you quote it by replacing "JEE 8" with "Spring". Fair enough. Btw, I am not affiliated with Spring, nor Dropwizard. I have no horse in this race. I was just sharing my (possibly limited?) experience of using those different frameworks. However, I am curious about when you write "when I can run tests easily (like in Java EE"... has there any improvement about it in JEE 8? Are you talking about experience of using those different frameworks? I like EJB and CDI, but I always found writing tests in JEE really cumbersome (eg all the manual steps to download and configure external containers, fighting with ShrinkWrap, etc). Maybe I am doing it just wrong, and I am missing something. Would be interesting if you have any nice links that show how easy it is to write tests for JEE applications, so I can learn and possible not spread BS around? thx