0 Replies Latest reply on Oct 3, 2013 12:28 PM by kelly goedert

    warp test error

    kelly goedert Apprentice

      Hi,

       

      I am trying to create my first test using warp. I already have tests using graphene 2, all are working fine. I would like warp and graphene to work together. My test, is as follows:

       

      @RunWith(Arquillian.class)
      @WarpTest
      @RunAsClient
      public class LoginTest {
      
        @Drone
        private WebDriver browser;
      
        @Page
        private LoginPage loginPage;
      
      
        @ArquillianResource
        URL deploymentUrl;
      
      
        @Deployment
        public static WebArchive createDeployment() {
        DatabaseUtils.createDatabase();
        return Deployments.createDefaultDeployment();
        }
      
        private void insertDataAndGetLoginUrl() {
        DatabaseUtils.setTestData("datasets/users.xml");
        browser.get(deploymentUrl + "/login" + Constants.JSF_EXTENSION);
        }
      
        @Test
        public void loginSuccessful() {
        insertDataAndGetLoginUrl();
      
        Warp.initiate(new Activity() {
        @Override
        public void perform() {
        loginPage.login("admin", "Admin123");
      
        }
        });
      
        String location = browser.getCurrentUrl();
      
      
        assertThat(location, containsString("user/search" + Constants.JSF_EXTENSION));
        }}
      

       

      The deployment created is like this:

       

      public static WebArchive createDefaultDeployment() {
        PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
        return ShrinkWrap.create(WebArchive.class, "login.war").addPackages(true, Filters.exclude(".*Test.*\\.class"), AuthenticatorBean.class.getPackage())
        .addPackages(true, Filters.exclude(".*Test\\.class"), User.class.getPackage())
        .addPackages(true, Filters.exclude(".*Test\\.class"), AuthenticationManagerBean.class.getPackage())
        .addPackages(true, Filters.exclude(".*Test\\.class"), LoginController.class.getPackage())
        .addPackages(true, Filters.exclude(".*Test\\.class"), LogoutObserver.class.getPackage())
        .addPackages(true, Filters.exclude(".*Test\\.class"), MessagesInitializer.class.getPackage())
        .addClass(FastTest.class)
        .addClass(SlowTest.class)
        .addAsLibraries(pom.resolve("joda-time:joda-time:2.2").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.omnifaces:omnifaces").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.jadira.usertype:usertype.core").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("com.google.guava:guava").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("commons-codec:commons-codec").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.primefaces:primefaces").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.picketlink:picketlink-api").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.picketlink:picketlink-impl").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.apache.deltaspike.core:deltaspike-core-api").withTransitivity().asFile())
        .addAsLibraries(pom.resolve("org.apache.deltaspike.core:deltaspike-core-impl").withTransitivity().asFile())
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.css"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.xhtml"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.js"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.eot"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.svg"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.ttf"))
        .merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.woff"))
        .addAsWebInfResource("test-beans.xml", "beans.xml")
        .addAsWebInfResource("test-web.xml", "web.xml")
        .addAsWebInfResource("jbossas-ds.xml")
        .addAsWebInfResource("labels_pt_BR.properties", "classes/labels_pt_BR.properties")
        .addAsWebInfResource("messages_pt_BR.properties", "classes/messages_pt_BR.properties").addAsWebInfResource("test-faces-config.xml", "faces-config.xml")
        .addAsResource("test-persistence.xml", "/META-INF/persistence.xml");
        }
      

       

      In my pom.xml I have this dependencies (only showing graphene and warp dependencies):

       

      <version.graphene>2.0.0.CR1</version.graphene>
        <version.warp>1.0.0.Alpha4</version.warp>
      <dependency>
        <groupId>org.jboss.arquillian.graphene</groupId>
        <artifactId>graphene-webdriver</artifactId>
        <version>${version.graphene}</version>
        <type>pom</type>
        <scope>test</scope>
        </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-warp-jsf</artifactId>
        <scope>test</scope>
        <version>${version.warp}</version>
        </dependency>
      

       

      But when I run my test, during the deployment I get this error:

       

      ailed to define class br.com.sample.view.LoginTest$1 in Module "deployment.login.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link br/com/sample/view/LoginTest$1 (Module "deployment.login.war:main" from Service Module Loader)

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:171)

        at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:489) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:851) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:596) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

        at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

      Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/warp/Activity

        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_25]

        at java.lang.ClassLoader.defineClass(ClassLoader.java:788) [rt.jar:1.7.0_25]

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_25]

        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]

        ... 20 more

      Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.warp.Activity from [Module "deployment.login.war:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

        ... 25 more

       

       

      13:26:07,636 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."login.war#test-ds": org.jboss.msc.service.StartException in service jboss.persistenceunit."login.war#test-ds": Failed to start service

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

        at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

      Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/content/login.war/WEB-INF/classes/

        at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:854)

        at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:596)

        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        ... 3 more

      Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'br.com.sample.view.LoginTest$1' with PersistenceUnitInfo.getClassLoader()

        at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:175)

        at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:489)

        at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:851)

        ... 9 more

      Caused by: java.lang.ClassNotFoundException: br.com.sample.view.LoginTest$1 from [Module "deployment.login.war:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

        at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:171)

        ... 11 more

       

      Can somebody help?