cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r571646 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ rt/core/src/main/java/org/apache/cxf/databinding/source/ rt/core/src/main/java/org/apache/cxf/databinding/stax/ rt/core/src/main/java/org/apache/cxf/endpoint/ ...
Date Fri, 31 Aug 2007 23:22:03 GMT
Author: dandiep
Date: Fri Aug 31 16:22:02 2007
New Revision: 571646

URL: http://svn.apache.org/viewvc?rev=571646&view=rev
Log:
Supply endpoint properties to Aegis so we can look at things like which implementation we
should use for services which use interfaces. Also, set client timeout to 60 seconds because
10 can be frustrating in the debugger and 10 is probably too low for some invocations anyway.

Added:
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
  (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
  (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
  (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
  (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReader.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReader.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReader.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReader.java Fri Aug
31 16:22:02 2007
@@ -29,6 +29,7 @@
 
 public interface DataReader<T> {
     String FAULT = DataReader.class.getName() + "Fault";
+    String ENDPOINT = DataReader.class.getName() + "Endpoint";
 
     Object read(T input);
     Object read(MessagePartInfo part, T input);

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java Fri Aug
31 16:22:02 2007
@@ -27,8 +27,11 @@
 import org.apache.cxf.service.model.MessagePartInfo;
 
 public interface DataWriter<T> {
+    String ENDPOINT = DataWriter.class.getName() + "Endpoint";
+    
     void write(Object obj, T output);
     void write(Object obj, MessagePartInfo part, T output);
     void setSchema(Schema s);
     void setAttachments(Collection<Attachment> attachments);
+    void setProperty(String key, Object value);
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
Fri Aug 31 16:22:02 2007
@@ -70,4 +70,8 @@
     public void setAttachments(Collection<Attachment> attachments) {
  
     }
+
+    public void setProperty(String key, Object value) {
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
Fri Aug 31 16:22:02 2007
@@ -75,4 +75,8 @@
     public void setAttachments(Collection<Attachment> attachments) {
 
     }   
+
+    public void setProperty(String key, Object value) {
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
Fri Aug 31 16:22:02 2007
@@ -136,7 +136,10 @@
         }
 
         public void setAttachments(Collection<Attachment> attachments) {
+        }
 
-        }   
+        public void setProperty(String key, Object value) {
+        }
+        
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Fri
Aug 31 16:22:02 2007
@@ -73,7 +73,7 @@
     protected Bus bus;
     protected ConduitSelector conduitSelector;
     protected ClientOutFaultObserver outFaultObserver; 
-    protected int synchronousTimeout = 10000; // default 10 second timeout
+    protected int synchronousTimeout = 60000; // default 60 second timeout
     
     protected PhaseChainCache outboundChainCache = new PhaseChainCache();
     protected PhaseChainCache inboundChainCache = new PhaseChainCache();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Fri Aug 31 16:22:02 2007
@@ -72,6 +72,7 @@
                                                                    BUNDLE, service.getName()));
         }
         dataReader.setAttachments(message.getAttachments());
+        dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().get(Endpoint.class));
         setSchemaInMessage(service, message, dataReader);
 
         

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
Fri Aug 31 16:22:02 2007
@@ -29,6 +29,7 @@
 import javax.xml.validation.Schema;
 
 import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -124,6 +125,7 @@
         }
         
         writer.setAttachments(atts);
+        writer.setProperty(DataWriter.ENDPOINT, message.getExchange().get(Endpoint.class));
         
         setSchemaOutMessage(service, message, writer);
         return writer;

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/Context.java
Fri Aug 31 16:22:02 2007
@@ -21,6 +21,8 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.interceptor.Fault;
@@ -32,15 +34,27 @@
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  * @since Feb 13, 2004
  */
-public class Context extends HashMap<String, Object> {
+public class Context implements Map<String, Object> {
     private TypeMapping typeMapping;
     private Collection<Attachment> attachments;
     private boolean writeXsiTypes;
     private boolean readXsiTypes = true;
     private List<String> overrideTypes;
     private Fault fault;
+    private Map<String, Object> properties;
     
     public Context() {
+       this(new HashMap<String, Object>());
+    }
+
+    public Context(Map<String, Object> properties) {
+        this.properties = properties;
+    }
+
+    public Context(boolean initProps) {
+        if (initProps) {
+            this.properties = new HashMap<String, Object>();
+        }
     }
 
     public TypeMapping getTypeMapping() {
@@ -91,5 +105,61 @@
         return fault;
     }
 
+    public void clear() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public boolean containsKey(Object key) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean containsValue(Object value) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Set<java.util.Map.Entry<String, Object>> entrySet() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Object get(Object key) {
+        return properties.get(key);
+    }
+
+    public boolean isEmpty() {
+        return properties.isEmpty();
+    }
+
+    public Set<String> keySet() {
+        return properties.keySet();
+    }
+
+    public Object put(String key, Object value) {
+        return properties.put(key, value);
+    }
+
+    public void putAll(Map<? extends String, ? extends Object> t) {
+        properties.putAll(t);
+    }
+
+    public Object remove(Object key) {
+        return properties.remove(key);
+    }
+
+    public int size() {
+        return properties.size();
+    }
+
+    public Collection<Object> values() {
+        return properties.values();
+    }
+
+    public void setDelegateProperties(Map<String, Object> p) {
+        this.properties = p;
+    }
+    
     
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
Fri Aug 31 16:22:02 2007
@@ -34,6 +34,7 @@
 import org.apache.cxf.aegis.xml.stax.ElementReader;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.databinding.DataReader;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
@@ -45,12 +46,13 @@
 
     private AegisDatabinding databinding;
 
-    private Context context = new Context();
+    private Context context;
 
     private Map<String, Object> properties;
     
     public XMLStreamDataReader(AegisDatabinding databinding) {
         this.databinding = databinding;
+        this.context = new Context(false);
     }
 
     public Object read(MessagePartInfo part, XMLStreamReader input) {
@@ -61,7 +63,13 @@
         if (type == null) {
             throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG));
         }
-
+        
+        Map<String, Object> props = (Endpoint)getProperty(ENDPOINT);
+        if (props == null) {
+            props = new HashMap<String, Object>();
+        }
+        context.setDelegateProperties(props);
+        
          // I don't think this is the right type mapping
         context.setTypeMapping(type.getTypeMapping());
         context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?rev=571646&r1=571645&r2=571646&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
Fri Aug 31 16:22:02 2007
@@ -19,6 +19,8 @@
 package org.apache.cxf.aegis.databinding;
 
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamWriter;
@@ -32,6 +34,7 @@
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
@@ -45,6 +48,8 @@
 
     private Collection<Attachment> attachments;
     
+    private Map<String, Object> properties;
+    
     public XMLStreamDataWriter(AegisDatabinding databinding) {
         this.databinding = databinding;
     }
@@ -65,7 +70,13 @@
             throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG));
         }
 
-        Context context = new Context();
+
+        Map<String, Object> props = (Endpoint)getProperty(ENDPOINT);
+        if (props == null) {
+            props = new HashMap<String, Object>();
+        }
+        Context context = new Context(props);
+        
         // I'm not sure that this is the right type mapping
         context.setTypeMapping(type.getTypeMapping());
         context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
@@ -95,4 +106,22 @@
     public void write(Object obj, XMLStreamWriter output) {
         write(obj, null, output);
     }
+
+
+    public void setProperty(String prop, Object value) {
+        if (properties == null) {
+            properties = new HashMap<String, Object>();
+        }
+        
+        properties.put(prop, value);
+    }
+
+    public Object getProperty(String key) {
+        if (properties == null) {
+            return null;
+        }
+        return properties.get(key);
+    }
+
+
 }

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java?rev=571646&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
Fri Aug 31 16:22:02 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.aegis.proxy;
+
+public interface Hello {
+
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/Hello.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java?rev=571646&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
Fri Aug 31 16:22:02 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.aegis.proxy;
+
+public interface HelloProxyService {
+    Hello sayHiWithProxy();
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/HelloProxyService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java?rev=571646&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
Fri Aug 31 16:22:02 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.aegis.proxy;
+
+public class MyHello implements Hello {
+
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/MyHello.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java?rev=571646&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
Fri Aug 31 16:22:02 2007
@@ -0,0 +1,64 @@
+/**
+ * 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.aegis.proxy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.service.invoker.BeanInvoker;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ProxyTest extends AbstractAegisTest {
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+
+        Server s = createService(HelloProxyService.class, null);
+        s.getEndpoint().getService().setInvoker(new BeanInvoker(new HelloProxyServiceImpl()));
+    }
+
+    @Test
+    public void testProxy() throws Exception {
+        ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
+        proxyFac.setAddress("local://HelloProxyService");
+        proxyFac.setServiceClass(HelloProxyService.class);
+        proxyFac.setBus(getBus());
+        setupAegis(proxyFac.getClientFactoryBean());
+        Map<String, Object> props = new HashMap<String, Object>();
+        props.put(Hello.class.getName() + ".implementation", MyHello.class.getName());
+        proxyFac.setProperties(props);
+        
+        HelloProxyService client = (HelloProxyService)proxyFac.create();
+        
+        Hello h = client.sayHiWithProxy();
+        assertTrue(h instanceof MyHello);
+    }
+    
+    public static class HelloProxyServiceImpl implements HelloProxyService {
+
+        public Hello sayHiWithProxy() {
+            return new MyHello();
+        }
+        
+    }
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/proxy/ProxyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message