[ 
http://issues.ops4j.org/browse/PAXEXAM-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216#action_13216
 ] 

Charles-André Martin commented on PAXEXAM-156:
----------------------------------------------

I also tried this approch :

1) Copied every jar from the system folder of Fuse 4

                                
systemPackages("javax.xml.stream;version=1.0.0", 
"com.sun.org.apache.xerces.internal.dom",
                                                       
"javax.xml.stream.util;version=1.0.0", "com.sun.org.apache.xerces.internal.xni",
                                                       
"javax.xml.stream.events;version=1.0.0"),
                                logProfile(),
                            
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("TRACE"),
                    repositories("http://repository.ops4j.org/maven2";, 
"http://nexus.in.canoe.com/content/groups/pub...@snapshots";),
                            felix(), profile("felix.prefs"), 
profile("felix.webconsole"),
                            configProfile(), profile("spring"), 
profile("spring.dm"), webProfile(),
                            profile("url"),
                            provision(scanDir("C:/Documents and 
Settings/charles-andre.martin/Bureau/fuse bundles")));

...
                  
                   systemProperty("bnews.memcached.cachedTime").value("3600"),
                   
systemProperty("org.ops4j.pax.web.session.timeout").value("3600"),
                   systemPackages("javax.xml.ws.http;version=2.1.0"),
                   
provision(scanFeatures("http://...catamaran.features-1.0.0-features.xml";, 
"bnews/1.0.0.BUILD-SNAPSHOT")));

It still freeze...                                 




> Pax Exam freezing for CXF integration test
> ------------------------------------------
>
>                 Key: PAXEXAM-156
>                 URL: http://issues.ops4j.org/browse/PAXEXAM-156
>             Project: Pax Exam
>          Issue Type: Bug
>          Components: JUnit 4 Support
>    Affects Versions: 1.2.0
>         Environment: Spring DM
> Windows XP
> Java 6
> Maven 2
> JUnit 4
> Eclipse 3.5
>            Reporter: Charles-André Martin
>            Assignee: Toni Menzel
>
> Hi all,
>        I would like to use Pax Exam for integration tests. Currently,
> I have one bundle which has REST services. I use JAX-RS (CXF) for the
> REST services. My plans are to setup Pax Exam with JUnit and to use
> HTTP client to tests the REST services. The bundles work nice with
> fuse 4.1. When I test it, Pax Exam freeze at startup :
> ...
> main INFO [org.ops4j.pax.runner.platform.internal.ExecutionEnvironment]
> - Using execution environment [J2SE-1.6]
> main INFO [org.ops4j.pax.runner.platform.DefaultJavaRunner] - Runner
> has successfully finished his job!
> main INFO [org.ops4j.pax.exam.container.def.internal.PaxRunnerTestContainer]
> - Test container (Pax Runner 1.1.0) started in 33875 millis
> main INFO [org.ops4j.pax.exam.container.def.internal.PaxRunnerTestContainer]
> - Wait for test container to finish its initialization without timing
> out
> Welcome to Felix.
> =================
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Creating bundle
> watcher with scanner
> [org.ops4j.pax.swissbox.extender.BundleManifestScanner at 17e6a96]...
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [osgi.compendium]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.junit.extender]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.junit.extender.impl]
> [org.ops4j.pax.url.commons.handler.HandlerActivator] : Handler for
> protocols [dir] started
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.url.dir]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [com.springsource.org.junit]
> [org.ops4j.pax.exam.rbc.internal.Activator] : Starting up RMI registry
> on port [1099]
> [org.ops4j.pax.exam.rbc.internal.Activator] : Binding
> RemoteBundleContext to RMI registry
> [org.ops4j.pax.exam.rbc.internal.Activator] : RMI registry started on
> port [1099]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.rbc]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-annotation_1.0_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-activation_1.1_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-javamail_1.4_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [com.springsource.org.jdom]
> [org.mortbay.jetty] : Logging to
> org.ops4j.pax.web.service.internal.util.JCLLogger at 1c92535 via
> org.ops4j.pax.web.service.internal.util.JCLLogger
> [org.ops4j.pax.web.service.internal.Activator] : Starting pax http service
> [org.ops4j.pax.web.service.internal.ServerControllerImpl] :
> configuring server: ServerControllerImpl{state=UNCONFIGURED} ->
> ConfigurationImpl{http enabled=true,http port=8080,http secure
> enabled=false,http secure port=8443,ssl keystore=C:\Documents and
> Settings\charles-andre.martin\.keystore,ssl keystoreType=null,session
> timeout=3600,listening addresses=[Ljava.lang.String;@c931fc}
> [org.ops4j.pax.web.service.internal.ServerControllerImpl] : starting
> server: ServerControllerImpl{state=STOPPED}
> [org.ops4j.pax.web.service.internal.JettyServerImpl] : adding
> connectorNIOSocketConnectorWrapper at 0.0.0.0:8080
> [org.mortbay.jetty] : Container JettyServerWrapper at 5e179a +
> NIOSocketConnectorWrapper at 0.0.0.0:8080 as connector
> [org.ops4j.pax.web.service.internal.JettyServerImpl] : starting
> JettyServerImpl{}
> [org.mortbay.jetty] : jetty-6.1.x
> [org.mortbay.jetty] : Container JettyServerWrapper at 5e179a +
> org.mortbay.thread.QueuedThreadPool at 1ebd75b as threadpool
> [org.mortbay.jetty] : started org.mortbay.thread.QueuedThreadPool at 1ebd75b
> [org.mortbay.jetty] : starting JettyServerWrapper at 5e179a
> [org.mortbay.jetty] : started
> org.mortbay.jetty.nio.SelectChannelConnector$1 at b01d43
> [org.mortbay.jetty] : Started NIOSocketConnectorWrapper at 0.0.0.0:8080
> [org.mortbay.jetty] : started NIOSocketConnectorWrapper at 0.0.0.0:8080
> [org.mortbay.jetty] : started JettyServerWrapper at 5e179a
> [org.ops4j.pax.web.service.internal.Activator] : Started pax http service
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.web.pax-web-service]
> main INFO [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] -
> Remote bundle context found after 5219 millis
> Then it hangs here indefinitly, no tests are run. The java process
> using about 80% of the CPU.
>  Here is a sample of the code :
>       private BundleContext bundleContext;
>       
>       @Configuration(extend=BNewsOption.class)
>       public static Option[] configuration() {
>               return options(
>                       
>                               systemPackages("javax.xml.stream;version=1.0.0",
> "com.sun.org.apache.xerces.internal.dom",
>                                                      
> "javax.xml.stream.util;version=1.0.0",
> "com.sun.org.apache.xerces.internal.xni",
>                                                      
> "javax.xml.stream.events;version=1.0.0"),
>                               logProfile(),
>                           
> systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
>                   repositories("http://repository.ops4j.org/maven2";, "..."),
>                           felix(), profile("spring"), profile("spring.dm"), 
> webProfile(),
> profile("cxf.dosgi"));
>       }
> @Test
>       public void testCanAddNews() {
>               String content = "content";
>               HttpClient client = new HttpClient();           
>               
>               String url = 
> "http://localhost:8080/cxf/bnews/portalRESTTestInt/siteRESTTestInt/topicRESTTestInt/section";;
>               EntityEnclosingMethod method = new PutMethod(url);
>               InputStream inputSteam = new
> ByteArrayInputStream(content.toString().getBytes());
>               method.setRequestEntity(new InputStreamRequestEntity(inputSteam,
> content.length()));
>               
>               try {
>                       int statusCode = client.executeMethod(method);
>                       assertEquals(201, statusCode);
>               } catch (HTTPException e) {
>                       e.printStackTrace();
>                       fail(e.getMessage());
>               } catch (IOException e) {
>                       e.printStackTrace();
>                       fail(e.getMessage());
>               } finally {
>                       method.releaseConnection();
>               }
>       }
> public class BNewsOption implements CompositeOption {
>       public Option[] getOptions() {
>               return options(                         
>                  
> systemProperty("org.ops4j.pax.web.session.timeout").value("3600"),
>                  systemPackages("javax.xml.ws.http;version=2.1.0"),
>                  provision(
>                                  
> mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.commons-httpclient").version("3.1_1-fuse"),
>                                  
> mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.commons-codec").version("1.3_1-fuse"),
>                                  
> mavenBundle().groupId("commons-lang").artifactId("commons-lang").version("2.4"),
>                                  
> mavenBundle().groupId("com.sun.syndication").artifactId("....com.sun.syndication").version("1.0.0.BUILD-SNAPSHOT"),
>                                  
> bundle("file:/C:/progress/fuse-esb-4.1.0.2/system/org/apache/mina/mina-core/2.0.0-M6/mina-core-2.0.0-M6.jar"),
>                                  
> mavenBundle().groupId("....rest").artifactId("....rest.bnews"),
>                                  
> mavenBundle().groupId("....business").artifactId("....business.bnews"),
>                                  
> mavenBundle().groupId("....integration").artifactId("....integration.memcached"),
>                                  
> mavenBundle().groupId("....integration").artifactId("....integration.sws")));
>       }
> }
> Here is my project POM file :
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>....test</groupId>
>       <artifactId>....test.integration</artifactId>
>       <version>1.0.0.BUILD-SNAPSHOT</version>
>       
>       <distributionManagement>
>               <snapshotRepository>
>                       <id>snapshots</id>
>                       <name>Snapshots</name>
>                       <url>.../snapshots</url>
>               </snapshotRepository>
>       </distributionManagement>       
>       <dependencies>
>               <dependency>
>                       <groupId>....rest</groupId>
>                       <artifactId>....rest.bnews</artifactId>
>                       <version>1.2.0</version>
>                       <scope>compile</scope>
>               </dependency>
>               <dependency>
>                       <groupId>org.ops4j.pax.exam</groupId>
>                       <artifactId>pax-exam</artifactId>
>                       <version>1.2.0</version>
>                       <scope>compile</scope>
>               </dependency>
>               <dependency>
>                       <groupId>org.ops4j.pax.exam</groupId>
>                       <artifactId>pax-exam-container-default</artifactId>
>                       <version>1.2.0</version>
>                       <scope>compile</scope>
>               </dependency>
>               <dependency>
>                       <groupId>org.ops4j.pax.exam</groupId>
>                       <artifactId>pax-exam-junit</artifactId>
>                       <version>1.2.0</version>
>                       <scope>compile</scope>
>               </dependency>
>               <dependency>
>                       <groupId>org.ops4j.pax.exam</groupId>
>                       <artifactId>pax-exam-junit-extender</artifactId>
>                       <version>1.2.0</version>
>                       <scope>compile</scope>
>               </dependency>
>       </dependencies>
>       
>       <build>
>               <resources>
>                       <!-- standard Maven folder -->
>                       <resource>
>                               <directory>src/main/java</directory>
>                       </resource>
>                       <resource>                                              
>                 
>                               <directory>src/main/resources</directory>
>                       </resource>
>               </resources>
>               <plugins>                       
>                       <plugin>
>                               <groupId>org.apache.maven.plugins</groupId>
>                               <artifactId>maven-compiler-plugin</artifactId>
>                               <configuration>
>                                       <encoding>UTF-8</encoding>              
>                         
>                                       <source>1.5</source>
>                                       <target>1.5</target>
>                               </configuration>
>                       </plugin>
>               </plugins>
>       </build>        
>       
> </project>
> I'm using Windows XP with Java 6. Whatever I run the JUnit test by
> Eclipse or by maven test, it freeze.
> Anyone has an idea why Pax Runner hangs ? It only hangs when I include
> the CXF profile. Without the CXF profile, the tests are run.
> Obviously, I need CXF to test my REST services...
> My REST services are using Spring :
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:jaxrs="http://cxf.apache.org/jaxrs";
>   xsi:schemaLocation="
>       http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
>       http://cxf.apache.org/jaxrs     
> http://cxf.apache.org/schemas/jaxrs.xsd";>
>       <import resource="classpath:META-INF/cxf/cxf.xml" />
>       <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
>       <import 
> resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/> 
>       <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
>       <bean id="sectionResource" class="...rest.section.SectionResource"/>
>       
>       <jaxrs:server address="/bnews">
>               <jaxrs:serviceBeans>
>                       <ref bean="sectionResource" />
>               </jaxrs:serviceBeans>   
>       </jaxrs:server>
>       
>       <bean 
> class="org.springframework.osgi.extensions.annotation.ServiceReferenceInjectionBeanPostProcessor"/>
>       
> </beans>
> Thank you !

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to