Author: palin
Date: 2007-06-01 01:17:35 -0400 (Fri, 01 Jun 2007)
New Revision: 3352
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/TestMultipleEndpointPolicy.java
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy.xml
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy2.xml
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy.xml
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy2.xml
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy.xml
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy2.xml
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
Log:
Added new test case on PolicyMetaDataBuilder
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-06-01
05:03:42 UTC (rev 3351)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-06-01
05:17:35 UTC (rev 3352)
@@ -281,10 +281,7 @@
}
catch (UnsupportedPolicy e)
{
- if (log.isDebugEnabled())
- {
- log.debug("Policy Not supported:" + policy.getPolicyURI());
- }
+ log.warn("Policy Not supported:" + policy.getPolicyURI());
}
}
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java 2007-06-01
05:03:42 UTC (rev 3351)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java 2007-06-01
05:17:35 UTC (rev 3352)
@@ -105,4 +105,47 @@
("uselessPortTypePolicy".equalsIgnoreCase(id4) &&
"uselessPortTypePolicy2".equalsIgnoreCase(id3)));
}
+
+ public void testAnnotationEndpointScopePolicies() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+
map.put("http://www.fabrikam123.example.com/stock",
NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder(deployer);
+ builder.setToolMode(true);
+
+ EndpointMetaData epMetaData = new ServerEndpointMetaData(null, new
QName("dummyPortName"),
+ new QName("dummyPortTypeName"), Type.JAXWS);
+ builder.processPolicyAnnotations(epMetaData, TestMultipleEndpointPolicy.class,
null);
+
+ PolicyMetaExtension policyExt =
(PolicyMetaExtension)epMetaData.getExtension(Constants.URI_WS_POLICY);
+
+ Collection<Policy> portPolicies =
policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT);
+ assertNotNull(portPolicies);
+ assertEquals(2, portPolicies.size());
+ Iterator<Policy> portPoliciesIterator = portPolicies.iterator();
+ String id1 = portPoliciesIterator.next().getId();
+ String id2 = portPoliciesIterator.next().getId();
+ assertTrue(("uselessPortPolicy".equalsIgnoreCase(id1) &&
"uselessPortPolicy2".equalsIgnoreCase(id2)) ||
+ ("uselessPortPolicy".equalsIgnoreCase(id2) &&
"uselessPortPolicy2".equalsIgnoreCase(id1)));
+
+ Collection<Policy> portTypePolicies =
policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT_TYPE);
+ assertNotNull(portTypePolicies);
+ assertEquals(2, portTypePolicies.size());
+ Iterator<Policy> portTypePoliciesIterator = portTypePolicies.iterator();
+ String id3 = portTypePoliciesIterator.next().getId();
+ String id4 = portTypePoliciesIterator.next().getId();
+ assertTrue(("uselessPortTypePolicy".equalsIgnoreCase(id3) &&
"uselessPortTypePolicy2".equalsIgnoreCase(id4)) ||
+ ("uselessPortTypePolicy".equalsIgnoreCase(id4) &&
"uselessPortTypePolicy2".equalsIgnoreCase(id3)));
+
+ Collection<Policy> bindingPolicies =
policyExt.getPolicies(PolicyScopeLevel.WSDL_BINDING);
+ assertNotNull(bindingPolicies);
+ assertEquals(2, bindingPolicies.size());
+ Iterator<Policy> bindingPoliciesIterator = bindingPolicies.iterator();
+ String id5 = bindingPoliciesIterator.next().getId();
+ String id6 = bindingPoliciesIterator.next().getId();
+ assertTrue(("uselessBindingPolicy".equalsIgnoreCase(id5) &&
"uselessBindingPolicy2".equalsIgnoreCase(id6)) ||
+ ("uselessBindingPolicy".equalsIgnoreCase(id6) &&
"uselessBindingPolicy2".equalsIgnoreCase(id5)));
+ }
+
}
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/TestMultipleEndpointPolicy.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/TestMultipleEndpointPolicy.java
(rev 0)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/TestMultipleEndpointPolicy.java 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,22 @@
+package org.jboss.test.ws.jaxws.wspolicy;
+
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.annotation.Policy;
+import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
+
+@PolicyAttachment({@Policy( policyFileLocation="AnnotationPortPolicy.xml",
+ scope = PolicyScopeLevel.WSDL_PORT ),
+ @Policy( policyFileLocation="AnnotationPortPolicy2.xml",
+ scope = PolicyScopeLevel.WSDL_PORT ),
+ @Policy( policyFileLocation="AnnotationBindingPolicy.xml",
+ scope = PolicyScopeLevel.WSDL_BINDING ),
+ @Policy( policyFileLocation="AnnotationBindingPolicy2.xml",
+ scope = PolicyScopeLevel.WSDL_BINDING ),
+ @Policy( policyFileLocation="AnnotationPortTypePolicy.xml",
+ scope = PolicyScopeLevel.WSDL_PORT_TYPE ),
+ @Policy(
policyFileLocation="AnnotationPortTypePolicy2.xml",
+ scope = PolicyScopeLevel.WSDL_PORT_TYPE )})
+public class TestMultipleEndpointPolicy
+{
+
+}
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessBindingPolicy"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy2.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy2.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationBindingPolicy2.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessBindingPolicy2"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessPortPolicy"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy2.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy2.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortPolicy2.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessPortPolicy2"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessPortTypePolicy"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy2.xml
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy2.xml
(rev 0)
+++
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/AnnotationPortTypePolicy2.xml 2007-06-01
05:17:35 UTC (rev 3352)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<wsp:Policy wsu:Id="uselessPortTypePolicy2"
xmlns:fab="http://www.fabrikam123.example.com/stock"
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <fab:useless>nothing</fab:useless>
+</wsp:Policy>