How can this testcase result in a success (i.e. green in my JUnit window):
@Test public void caseForXFiles(){
Assert.assertFalse(true);
}
Also, all other sorts of cases succeed although they shouldn't. I assume I don't have to explicitly enable assertions when using this function since I don't use assert
(even when enabled no difference). Even throwing an unexpected (not even properly compilable) Exception won't color the testcase red. In my second console I get
Okt 23, 2014 5:18:43 PM org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ReusedSessionPernamentFileStorage readStore
Information: Reused session store is not available at C:\Users\xx\.drone-webdriver-session-store, a new one will be created.
Okt 23, 2014 5:18:54 PM org.jboss.arquillian.protocol.jmx.JMXMethodExecutor invoke
Schwerwiegend: Failed: de.xx.MyTest.caseForXFiles
What the heck is going on here? I am using JBoss 6.2.4 and Arquillian.
edit: After some further investigation I found that this line, as unlikely as it is, causes the problem. My testcase will be shown green in JUnit whilst it is NOT executed (tried with System.out.print
but didn't show up):
@Before public void setUp() throws Exception {
rBean.getUserId(); // a simple getter on a String field, no side effects
}
It seems that in the @PostConstruct
of my rBean can't be properly filled. But that this results in the described behavior seems like a bug to me.
additional info:
rBean:
@Inject @CurrentUser private MyCurrentUser currentUser;
@PostConstruct private void postConstruct() {
userId = currentUser.getUserId();
}
The object currentUser is injected by some company framework to which I don't have access to. Still, I have access to the MyCurrentUser class implementing IUser (no access). Ultimately, I want to run testcases on my Bean methods which have proprietary annotations. I could bypass this by creating test functions that call those annotated functions in which case the annotation won't be looked at.
Problem seems to be that because the currentUser cant login()
, something at some dark corner goes horribly wrong.