servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoeh...@apache.org
Subject svn commit: r676605 - in /servicemix/sandbox/cargo-servicemix/cargo-sample: ./ src/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/servicemix/ src/test/java/org/apache/servicemix/samples/ src/test/java/or...
Date Mon, 14 Jul 2008 14:35:02 GMT
Author: kkoehler
Date: Mon Jul 14 07:35:01 2008
New Revision: 676605

URL: http://svn.apache.org/viewvc?rev=676605&view=rev
Log:
added "real" itest

Added:
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/BridgeTest.java
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j-tests.properties
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j.properties
    servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/request.xml
Modified:
    servicemix/sandbox/cargo-servicemix/cargo-sample/   (props changed)
    servicemix/sandbox/cargo-servicemix/cargo-sample/pom.xml

Propchange: servicemix/sandbox/cargo-servicemix/cargo-sample/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jul 14 07:35:01 2008
@@ -0,0 +1,4 @@
+servicemix3
+target
+.classpath
+.project

Modified: servicemix/sandbox/cargo-servicemix/cargo-sample/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-sample/pom.xml?rev=676605&r1=676604&r2=676605&view=diff
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-sample/pom.xml (original)
+++ servicemix/sandbox/cargo-servicemix/cargo-sample/pom.xml Mon Jul 14 07:35:01 2008
@@ -1,121 +1,171 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <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>org.apache.servicemix.tooling</groupId>
-    <artifactId>cargo-test</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <name>Cargo Core Containers</name>
-    <packaging>jar</packaging>
-
-    <properties>
-        <servicemix-version>3.2.1</servicemix-version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.servicemix.samples</groupId>
-            <artifactId>camel-sa</artifactId>
-            <type>zip</type>
-            <version>${servicemix-version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.servicemix</groupId>
-            <artifactId>apache-servicemix</artifactId>
-            <type>tar.gz</type>
-            <version>${servicemix-version}</version>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.cargo</groupId>
-                <artifactId>cargo-maven2-plugin</artifactId>
-                <version>1.0-alpha-5</version>
-                <executions>
-                    <execution>
-                        <id>start-container</id>
-                        <phase>pre-integration-test</phase>
-                        <goals>
-                            <goal>start</goal>
-                        </goals>
-                        <configuration>
-                            <wait>false</wait>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>deploy-into-container</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>deploy</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>stop-container</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>stop</goal>
-                        </goals>
-                    </execution>
-
-                </executions>
-                <configuration>
-                    <container>
-                        <containerId>servicemix3x</containerId>
-                        <zipUrlInstaller>
-                            <url>
-                                file:${settings.localRepository}/org/apache/servicemix/apache-servicemix/${servicemix-version}/apache-servicemix-${servicemix-version}.tar.gz
-                            </url>
-                            <installDir>servicemix3</installDir>
-                        </zipUrlInstaller>
-                        <implementation>
-                            org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalContainer
-                        </implementation>
-                    </container>
-                    <configuration>
-                        <type>standalone</type>
-                        <implementation>
-                            org.apache.servicemix.cargo.container.ServiceMix3xStandaloneLocalConfiguration
-                        </implementation>
-                    </configuration>
-
-                    <deployer>
-                        <implementation>
-                            org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalDeployer
-                        </implementation>
-                        <type>installed</type>
-                        <deployables>
-                            <deployable>
-                                <groupId>
-                                    org.apache.servicemix.samples
-                                </groupId>
-                                <artifactId>camel-sa</artifactId>
-                                <type>zip</type>
-                                <implementation>
-                                    org.apache.servicemix.cargo.container.ServiceMixDeployable
-                                </implementation>
-                            </deployable>
-                        </deployables>
-                    </deployer>
-
-                </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.servicemix.tooling</groupId>
-                        <artifactId>
-                            cargo-container-servicemix
-                        </artifactId>
-                        <version>1.0-SNAPSHOT</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
+	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>org.apache.servicemix.tooling</groupId>
+	<artifactId>cargo-test</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<name>Cargo Core Containers</name>
+	<packaging>jar</packaging>
+
+	<properties>
+		<servicemix-version>3.2.1</servicemix-version>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.servicemix.samples</groupId>
+			<artifactId>camel-sa</artifactId>
+			<type>zip</type>
+			<version>${servicemix-version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.servicemix.samples.bridge</groupId>
+			<artifactId>bridge-sa</artifactId>
+			<type>zip</type>
+			<version>${servicemix-version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.servicemix</groupId>
+			<artifactId>apache-servicemix</artifactId>
+			<type>tar.gz</type>
+			<version>${servicemix-version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-httpclient</groupId>
+			<artifactId>commons-httpclient</artifactId>
+			<version>3.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.activemq</groupId>
+			<artifactId>activemq-core</artifactId>
+			<version>5.1.0</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+				<executions>
+					<execution>
+						<id>surefire-integration</id>
+						<phase>integration-test</phase>
+						<goals>
+							<goal>test</goal>
+						</goals>
+						<configuration>
+							<skip>false</skip>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+			<plugin>
+				<groupId>org.codehaus.cargo</groupId>
+				<artifactId>cargo-maven2-plugin</artifactId>
+				<version>1.0-alpha-5</version>
+				<executions>
+					<execution>
+						<id>start-container</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>start</goal>
+						</goals>
+						<configuration>
+							<wait>false</wait>
+						</configuration>
+					</execution>
+					<execution>
+						<id>deploy-into-container</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>deploy</goal>
+						</goals>
+					</execution>
+					<execution>
+						<id>stop-container</id>
+						<phase>post-integration-test</phase>
+						<goals>
+							<goal>stop</goal>
+						</goals>
+					</execution>
+
+				</executions>
+				<configuration>
+					<container>
+						<containerId>servicemix3x</containerId>
+						<zipUrlInstaller>
+							<url>
+								file:${settings.localRepository}/org/apache/servicemix/apache-servicemix/${servicemix-version}/apache-servicemix-${servicemix-version}.tar.gz
+							</url>
+							<installDir>servicemix3</installDir>
+						</zipUrlInstaller>
+						<implementation>
+							org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalContainer
+						</implementation>
+					</container>
+					<configuration>
+						<type>standalone</type>
+						<implementation>
+							org.apache.servicemix.cargo.container.ServiceMix3xStandaloneLocalConfiguration
+						</implementation>
+					</configuration>
+
+					<deployer>
+						<implementation>
+							org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalDeployer
+						</implementation>
+						<type>installed</type>
+						<deployables>
+							<deployable>
+								<groupId>
+									org.apache.servicemix.samples
+								</groupId>
+								<artifactId>camel-sa</artifactId>
+								<type>zip</type>
+								<implementation>
+									org.apache.servicemix.cargo.container.ServiceMixDeployable
+								</implementation>
+							</deployable>
+							<deployable>
+								<groupId>
+									org.apache.servicemix.samples.bridge
+								</groupId>
+								<artifactId>bridge-sa</artifactId>
+								<type>zip</type>
+								<implementation>
+									org.apache.servicemix.cargo.container.ServiceMixDeployable
+								</implementation>
+							</deployable>
+						</deployables>
+					</deployer>
+
+				</configuration>
+				<dependencies>
+					<dependency>
+						<groupId>org.apache.servicemix.tooling</groupId>
+						<artifactId>
+							cargo-container-servicemix
+						</artifactId>
+						<version>1.0-SNAPSHOT</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+		</plugins>
+	</build>
 
 
 </project>

Added: servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/BridgeTest.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/BridgeTest.java?rev=676605&view=auto
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/BridgeTest.java
(added)
+++ servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/java/org/apache/servicemix/samples/bridge/BridgeTest.java
Mon Jul 14 07:35:01 2008
@@ -0,0 +1,86 @@
+/*
+ * 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.servicemix.samples.bridge;
+
+import java.io.FileInputStream;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+
+import junit.framework.TestCase;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+/**
+ * Simple Bridge Test.
+ * Send a HTML post request to servicemix and waits 
+ * for the "translated" jms message.
+ */
+public class BridgeTest extends TestCase {
+
+	private static String url = "http://localhost:8192/bridge/";
+	
+	private static boolean recieved = false;
+	
+	public void testSimpleCall() throws Exception {
+
+		ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
+        Destination outQueue = new ActiveMQQueue("bridge.output");
+        Connection connection = factory.createConnection();
+        connection.start();
+        Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
+        MessageConsumer createConsumer = session.createConsumer(outQueue);
+        createConsumer.setMessageListener(new MessageListener() {
+		
+			public void onMessage(Message arg0) {
+				BridgeTest.recieved = true;
+				ActiveMQTextMessage msg = (ActiveMQTextMessage) arg0;
+				assertNotNull(msg);
+			}
+		
+		});
+                        
+		HttpClient client = new HttpClient();
+		
+		PostMethod post = new PostMethod(url);
+		post.setRequestBody(new FileInputStream("src/test/resources/request.xml"));
+		
+		int executeMethod = client.executeMethod(post);
+		
+		assertEquals(202, executeMethod);
+
+		int maxTry = 100;
+		while(!recieved || maxTry == 0) {
+			Thread.sleep(200);
+			maxTry--;
+		}
+		
+		session.close();
+		connection.close();
+				
+	}
+	
+}

Added: servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j-tests.properties
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j-tests.properties?rev=676605&view=auto
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j-tests.properties
(added)
+++ servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j-tests.properties
Mon Jul 14 07:35:01 2008
@@ -0,0 +1,42 @@
+# 
+# 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 during tests..
+#
+log4j.rootLogger=DEBUG, out
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.activemq.store.journal=INFO
+log4j.logger.org.activeio.journal=INFO
+
+# 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
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true

Added: servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j.properties?rev=676605&view=auto
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j.properties (added)
+++ servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/log4j.properties Mon
Jul 14 07:35:01 2008
@@ -0,0 +1,42 @@
+# 
+# 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 during tests..
+#
+log4j.rootLogger=DEBUG, stdout
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.activemq.store.journal=INFO
+log4j.logger.org.activeio.journal=INFO
+
+# 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{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true

Added: servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/request.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/request.xml?rev=676605&view=auto
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/request.xml (added)
+++ servicemix/sandbox/cargo-servicemix/cargo-sample/src/test/resources/request.xml Mon Jul
14 07:35:01 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
+  <e:Body>
+    <ping>
+      <pingRequest>
+        <message xmlns="http://soap">hello</message>
+      </pingRequest>
+    </ping>
+  </e:Body>
+</e:Envelope>
\ No newline at end of file



Mime
View raw message