You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/02/06 21:56:51 UTC

svn commit: r504290 - in /incubator/cxf/trunk/testutils/src/test/java/org: ./ apache/ apache/header_test/ apache/header_test/rpc/ apache/header_test/rpc/TestRPCHeaderTest.java

Author: dkulp
Date: Tue Feb  6 12:56:50 2007
New Revision: 504290

URL: http://svn.apache.org/viewvc?view=rev&rev=504290
Log:
The actual test case

Added:
    incubator/cxf/trunk/testutils/src/test/java/org/
    incubator/cxf/trunk/testutils/src/test/java/org/apache/
    incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/
    incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/
    incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java   (with props)

Added: incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java?view=auto&rev=504290
==============================================================================
--- incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java (added)
+++ incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java Tue Feb  6 12:56:50 2007
@@ -0,0 +1,66 @@
+/**
+ * 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.header_test.rpc;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+import javax.jws.WebParam;
+
+import junit.framework.TestCase;
+
+public class TestRPCHeaderTest extends TestCase {
+    Class<TestRPCHeader> cls = TestRPCHeader.class;
+
+    public void testHeader1() {
+        Method meths[] = cls.getMethods();
+        for (Method m : meths) {
+            if ("testHeader1".equals(m.getName())) {
+                Annotation annotations[][] = m.getParameterAnnotations();
+                assertEquals(2, annotations.length);
+                assertEquals(1, annotations[1].length);
+                assertTrue(annotations[1][0] instanceof WebParam);
+                WebParam parm = (WebParam)annotations[1][0];
+                assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
+                assertEquals("inHeader", parm.partName());
+                assertEquals("headerMessage", parm.name());
+                assertTrue(parm.header());
+            }
+        }
+        
+    }
+
+    public void testInOutHeader() {
+        Method meths[] = cls.getMethods();
+        for (Method m : meths) {
+            if ("testInOutHeader".equals(m.getName())) {
+                Annotation annotations[][] = m.getParameterAnnotations();
+                assertEquals(2, annotations.length);
+                assertEquals(1, annotations[1].length);
+                assertTrue(annotations[1][0] instanceof WebParam);
+                WebParam parm = (WebParam)annotations[1][0];
+                assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
+                assertEquals("inOutHeader", parm.partName());
+                assertEquals("headerMessage", parm.name());
+                assertTrue(parm.header());
+            }
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/testutils/src/test/java/org/apache/header_test/rpc/TestRPCHeaderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date