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/07/13 04:47:36 UTC

svn commit: r963591 - in /camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi: FileComponentTest.java OSGiIntegrationTestSupport.java

Author: ningjiang
Date: Tue Jul 13 02:47:36 2010
New Revision: 963591

URL: http://svn.apache.org/viewvc?rev=963591&view=rev
Log:
Added more osgi integration test

Added:
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java   (with props)
Modified:
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java

Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java?rev=963591&view=auto
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java (added)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java Tue Jul 13 02:47:36 2010
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.osgi;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+
+@RunWith(JUnit4TestRunner.class)
+public class FileComponentTest extends OSGiIntegrationTestSupport {
+    
+    @Test
+    public void testFileProducer() throws Exception {
+        deleteDirectory("myfile");
+        MockEndpoint result = getMockEndpoint("mock:test");
+        result.expectedMessageCount(1);        
+        template.sendBody("direct:simple", "Hello");
+        assertMockEndpointsSatisfied();  
+    }
+        
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:simple").to("file:/myfile");
+                from("file:/myfile").to("mock:test");
+            }
+        };
+    }
+    
+    
+}

Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/FileComponentTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java?rev=963591&r1=963590&r2=963591&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java Tue Jul 13 02:47:36 2010
@@ -43,17 +43,7 @@ public class OSGiIntegrationTestSupport 
     private static final transient Log LOG = LogFactory.getLog(OSGiIntegrationTestSupport.class);
     @Inject
     protected BundleContext bundleContext;
-            
-    @Before
-    public void setUp() throws Exception {
-        super.setUp();        
-    }
-    
-    @After
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-    
+        
     protected CamelContext createCamelContext() throws Exception {
         CamelContextFactory factory = new CamelContextFactory();
         factory.setBundleContext(bundleContext);