| Issue 20: | resource directory (even empty) is a must | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Create new template
2. Copy files form source tree
3. Run test with -Dtemplate=...
What is the expected output? What do you see instead?
It should render raport with my template instead it show ugly error:
java.lang.RuntimeException: File could not be generated.
at tumbler.internal.writers.StoryFileWriter.write(StoryFileWriter.java:23)
at tumbler.internal.ScenarioListener.generateReport(ScenarioListener.java:56)
at tumbler.internal.ScenarioListener.testRunFinished(ScenarioListener.java:40)
at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41)
at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68)
at tumbler.TumblerRunner.removeScenariosListener(TumblerRunner.java:149)
at tumbler.TumblerRunner.run(TumblerRunner.java:52)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: java.lang.NullPointerException
at tumbler.internal.writers.FreemarkerFileWriter.copyCustomTemplateFiles(FreemarkerFileWriter.java:121)
at tumbler.internal.writers.FreemarkerFileWriter.copyAdditionalFiles(FreemarkerFileWriter.java:110)
at tumbler.internal.writers.FreemarkerFileWriter.writeTextToFile(FreemarkerFileWriter.java:104)
at tumbler.internal.writers.StoryFileWriter.write(StoryFileWriter.java:21)
... 19 more
What version of the product are you using? On what operating system?
2.4.0
Please provide any additional information below.
I think that it should not make any assumptions (explicit or implicit) about existence of "resources" folder.
private void copyCustomTemplateFiles(String resources) throws IOException {
File resourcesDir = new File(System.getProperty("template") + File.separator + "resources");
for (File resource : resourcesDir.listFiles(new OnlyFilesFileFilter())) {
File dst = new File(resources + File.separator + resource.getName());
copy(new FileInputStream(resource), dst);
}
}
Feb 10, 2012
Project Member
#1
lipinski...@gmail.com
Status:
Fixed
|