2 Replies Latest reply on Mar 16, 2008 5:10 AM by philipp

    Integration Testing Failed with SeamTest Jboss-embedded Mave

    Steven Headley Newbie

      I am having problems building Simple Integration tests with SeamTest. My environment contains the following:

      Seam 2.0.1 GA
      Maven version: 2.0.7
      Java version: 1.5.0_09

      I obtained my embedded-jboss by placing the following into my pom.xml file which seems to build properly:

      <dependency>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>thirdparty-all</artifactId>
       <version>beta3</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>hibernate-all</artifactId>
       <version>beta3</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>jboss-embedded-all</artifactId>
       <version>beta3</version>
       <scope>provided</scope>
       <exclusions>
       <exclusion>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>jboss-embedded</artifactId>
       </exclusion>
       </exclusions>
       </dependency>
       <dependency>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>jboss-embedded</artifactId>
       <version>beta3</version>
       <scope>provided</scope>
       <exclusions>
       <exclusion>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-deployers-client-spi</artifactId>
       </exclusion>
       </exclusions>
       </dependency>
      
      
      for the repository:
      
       <repository>
       <id>jboss</id>
       <name>The JBoss maven repo</name>
       <url>http://repository.jboss.org/maven2</url>
       </repository>
      



      I then copied the bootstrap folder into my resources directory.

      When I run the following test:
      package jmat.system.notification;
      
      import org.jboss.seam.mock.SeamTest;
      import org.testng.annotations.Test;
      import org.jboss.seam.core.Manager;
      import org.jboss.seam.web.Session;
      
      public class RegisterTest extends SeamTest
      {
      
       @Test
       public void testLoginComponent() throws Exception
       {
       new ComponentTest() {
      
       @Override
       protected void testComponents() throws Exception
       {
       assert getValue("#{identity.loggedIn}").equals(false);
       setValue("#{identity.username}", "gavin");
       setValue("#{identity.password}", "foobar");
       invokeMethod("#{identity.login}");
       assert getValue("#{user.name}").equals("Gavin King");
       assert getValue("#{user.username}").equals("gavin");
       assert getValue("#{user.password}").equals("foobar");
       assert getValue("#{identity.loggedIn}").equals(true);
       invokeMethod("#{identity.logout}");
       assert getValue("#{identity.loggedIn}").equals(false);
       setValue("#{identity.username}", "gavin");
       setValue("#{identity.password}", "tiger");
       invokeMethod("#{identity.login}");
       assert getValue("#{identity.loggedIn}").equals(false);
       }
      
       }.run();
       }
      
       @Test
       public void testLogin() throws Exception
       {
      
       new FacesRequest() {
      
       @Override
       protected void invokeApplication()
       {
       assert !isSessionInvalid();
       assert getValue("#{identity.loggedIn}").equals(false);
       }
      
       }.run();
      
       new FacesRequest() {
      
       @Override
       protected void updateModelValues() throws Exception
       {
       assert !isSessionInvalid();
       setValue("#{identity.username}", "gavin");
       setValue("#{identity.password}", "foobar");
       }
      
       @Override
       protected void invokeApplication()
       {
       invokeAction("#{identity.login}");
       }
      
       @Override
       protected void renderResponse()
       {
       assert getValue("#{user.name}").equals("Gavin King");
       assert getValue("#{user.username}").equals("gavin");
       assert getValue("#{user.password}").equals("foobar");
       assert !Manager.instance().isLongRunningConversation();
       assert getValue("#{identity.loggedIn}").equals(true);
       }
      
       }.run();
      
       new FacesRequest() {
      
       @Override
       protected void invokeApplication()
       {
       assert !isSessionInvalid();
       assert getValue("#{identity.loggedIn}").equals(true);
       }
      
       }.run();
      
       new FacesRequest() {
      
       @Override
       protected void invokeApplication()
       {
       assert !Manager.instance().isLongRunningConversation();
       assert !isSessionInvalid();
       invokeMethod("#{identity.logout}");
       assert Session.instance().isInvalid();
       }
      
       @Override
       protected void renderResponse()
       {
       assert getValue("#{identity.loggedIn}").equals(false);
       assert Session.instance().isInvalid();
       }
      
       }.run();
      
       }
      
      }
      
      


      I get the following error:


      [Parser] Running:
      C:\svn_work0208\jmat\jmat-ejb\temp-testng-customsuite.xml

      FAILED CONFIGURATION: @BeforeClass init
      java.lang.RuntimeException: Unable to bootstrap:
      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147)
      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
      at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
      at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
      at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
      at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
      at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
      at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
      at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85)
      at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
      ... 29 more
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
      at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:55)
      at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
      ... 32 more
      Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
      at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
      ... 34 more
      ... Removed 22 stack frames
      SKIPPED CONFIGURATION: @BeforeMethod begin
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @BeforeMethod begin
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @AfterClass cleanup
      SKIPPED: testLogin
      SKIPPED: testLoginComponent

      ===============================================
      jmat.system.notification.RegisterTest
      Tests run: 2, Failures: 0, Skips: 2
      Configuration Failures: 1, Skips: 5
      ===============================================


      ===============================================
      jmat-ejb
      Total tests run: 2, Failures: 0, Skips: 2
      Configuration Failures: 1, Skips: 5
      ===============================================



      Any help or assistance would be appreciated


      Regards,

      Steven Headley