camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1404048 - in /camel/trunk/tests/camel-itest-cdi: ./ src/main/java/org/apache/camel/itest/cdi/ src/main/resources/ src/test/java/org/apache/camel/itest/cdi/ src/test/resources/
Date Wed, 31 Oct 2012 09:21:24 GMT
Author: davsclaus
Date: Wed Oct 31 09:21:23 2012
New Revision: 1404048

URL: http://svn.apache.org/viewvc?rev=1404048&view=rev
Log:
CAMEL-5750: Fixed test on trunk.

Added:
    camel/trunk/tests/camel-itest-cdi/src/test/resources/
    camel/trunk/tests/camel-itest-cdi/src/test/resources/log4j.properties
      - copied, changed from r1404029, camel/trunk/tests/camel-itest-cdi/src/main/resources/log4j.properties
Removed:
    camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyConfig.java
    camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyRouteBuilder.java
    camel/trunk/tests/camel-itest-cdi/src/main/resources/log4j.properties
Modified:
    camel/trunk/tests/camel-itest-cdi/pom.xml
    camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/Constants.java
    camel/trunk/tests/camel-itest-cdi/src/main/resources/camel1.properties
    camel/trunk/tests/camel-itest-cdi/src/main/resources/camel2.properties
    camel/trunk/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/IntegrationTest.java

Modified: camel/trunk/tests/camel-itest-cdi/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/pom.xml?rev=1404048&r1=1404047&r2=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/pom.xml (original)
+++ camel/trunk/tests/camel-itest-cdi/pom.xml Wed Oct 31 09:21:23 2012
@@ -76,6 +76,7 @@
         </plugin>
       </plugins>
     </build>
+
     <profiles>
         <profile>
             <id>arquillian-weld-ee-embedded</id>
@@ -105,4 +106,5 @@
             </dependencies>
         </profile>
     </profiles>
+
 </project>

Modified: camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/Constants.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/Constants.java?rev=1404048&r1=1404047&r2=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/Constants.java
(original)
+++ camel/trunk/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/Constants.java
Wed Oct 31 09:21:23 2012
@@ -22,9 +22,7 @@ public final class Constants {
     public static final Object[] EXPECTED_BODIES_B = {"messageB1", "messageB2"};
     public static final Object[] EXPECTED_BODIES_C = {"messageC1", "messageC2"};
     public static final Object[] EXPECTED_BODIES_D = {"messageD1", "messageD2"};
-
-    public static final Object[] EXPECTED_BODIES_E_A = {"messageEa1", "messageEa2"};
-    public static final Object[] EXPECTED_BODIES_E_C = {"messageEc1", "messageEc2"};
+    public static final Object[] EXPECTED_BODIES_D_A = {"messageDa1", "messageDa2"};
 
     private Constants() {
     }

Modified: camel/trunk/tests/camel-itest-cdi/src/main/resources/camel1.properties
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/src/main/resources/camel1.properties?rev=1404048&r1=1404047&r2=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/src/main/resources/camel1.properties (original)
+++ camel/trunk/tests/camel-itest-cdi/src/main/resources/camel1.properties Wed Oct 31 09:21:23
2012
@@ -1 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
 property1=value1
\ No newline at end of file

Modified: camel/trunk/tests/camel-itest-cdi/src/main/resources/camel2.properties
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/src/main/resources/camel2.properties?rev=1404048&r1=1404047&r2=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/src/main/resources/camel2.properties (original)
+++ camel/trunk/tests/camel-itest-cdi/src/main/resources/camel2.properties Wed Oct 31 09:21:23
2012
@@ -1 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
 property2=value2
\ No newline at end of file

Modified: camel/trunk/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/IntegrationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/IntegrationTest.java?rev=1404048&r1=1404047&r2=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/IntegrationTest.java
(original)
+++ camel/trunk/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/IntegrationTest.java
Wed Oct 31 09:21:23 2012
@@ -57,15 +57,14 @@ public class IntegrationTest {
     @Inject
     RoutesContextD routesD;
 
-    @Inject @Uri(value = "seda:foo", context = "contextE")
-    ProducerTemplate producerE;
+    @Inject @Uri(value = "seda:foo", context = "contextD")
+    ProducerTemplate producerD;
 
     @Test
     public void checkContextsHaveCorrectEndpointsAndRoutes() throws Exception {
         Set<Map.Entry<String, CamelContext>> entries = camelContextMap.getCamelContextMap().entrySet();
         for (Map.Entry<String, CamelContext> entry : entries) {
-            LOG.info("CamelContext " + entry.getKey() + " has endpoints: " + entry.getValue().getEndpointMap()
-                    .keySet());
+            LOG.info("CamelContext " + entry.getKey() + " has endpoints: " + entry.getValue().getEndpointMap().keySet());
         }
 
         CamelContext contextA = assertCamelContext("contextA");
@@ -101,38 +100,22 @@ public class IntegrationTest {
         routesD.sendMessages();
         mockEndpointD.assertIsSatisfied();
 
-        // lets check the 2 routes created using @ContextName on a @Produces method
-        CamelContext contextE = assertCamelContext("contextE");
-        assertHasEndpoints(contextE, "seda://E.a", "mock://E.b", "seda://E.c", "mock://E.d");
-
-        MockEndpoint mockEb = CamelContextHelper
-                .getMandatoryEndpoint(contextE, "mock://E.b", MockEndpoint.class);
-        MockEndpoint mockEd = CamelContextHelper
-                .getMandatoryEndpoint(contextE, "mock://E.d", MockEndpoint.class);
-
-
-        mockEb.expectedBodiesReceived(Constants.EXPECTED_BODIES_E_A);
-        mockEd.expectedBodiesReceived(Constants.EXPECTED_BODIES_E_C);
-
-        for (Object body : Constants.EXPECTED_BODIES_E_A) {
-            producerE.sendBody("seda:E.a", body);
+        CamelContext contextE = assertCamelContext("contextD");
+        assertHasEndpoints(contextE, "seda://D.a", "mock://D.b");
+        MockEndpoint mockDb = CamelContextHelper.getMandatoryEndpoint(contextE, "mock://D.b",
MockEndpoint.class);
+        mockDb.reset();
+        mockDb.expectedBodiesReceived(Constants.EXPECTED_BODIES_D_A);
+        for (Object body : Constants.EXPECTED_BODIES_D_A) {
+            producerD.sendBody("seda:D.a", body);
         }
-
-        for (Object body : Constants.EXPECTED_BODIES_E_C) {
-            producerE.sendBody("seda:E.c", body);
-        }
-
-        mockEb.assertIsSatisfied();
-        mockEd.assertIsSatisfied();
+        mockDb.assertIsSatisfied();
     }
 
     public static void assertHasEndpoints(CamelContext context, String... uris) {
         Map<String, Endpoint> endpointMap = context.getEndpointMap();
         for (String uri : uris) {
             Endpoint endpoint = endpointMap.get(uri);
-            assertNotNull(
-                    "CamelContext " + context + " does not have an Endpoint with URI " +
uri + " but has "
-                            + endpointMap.keySet(), endpoint);
+            assertNotNull("CamelContext " + context + " does not have an Endpoint with URI
" + uri + " but has " + endpointMap.keySet(), endpoint);
         }
     }
 

Copied: camel/trunk/tests/camel-itest-cdi/src/test/resources/log4j.properties (from r1404029,
camel/trunk/tests/camel-itest-cdi/src/main/resources/log4j.properties)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-cdi/src/test/resources/log4j.properties?p2=camel/trunk/tests/camel-itest-cdi/src/test/resources/log4j.properties&p1=camel/trunk/tests/camel-itest-cdi/src/main/resources/log4j.properties&r1=1404029&r2=1404048&rev=1404048&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-cdi/src/main/resources/log4j.properties (original)
+++ camel/trunk/tests/camel-itest-cdi/src/test/resources/log4j.properties Wed Oct 31 09:21:23
2012
@@ -1,30 +1,40 @@
-## ------------------------------------------------------------------------
+## ---------------------------------------------------------------------------
 ## 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.
-## ------------------------------------------------------------------------
+## ---------------------------------------------------------------------------
 
 #
-# The logging properties used
+# The logging properties used during tests..
 #
-log4j.rootLogger=INFO, stdout
+log4j.rootLogger=INFO, file
 
-# uncomment the next line to debug Camel
-#log4j.logger.org.apache.camel=DEBUG
+#log4j.logger.org.apache.camel.component.cdi=DEBUG
+#log4j.logger.org.apache.openwebbeans=DEBUG
 
 # CONSOLE appender not used by default
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
\ No newline at end of file
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+# MDC
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.file=target/camel-itest-cdi.log
+log4j.appender.file.append=true
+log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+# MDC
+#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n



Mime
View raw message