You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/04/09 05:10:36 UTC

svn commit: r763500 - in /servicemix/smx4/features/trunk/examples/bridge-camel: ./ client/ client/src/ client/src/main/ client/src/main/java/ client/src/main/java/org/ client/src/main/java/org/apache/ client/src/main/java/org/apache/servicemix/ client/...

Author: ffang
Date: Thu Apr  9 03:10:35 2009
New Revision: 763500

URL: http://svn.apache.org/viewvc?rev=763500&view=rev
Log:
[SMX4-268]add java client for the new added bridge-camel example which is easy for CPI test

Added:
    servicemix/smx4/features/trunk/examples/bridge-camel/client/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml   (with props)
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java   (with props)
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/
    servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml   (with props)
Modified:
    servicemix/smx4/features/trunk/examples/bridge-camel/pom.xml

Added: servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml?rev=763500&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml Thu Apr  9 03:10:35 2009
@@ -0,0 +1,61 @@
+<?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">
+
+<!--
+
+    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.
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix.examples</groupId>
+        <artifactId>bridge-camel</artifactId>
+        <version>4.1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.examples.bridge-camel</groupId>
+    <artifactId>bridge-camel-client</artifactId>
+    <name>ServiceMix :: Samples :: Bridge :: Camel :: Client</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>servicemix-utils</artifactId>
+            <version>${servicemix-utils.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration> 
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <configuration>
+                    <mainClass>org.apache.servicemix.samples.bridgecamel.Client</mainClass>
+                    <includePluginDependencies>false</includePluginDependencies>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java?rev=763500&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java (added)
+++ servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java Thu Apr  9 03:10:35 2009
@@ -0,0 +1,60 @@
+/*
+ * 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.bridgecamel;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.servicemix.util.FileUtil;
+
+public class Client{
+    public static void main(String[] args) {
+        try {
+	    new Client().sendRequest();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public void sendRequest() throws Exception {
+        URLConnection connection = new URL("http://localhost:8192/bridge/")
+                .openConnection();
+        connection.setDoInput(true);
+        connection.setDoOutput(true);
+        OutputStream os = connection.getOutputStream();
+        // Post the request file.
+        InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/bridgecamel/request.xml");
+        FileUtil.copyInputStream(fis, os);
+        // Read the response.
+        InputStream is = connection.getInputStream();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        FileUtil.copyInputStream(is, baos);
+        System.out.println("the response is =====>");
+        System.out.println(baos.toString());
+        if (connection instanceof HttpURLConnection) {
+            int retCode = ((HttpURLConnection)connection).getResponseCode();
+            System.out.println("the response code is =====>");//expected is 202 for this example
+            System.out.println(retCode);
+        }
+       
+    }
+
+}

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/java/org/apache/servicemix/samples/bridgecamel/Client.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml?rev=763500&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml (added)
+++ servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml Thu Apr  9 03:10:35 2009
@@ -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">hel lo</message>
+      </pingRequest>
+    </ping>
+  </e:Body>
+</e:Envelope>

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx4/features/trunk/examples/bridge-camel/client/src/main/resources/org/apache/servicemix/samples/bridgecamel/request.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: servicemix/smx4/features/trunk/examples/bridge-camel/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge-camel/pom.xml?rev=763500&r1=763499&r2=763500&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge-camel/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/bridge-camel/pom.xml Thu Apr  9 03:10:35 2009
@@ -35,6 +35,7 @@
     <modules>
       <module>bridge-camel-su</module>
       <module>bridge-camel-sa</module>
+      <module>client</module>
     </modules>
 
     <!-- Add ServiceMix repositories for snaphots and releases -->