cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r694464 - in /cxf/branches/2.1.x-fixes: ./ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ rt/ws/policy/src/main/resources/META-INF/cxf/ rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/ rt/ws/policy/src/test/java/org/apache/cxf/ws/...
Date Thu, 11 Sep 2008 20:38:03 GMT
Author: dkulp
Date: Thu Sep 11 13:38:00 2008
New Revision: 694464

URL: http://svn.apache.org/viewvc?rev=694464&view=rev
Log:
Merged revisions 692310 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r692310 | dkulp | 2008-09-04 20:21:03 -0400 (Thu, 04 Sep 2008) | 2 lines
  
  Change the default to not throw an exception when encountering an unknown extensor.  Parse
it into a XmlPrimitiveAssertion and allow the effective policy computation consider other
alternatives.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
    cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
    cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
    cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImplTest.java
    cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
    cxf/branches/2.1.x-fixes/systests/pom.xml

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 11 13:38:00 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692466,692499
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
Thu Sep 11 13:38:00 2008
@@ -29,12 +29,15 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.spring.MapProvider;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.apache.cxf.ws.policy.builder.xml.XmlPrimitiveAssertion;
 
 /**
  * 
@@ -46,8 +49,9 @@
     private static final Logger LOG 
         = LogUtils.getL7dLogger(AssertionBuilderRegistryImpl.class);
     private static final int IGNORED_CACHE_SIZE = 10;
-    private boolean ignoreUnknownAssertions; 
+    private boolean ignoreUnknownAssertions = true; 
     private List<QName> ignored = new ArrayList<QName>(IGNORED_CACHE_SIZE);
+    private Bus bus;
     
     public AssertionBuilderRegistryImpl() {
         super(null);
@@ -60,6 +64,10 @@
         super(builders.createMap());
     }
 
+    public void setBus(Bus b) {
+        bus = b;
+    }
+
     public Class<?> getRegistrationType() {
         return AssertionBuilderRegistry.class;
     }
@@ -92,7 +100,7 @@
                 if (!alreadyWarned) {
                     LOG.warning(m.toString());
                 }
-                return null;
+                return new XmlPrimitiveAssertion(element, bus.getExtension(PolicyConstants.class));
             } else {
                 throw new PolicyException(m);
             }

Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
Thu Sep 11 13:38:00 2008
@@ -60,7 +60,7 @@
     private PolicyRegistry registry;
     private Collection<PolicyProvider> policyProviders;
     private boolean enabled;
-    private boolean ignoreUnknownAssertions;
+    private boolean ignoreUnknownAssertions = true;
     private boolean addedBusInterceptors;
     private AlternativeSelector alternativeSelector;
 

Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/resources/META-INF/cxf/cxf-extension-policy.xml
Thu Sep 11 13:38:00 2008
@@ -29,6 +29,7 @@
               <property name="idsProperty" value="knownElements"/>
             </bean>
         </constructor-arg>
+        <property name="bus" ref="cxf"/>
     </bean>
     
     <bean class="org.apache.cxf.ws.policy.PolicyConstants"

Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImplTest.java?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImplTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImplTest.java
Thu Sep 11 13:38:00 2008
@@ -23,6 +23,7 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.ws.policy.builder.xml.XmlPrimitiveAssertion;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 import org.junit.After;
@@ -50,6 +51,7 @@
     @Test
     public void testBuildUnknownAssertion() {
         AssertionBuilderRegistry reg = new AssertionBuilderRegistryImpl();
+        reg.setIgnoreUnknownAssertions(false);
         Element[] elems = new Element[11];
         QName[] qnames = new QName[11];
         for (int i = 0; i < 11; i++) {
@@ -71,11 +73,11 @@
         reg.setIgnoreUnknownAssertions(true);
         assertTrue(reg.isIgnoreUnknownAssertions());
         for (int i = 0; i < 10; i++) {
-            assertNull(reg.build(elems[i]));
+            assertTrue(reg.build(elems[i]) instanceof XmlPrimitiveAssertion);
         }
         for (int i = 9; i >= 0; i--) {
-            assertNull(reg.build(elems[i]));
+            assertTrue(reg.build(elems[i]) instanceof XmlPrimitiveAssertion);
         }
-        assertNull(reg.build(elems[10]));        
+        assertTrue(reg.build(elems[10]) instanceof XmlPrimitiveAssertion);
     }
 }

Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
Thu Sep 11 13:38:00 2008
@@ -128,6 +128,7 @@
         bus = control.createMock(Bus.class);
         EasyMock.expect(bus.getExtension(PolicyConstants.class)).andReturn(constants).anyTimes();
         AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();        
+        abr.setIgnoreUnknownAssertions(false);
         XMLPrimitiveAssertionBuilder ab = new XMLPrimitiveAssertionBuilder();
         ab.setBus(bus);
         abr.register(new QName("http://cxf.apache.org/test/assertions", "A"), ab);

Modified: cxf/branches/2.1.x-fixes/systests/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/pom.xml?rev=694464&r1=694463&r2=694464&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/pom.xml (original)
+++ cxf/branches/2.1.x-fixes/systests/pom.xml Thu Sep 11 13:38:00 2008
@@ -43,9 +43,9 @@
                 <executions>
                     <execution>
                         <id>add-source</id>
-                        <phase>generate-sources</phase>
+                        <phase>generate-test-sources</phase>
                         <goals>
-                            <goal>add-source</goal>
+                            <goal>add-test-source</goal>
                         </goals>
                         <configuration>
                             <sources>
@@ -79,8 +79,8 @@
                 <version>${project.version}</version>
                 <executions>
                     <execution>
-                        <id>generate-sources</id>
-                        <phase>generate-sources</phase>
+                        <id>generate-test-sources</id>
+                        <phase>generate-test-sources</phase>
                         <configuration>
                             <outputDir>${basedir}/target/generated/src/test/resources/wsdl/type_test_corba/</outputDir>
                             <wsdltoidlOptions>



Mime
View raw message