5 Replies Latest reply on Oct 2, 2008 1:36 PM by Scott Basinger

    Unit tests behind a proxy

    Fred B Newbie

      Hi,


      I hope this question will get more visibility here than with the legacy forum


      It can't test a Seam(2.0.1.GA) app generated with the JBoss Tools (2.0.0.GA) wizard. I created a simple action and tried to execute TestNG.


      It fails miserably.


      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name
      
      =vfsfile:/P:/workspace/monceaunet/protoseam-test/bin/ state=Not Installed mode=Manual requiredState=
      
      Parse
      
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/P:/workspace
      
      /monceaunet/protoseam-test/bin/
      
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.jav
      
      a:49)
      
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(Abstra
      
      ctParsingDeployerWithOutput.java:232)
      
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(Abstra
      
      ctParsingDeployerWithOutput.java:199)
      
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsin
      
      gDeployerWithOutput.java:162)
      
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
      
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:32
      
      7)
      
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
      
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
      
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
      
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
      
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
      
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
      
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
      
       at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
      
       at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
      
       at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
      
       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)
      
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      
       at java.lang.reflect.Method.invoke(Unknown Source)
      
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
      
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
      
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
      
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
      
       at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
      
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
      
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
      
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
      
       at org.testng.TestRunner.run(TestRunner.java:466)
      
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
      
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
      
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
      
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
      
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
      
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
      
       at org.testng.TestNG.run(TestNG.java:701)
      
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
      
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      
      Caused by: javax.xml.bind.UnmarshalException
      
       - with linked exception:
      
      [java.net.ConnectException: Connection refused: connect]
      
       at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:213)
      
       at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:190)
      
       at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:241)
      
       at org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer.parse(ManagedConnectionFacto
      
      ryParserDeployer.java:121)
      
       at org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer.parse(ManagedConnectionFacto
      
      ryParserDeployer.java:59)
      
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer
      
      .java:112)
      
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(Abstra
      
      ctParsingDeployerWithOutput.java:225)
      
       ... 43 more
      
      Caused by: java.net.ConnectException: Connection refused: connect
      
       at java.net.PlainSocketImpl.socketConnect(Native Method)
      
       at java.net.PlainSocketImpl.doConnect(Unknown Source)
      
       at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      
       at java.net.PlainSocketImpl.connect(Unknown Source)
      
       at java.net.Socket.connect(Unknown Source)
      
       at java.net.Socket.connect(Unknown Source)
      
       at sun.net.NetworkClient.doConnect(Unknown Source)
      
       at sun.net.www.http.HttpClient.openServer(Unknown Source)
      
       at sun.net.www.http.HttpClient.openServer(Unknown Source)
      
       at sun.net.www.http.HttpClient.<init>(Unknown Source)
      
       at sun.net.www.http.HttpClient.New(Unknown Source)
      
       at sun.net.www.http.HttpClient.New(Unknown Source)
      
       at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
      
       at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
      
       at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
      
       at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      
       at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
      
       at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
      
       at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
      
       at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
      
       at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
      
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      
       at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
      
       ... 49 more
      
      FAILED CONFIGURATION: @BeforeClass init
      
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE
      
       PREVIOUS ERRORS FOR DETAILS):
      
      
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      
      persistence.units:jar=classes.jar,unitName=protoseam
      
       -> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=protoseamDatasource,service=DataSourceBinding **}
      
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      
      <UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=protoseamDatasource,service=DataSourceBinding **
      
      
      vfsfile:/P:/workspace/monceaunet/protoseam-test/bin/ -> java.net.ConnectException: Connection refused: connect
      
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
      
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
      
       at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128)
      
       at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
      
       at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
      
       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)
      
      
      




      Debugging the tests, I found it failed to connect to a jboss.org address. Obviously, the proxy settings in Eclipse preferences are ignored.


      both EAR and WAR applications tests fail.


      Actually, I have the same problem when I try to test the booking app from the Seam 2.0.1.GA dist running ant test


      The tests succeed though, when executed from the Seam 2.0.0.GA package.


      Is there a way to set the proxy parameters as JVM argument variables?


      Thanks in advance.


      Regards,


      Fred B.