0 Replies Latest reply on Jun 20, 2012 2:56 AM by privera1984

    examples-arquillian doesn't work

    privera1984

      Hi,

       

      I'm trying to setup a unit test environment for JSF2 with tomcat as the container.  I've come across this example:

      https://github.com/jsfunit/jsfunit/tree/master/examples-arquillian

       

      Which was linked from the JBoss page:

      https://community.jboss.org/wiki/JSFUnit200Beta2GettingStartedExample

       

      Now, running mvn -Ptomcat-embedded test produces this error:

       

      -------------------------------------------------------------------------------

      Test set: org.jboss.jsfunit.example.hellojsf.BasicAuthenticationTest

      -------------------------------------------------------------------------------

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.39 sec <<< FAILURE!

      org.jboss.jsfunit.example.hellojsf.BasicAuthenticationTest  Time elapsed: 0 sec  <<< ERROR!

      java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.jsfunit.example.hellojsf.BasicAuthenticationTest.createDeployment()

                at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:160)

                at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:94)

                at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:57)

                at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)

                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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)

                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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

                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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

                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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

                at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

                at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

                at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

                at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

                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.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)

                at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

      Caused by: java.lang.reflect.InvocationTargetException

                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.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:156)

                ... 54 more

      Caused by: org.jboss.shrinkwrap.resolver.api.ResolutionException: Found 1 problems while building POM model from C:\Users\privera\Desktop\jsfunit2\jsfunit-jsfunit-ffc0d51\examples-arquillian\hellojsf\src\test\resources-tomcat\pom.xml1/ [FATAL] Non-resolvable parent POM: Failed to resolve POM for org.jboss.jsfunit:examples-arquillian:2.0.0.Beta2-SNAPSHOT due to Could not find artifact org.jboss.jsfunit:examples-arquillian:pom:2.0.0.Beta2-SNAPSHOT in central (http://repo1.maven.org/maven2) and 'parent.relativePath' points at wrong local POM @ org.jboss.jsfunit:tomcat-deployment-dependencies:2.0.0.Beta2-SNAPSHOT, C:\Users\privera\Desktop\jsfunit2\jsfunit-jsfunit-ffc0d51\examples-arquillian\hellojsf\src\test\resources-tomcat\pom.xml

       

       

                at org.jboss.shrinkwrap.resolver.impl.maven.MavenRepositorySystem.loadPom(MavenRepositorySystem.java:154)

                at org.jboss.shrinkwrap.resolver.impl.maven.MavenRepositorySystem.loadPom(MavenRepositorySystem.java:126)

                at org.jboss.shrinkwrap.resolver.impl.maven.MavenBuilderImpl.loadMetadataFromPom(MavenBuilderImpl.java:153)

                at org.jboss.jsfunit.example.hellojsf.Deployments.appendForEmbedded(Deployments.java:85)

                at org.jboss.jsfunit.example.hellojsf.Deployments.createBaseDeployment(Deployments.java:79)

                at org.jboss.jsfunit.example.hellojsf.Deployments.createDeployment(Deployments.java:45)

                at org.jboss.jsfunit.example.hellojsf.BasicAuthenticationTest.createDeployment(BasicAuthenticationTest.java:50)

                ... 59 more

      Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for org.jboss.jsfunit:tomcat-deployment-dependencies:2.0.0.Beta2-SNAPSHOT

      [FATAL] Non-resolvable parent POM: Failed to resolve POM for org.jboss.jsfunit:examples-arquillian:2.0.0.Beta2-SNAPSHOT due to Could not find artifact org.jboss.jsfunit:examples-arquillian:pom:2.0.0.Beta2-SNAPSHOT in central (http://repo1.maven.org/maven2) and 'parent.relativePath' points at wrong local POM @

       

       

                at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:847)

                at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:670)

                at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:308)

                at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)

                at org.jboss.shrinkwrap.resolver.impl.maven.MavenRepositorySystem.loadPom(MavenRepositorySystem.java:140)

                ... 65 more

      This error is produced by all the other unit tests.  Any ideas of how to fix this?