How to generate html image using JUnit Testrunner

180 views Asked by At

I'm using concordion to create unit tests in eclipse. So now I want to add an Image into html file using testrunner. The Image is in the same folder like testFixture.java and test.html in eclipse. After running the testFixture.java a html file will be generated in a output-directory. So now I want add that Image into html file during running the testFixture.java.

So my question, is that possible at all?

1

There are 1 answers

0
Nigel Charman On

The @ConcordionResources annotation can be used to add new CSS, JavaScript, images, or other resources to your specification in order to tweak or completely overhaul the existing styling.

As an example, executing the following fixture:

package resources.test;

import org.concordion.api.ConcordionResources;
import org.concordion.integration.junit4.ConcordionRunner;
import org.junit.runner.RunWith;

@RunWith(ConcordionRunner.class)
@ConcordionResources( value = { "image.jpg" } )
public class ConcordionResourcesDemoTest {
}

adds image.jpg to the generated specification. See http://concordion.org/coding/java/html/#adding-resources for full details.