java - FileNotFoundException running JBehave (Maven Project, IntelliJ) -
firstly, i'd i'm .net developer who's temporarily working on java project. i'm familiar specflow , seems jbehave similar.
i'm trying basic story run in project, try seems fail same exception
java.io.filenotfoundexception: c:\source\dataloader\target\jbehave\storydurations.props (the system cannot find file specified) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:120) @ java.io.filereader.<init>(filereader.java:55) @ org.jbehave.core.reporters.templateableviewgenerator.storydurations(templateableviewgenerator.java:123) @ org.jbehave.core.reporters.templateableviewgenerator.generatereportsview(templateableviewgenerator.java:115) @ org.jbehave.core.embedder.embedder.generatereportsview(embedder.java:249) @ org.jbehave.core.embedder.embedder.generatereportsview(embedder.java:237) @ org.jbehave.core.embedder.embedder.runstoriesaspaths(embedder.java:213) @ org.jbehave.core.junit.junitstories.run(junitstories.java:20) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.junit.runners.model.frameworkmethod$1.runreflectivecall(frameworkmethod.java:47) @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) @ org.junit.runners.model.frameworkmethod.invokeexplosively(frameworkmethod.java:44) @ org.junit.internal.runners.statements.invokemethod.evaluate(invokemethod.java:17) @ org.junit.runners.parentrunner.runleaf(parentrunner.java:271) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:70) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:50) @ org.junit.runners.parentrunner$3.run(parentrunner.java:238) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:63) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:236) @ org.junit.runners.parentrunner.access$000(parentrunner.java:53) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:229) @ org.junit.runners.parentrunner.run(parentrunner.java:309) @ org.junit.runners.suite.runchild(suite.java:127) @ org.junit.runners.suite.runchild(suite.java:26) @ org.junit.runners.parentrunner$3.run(parentrunner.java:238) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:63) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:236) @ org.junit.runners.parentrunner.access$000(parentrunner.java:53) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:229) @ org.junit.runners.parentrunner.run(parentrunner.java:309) @ org.junit.runner.junitcore.run(junitcore.java:160) @ com.intellij.junit4.junit4ideatestrunner.startrunnerwithargs(junit4ideatestrunner.java:74) @ com.intellij.rt.execution.junit.junitstarter.preparestreamsandstart(junitstarter.java:211) @ com.intellij.rt.execution.junit.junitstarter.main(junitstarter.java:67) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ com.intellij.rt.execution.application.appmain.main(appmain.java:134)
the story , steps following link:
https://blog.codecentric.de/en/2012/06/jbehave-configuration-tutorial/
with following config:
import org.jbehave.core.junit.junitstories; import java.util.arrays; import java.util.list; public class simplebdd extends junitstories { public simplebdd() { super(); this.configuredembedder().candidatesteps().add(new examplesteps()); org.apache.log4j.basicconfigurator.configure(); } @override public list<string> storypaths(){ return arrays.aslist("jbehave/math.story"); } }
this maven project, pom looks likes this:
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.dh</groupid> <artifactid>dataloader</artifactid> <version>1.0-snapshot</version> <dependencies> <dependency> <groupid>org.jbehave</groupid> <artifactid>jbehave-core</artifactid> <version>3.9.5</version> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-mapreduce-client-core</artifactid> <version>2.4.0</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.3</version> </dependency> <dependency> <groupid>org.mockito</groupid> <artifactid>mockito-all</artifactid> <version>1.9.5</version> </dependency> <dependency> <groupid>org.apache.hbase</groupid> <artifactid>hbase-client</artifactid> <version>0.98.4-hadoop2</version> </dependency> <dependency> <groupid>org.apache.hbase</groupid> <artifactid>hbase-server</artifactid> <version>0.98.4-hadoop2</version> </dependency> <dependency> <groupid>com.couchbase.client</groupid> <artifactid>couchbase-client</artifactid> <version>1.2.3</version> </dependency> </dependencies>
this exception killing me, i've tried many different configurations still same error. googling file it's complaining gives me no answers...
anyone have idea i'm doing wrong? (please assume no knowledge of java, maven , intellij)
solved! problem caused .story file not being copied on target test-classes folder wasn't in resources folder. jbehave couldn't find story file storydurations.props wasn't created no stories run.
once moved .story file resources ran fine.
Comments
Post a Comment