You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/08/17 06:02:24 UTC
svn commit: r986181 - in /camel/trunk/components:
camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java
camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java
camel-cxf/pom.xml
Author: ningjiang
Date: Tue Aug 17 04:02:23 2010
New Revision: 986181
URL: http://svn.apache.org/viewvc?rev=986181&view=rev
Log:
Updated the ServiceRegistryTest
Modified:
camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java
camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java
camel/trunk/components/camel-cxf/pom.xml
Modified: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java?rev=986181&r1=986180&r2=986181&view=diff
==============================================================================
--- camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java (original)
+++ camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/CamelMockBundleContext.java Tue Aug 17 04:02:23 2010
@@ -38,7 +38,7 @@ public class CamelMockBundleContext exte
public Object getService(ServiceReference reference) {
String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);
- if (classNames[0].equals("org.apache.camel.osgi.test.MyService")) {
+ if (classNames[0].equals("org.apache.camel.core.osgi.test.MyService")) {
return new MyService();
} else if (classNames[0].equals(ComponentResolver.class.getName())) {
return new ComponentResolver() {
Modified: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java?rev=986181&r1=986180&r2=986181&view=diff
==============================================================================
--- camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java (original)
+++ camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java Tue Aug 17 04:02:23 2010
@@ -19,44 +19,25 @@ package org.apache.camel.core.osgi;
import org.apache.camel.core.osgi.test.MyService;
import org.apache.camel.impl.DefaultCamelContext;
import org.junit.Test;
+import org.osgi.application.ApplicationContext;
public class ServiceRegistryTest extends CamelOsgiTestSupport {
@Test
public void camelContextFactoryServiceRegistryTest() throws Exception {
-// CamelContextFactory factory = new CamelContextFactory();
-// factory.setBundleContext(getBundleContext());
-// DefaultCamelContext context = factory.createContext();
-// context.start();
-// MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
-// assertNotNull("MyService should not be null", myService);
-//
-// Object service = context.getRegistry().lookup(MyService.class.getName());
-// assertNotNull("MyService should not be null", service);
-//
-// service = context.getRegistry().lookupByType(MyService.class);
-// assertNotNull("MyService should not be null", service);
-// context.stop();
+
+ DefaultCamelContext context = new OsgiDefaultCamelContext(getBundleContext());
+ context.start();
+ MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
+ assertNotNull("MyService should not be null", myService);
+
+ Object service = context.getRegistry().lookup(MyService.class.getName());
+ assertNotNull("MyService should not be null", service);
+
+ service = context.getRegistry().lookupByType(MyService.class);
+ assertNotNull("MyService should not be null", service);
+ context.stop();
}
- @Test
- public void camelContextFactoryBeanServiceRegistryTest() throws Exception {
-// CamelContextFactoryBean factoryBean = new CamelContextFactoryBean();
-// factoryBean.setBundleContext(getBundleContext());
-// ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/osgi/camelContext.xml");
-// factoryBean.setApplicationContext(applicationContext);
-// DefaultCamelContext context = factoryBean.getContext();
-// context.start();
-// MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
-// assertNotNull("MyService should not be null", myService);
-//
-// Object service = context.getRegistry().lookup(MyService.class.getName());
-// assertNotNull("MyService should not be null", service);
-//
-// service = context.getRegistry().lookupByType(MyService.class);
-// assertNotNull("MyService should not be null", service);
-//
-// context.stop();
- }
-
+
}
Modified: camel/trunk/components/camel-cxf/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/pom.xml?rev=986181&r1=986180&r2=986181&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/pom.xml (original)
+++ camel/trunk/components/camel-cxf/pom.xml Tue Aug 17 04:02:23 2010
@@ -59,6 +59,12 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId></groupId>
+ <artifactId></artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-logging</groupId>