cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r515896 - in /incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers: HandlerInvocationUsingAddNumbersTest.java TestResourceResolver.java
Date Thu, 08 Mar 2007 02:22:46 GMT
Author: jliu
Date: Wed Mar  7 18:22:45 2007
New Revision: 515896

URL: http://svn.apache.org/viewvc?view=rev&rev=515896
Log:
One file missed in my previous commit.

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
  (with props)
Modified:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java?view=diff&rev=515896&r1=515895&r2=515896
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java
Wed Mar  7 18:22:45 2007
@@ -123,13 +123,13 @@
         assertTrue(h.isPostConstructInvoked());      
     }  
 
-    public void xtestHandlerInjectingResource() throws Exception {
+    public void testHandlerInjectingResource() throws Exception {
         //When CXF is deployed in a servlet container, ServletContextResourceResolver is
used to resolve 
         //Servlet context resources.
         Bus bus = BusFactory.getDefaultBus();
         ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
         assertNotNull(resourceManager);
-        //resourceManager.addResourceResolver(new TestResourceResolver());
+        resourceManager.addResourceResolver(new TestResourceResolver());
        
         URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
 

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java?view=auto&rev=515896
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
Wed Mar  7 18:22:45 2007
@@ -0,0 +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.
+ */
+
+package org.apache.cxf.systest.handlers;
+
+import java.io.InputStream;
+
+import org.apache.cxf.resource.ResourceResolver;
+
+
+public class TestResourceResolver implements ResourceResolver {
+
+    public final InputStream getAsStream(final String string) {
+        return null;
+    }
+
+    public final <T> T resolve(final String entryName, final Class<T> clz) {
+       
+        if (String.class.isAssignableFrom(clz) && entryName.equalsIgnoreCase("handlerResource"))
{
+            return clz.cast(new String("injectedValue"));
+        }
+        return null;
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestResourceResolver.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message