cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r967308 - in /cxf/trunk/distribution/src/main/release/samples/aegis: ./ src/demo/hw/client/ src/demo/hw/server/ testSrc/ testSrc/org/ testSrc/org/apache/ testSrc/org/apache/cxf/ testSrc/org/apache/cxf/sample/ testSrc/org/apache/cxf/sample/t...
Date Fri, 23 Jul 2010 23:49:51 GMT
Author: bimargulies
Date: Fri Jul 23 23:49:51 2010
New Revision: 967308

URL: http://svn.apache.org/viewvc?rev=967308&view=rev
Log:
Add unit test to Aegis sample -- fix bug it reveals.

Added:
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/
    cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
  (with props)
Modified:
    cxf/trunk/distribution/src/main/release/samples/aegis/pom.xml
    cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java
    cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/Server.java

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/pom.xml?rev=967308&r1=967307&r2=967308&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/pom.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/pom.xml Fri Jul 23 23:49:51 2010
@@ -32,6 +32,7 @@
             </resource>
         </resources>
         <sourceDirectory>src</sourceDirectory>
+	<testSourceDirectory>testSrc</testSourceDirectory>
         <plugins>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
@@ -40,6 +41,13 @@
                     <target>1.5</target>
                 </configuration>
             </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+				<version>2.5</version>
+				<configuration>
+					<forkMode>always</forkMode>
+				</configuration>
+            </plugin>
         </plugins>
     </build>
     <profiles>
@@ -135,11 +143,17 @@
             <artifactId>cxf-rt-transports-http</artifactId>
             <version>${cxf.version}</version>
         </dependency>
-        <!-- Jetty is needed if you're using the CXFServlet -->
+        <!-- The server example in here launches the embedded jetty. Not needed
+	     if you deploy a WAR. -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>${cxf.version}</version>
         </dependency>
+	<dependency>
+	  <groupId>junit</groupId>
+	  <artifactId>junit</artifactId>
+	  <version>4.8.1</version>
+	</dependency>
     </dependencies>
 </project>

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java?rev=967308&r1=967307&r2=967308&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java (original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/client/Client.java Fri
Jul 23 23:49:51 2010
@@ -21,6 +21,7 @@ package demo.hw.client;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.Text;
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
@@ -48,7 +49,7 @@ public final class Client {
         Document doc = client.getADocument();
         Element e = (Element) doc.getFirstChild();
         System.out.println(e.getTagName());
-        e = (Element) e.getFirstChild();
-        System.out.println(e.getTagName());
+        Text t = (Text) e.getFirstChild();
+        System.out.println(t);
     }
 }

Modified: cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/Server.java?rev=967308&r1=967307&r2=967308&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/Server.java (original)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/src/demo/hw/server/Server.java Fri
Jul 23 23:49:51 2010
@@ -24,7 +24,7 @@ import org.apache.cxf.frontend.ServerFac
 
 public class Server {
 
-    protected Server() throws Exception {
+    public Server() throws Exception {
         HelloWorldImpl helloworldImpl = new HelloWorldImpl();
         ServerFactoryBean svrFactory = new ServerFactoryBean();
         svrFactory.setServiceClass(HelloWorld.class);

Added: cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java?rev=967308&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
(added)
+++ cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
Fri Jul 23 23:49:51 2010
@@ -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.
+ */
+
+package org.apache.cxf.sample.test;
+
+import demo.hw.client.Client;
+import demo.hw.server.Server;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class TestAegisSample {
+    @BeforeClass
+    public static void startServer() throws Exception {
+        new Server();
+    }
+    
+    @Test
+    public void testClient() throws Exception {
+        Client.main(null);
+    }
+
+}

Propchange: cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/distribution/src/main/release/samples/aegis/testSrc/org/apache/cxf/sample/test/TestAegisSample.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message