سؤال

I've done the tutorial of concordion and I'm looking to put the specification file and the Junit test in separate folder but I'm getting the an IOException, cannot find the file.

I've seen that it is possible in the source code of concordion it self : the two files are in separate folder here and here.

I have no idea how it have been done.

Thanks

هل كانت مفيدة؟

المحلول

you need to make sure that the folders containing the specification file and the compiled JUnit class are on the classpath. Additionally, the specification file and JUnit class most be in the same package.

In the example that you have included from Concordion, both the Exception.html and ExceptionTest.java files are in the spec.concordion.results.exception package. The specification file is under the src/test/resources folder, and the JUnit class is under the src/test/java folder.

If using Eclipse, the folders need to be configured as source folders on the build path (in the above case, the src/test/java and src/test/resources folder would be source folders).

If using Maven or Gradle as a build tool, the src/test/java and src/test/resources folder are used by convention and no additional configuration is needed. Concordion itself uses Gradle as the build tool.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top