-
15. Re: Beginner Problem on running a simple test
bonomat Feb 11, 2011 9:49 AM (in response to ssilvert)i think this hasn't been the real solution, and i think the error above wasn't the correct error i got ^^. so start again:
i've added the jsfunit 2.0.0.Beta dependency :
<dependency>
<groupId>org.jboss.jsfunit</groupId>
<artifactId>jsfunit-arquillian</artifactId>
<version>${jsfunit.version}</version>
<scope>test</scope>
</dependency>
and copied the test class from the example:
edited it a bit to fit to my project (the ,
and starting it with the same jbossas-remote-6 profile.
and then i get following error:
org.jboss.arquillian.impl.event.FiredEventException: java.lang.RuntimeException: Could not get Deployment
at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:68)
at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
....
Caused by: java.lang.RuntimeException: Could not get Deployment
at org.jboss.arquillian.impl.DeploymentAnnotationArchiveGenerator.generateApplicationArchive(DeploymentAnnotationArchiveGenerator.java:88)
at org.jboss.arquillian.impl.ClientDeploymentGenerator.generate(ClientDeploymentGenerator.java:59)
... 22 more
Caused by: java.lang.IllegalArgumentException: Pack must be specified
at org.jboss.shrinkwrap.impl.base.Validate.notNull(Validate.java:44)
at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackage(ContainerBase.java:945)
at ****.HelloJSFIT.createDeployment(HelloJSFIT.java:53)
... 27 more
****.HelloJSFIT Time elapsed: 0.001 sec <<< ERROR!
org.jboss.arquillian.impl.event.FiredEventException: java.lang.IllegalStateException: No org.jboss.shrinkwrap.api.Archive found in context
at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:68)
at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)
at org.jboss.arquillian.impl.EventTestRunnerAdaptor.afterClass(EventTestRunnerAdaptor.java:108)
at org.jboss.arquillian.junit.Arquillian$3$2.evaluate(Arquillian.java:190)
....
Caused by: java.lang.IllegalStateException: No org.jboss.shrinkwrap.api.Archive found in context
at org.jboss.arquillian.impl.Validate.stateNotNull(Validate.java:75)
at org.jboss.arquillian.impl.handler.ContainerUndeployer.callback(ContainerUndeployer.java:58)
at org.jboss.arquillian.impl.handler.ContainerUndeployer.callback(ContainerUndeployer.java:47)
at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)
... 17 more
thanks for help and patience
kind regards
philipp
-
16. Beginner Problem on running a simple test
ssilvert Feb 11, 2011 9:58 AM (in response to bonomat)The workaround is to add this line at the beginning of the createDeployment() method:
Class clazz = org.jboss.jsfunit.cdi.InitialPage.class;
Stan
-
17. Beginner Problem on running a simple test
bonomat Feb 11, 2011 10:02 AM (in response to ssilvert)thx, but did not work, still the same error
-
18. Beginner Problem on running a simple test
ssilvert Feb 11, 2011 10:04 AM (in response to bonomat)Show line 53 of your test (along with the rest of the method):
at ****.HelloJSFIT.createDeployment(HelloJSFIT.java:53)
Stan
-
19. Beginner Problem on running a simple test
bonomat Feb 11, 2011 10:06 AM (in response to ssilvert)@Deployment
public static WebArchive createDeployment() {
Class clazz = org.jboss.jsfunit.cdi.InitialPage.class;
line 53: WebArchive war =
ShrinkWrap.create(WebArchive.class, "test.war")
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.addPackage(Package.getPackage("****.web")) // my test package
.addResource(new File("src/main/webapp", "index.xhtml"))
.addWebResource(EmptyAsset.INSTANCE, "beans.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/faces-config.xml"), "faces-config.xml")
.addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
return war;
}
-
20. Beginner Problem on running a simple test
ssilvert Feb 11, 2011 10:18 AM (in response to bonomat)Try refrencing a class from the package you are trying to add:
@Deployment
public static WebArchive createDeployment() {
Class clazz = org.jboss.jsfunit.cdi.InitialPage.class;
Class clazz = some.class.in.***.web.InitialPage.class;
line 53: WebArchive war =
ShrinkWrap.create(WebArchive.class, "test.war")
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.addPackage(Package.getPackage("****.web")) // my test package
.addResource(new File("src/main/webapp", "index.xhtml"))
.addWebResource(EmptyAsset.INSTANCE, "beans.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/faces-config.xml"), "faces-config.xml")
.addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
return war;
}
-
21. Beginner Problem on running a simple test
bonomat Feb 11, 2011 10:18 AM (in response to bonomat)ok, i think i found a nother error, which does not appear in the stacktrace:
new File("src/main/webapp/WEB-INF/web.xml") is not taking the correct file, it starts with /src/main/... out of the parent pom, and not from the submodule:
the structure:
project/
pom.xml
modul1/pom.xml
/src....
web-modul/pom.xml
/src
/main/webapp...
the resolved path looks like this:
project/src...
the correct path should be :
project/web-modul/....
any idea?
-
22. Beginner Problem on running a simple test
ssilvert Feb 11, 2011 10:24 AM (in response to bonomat)There are any number of ways to reference that file. I'd try hard-coding it first to see if that fixes your problem.
Stan
-
23. Beginner Problem on running a simple test
bonomat Feb 11, 2011 10:45 AM (in response to ssilvert)ok, that was not the error, the error is in this line :
.addPackage(Package.getPackage("***.web"))
i tried to debug it, and my packages are not in Package.getPackages(). Maybe it is using a wrong classLoader?
-
24. Re: Beginner Problem on running a simple test
bonomat Feb 11, 2011 10:57 AM (in response to bonomat)ok, fixed that error :-) by : anyClass.class.getPackage().
next error comming soon :-)