junit

How to "embed" Fedora Repository for JUnit integration tests

The application in question uses Fedora 3.3. Unit tests depend on a local installation of Fedora and call web services at localhost:8080. That's not nice to run the tests in Hudson and the tests have been skipped since a very long time. I want to fix this. I do not want to install Fedora locally and I do not want to depend on the staging...

Organising JBehave stories

We've just started looking at using JBehave for acceptance tests and I was wondering how people that are using it are organising the writing of stories and the storage of story files. It's just development that are working on them at the moment so we have the story files stored in the resources folder alongside the Java code to implemen...

assertEquals doesn't work without second parameter casting

Folks, why I'm getting the "The method assertEquals(String, Object, Object) is ambiguous for the type DictionaryTest" error for this JUnit test? @Test public void testEditCard() { Integer a = 10; Integer b = 12; Integer c = 2; assertEquals("test", a-b, c); } Adding casting assertEquals("test", (Integer)(a-b), c); resolves t...

Mark unit test as an expected failure in JUnit

How can I mark a test as an expected failure in JUnit 4? In this case I want to continue to run this test until something is patched upstream. Ignoring the test goes a little too far, as then I might forget about it. I may be able to add an @expected annotation and catch the exception thrown by assertThat, but that also seems to lie abo...