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 2016/05/25 14:29:13 UTC
[1/3] cxf git commit: Support @Policy annotation on impl methods.
Fixes the Policy annotation test Colm added
Repository: cxf
Updated Branches:
refs/heads/3.1.x-fixes 589f6c7fc -> 289a3e1a9
Support @Policy annotation on impl methods. Fixes the Policy annotation test Colm added
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3f248e14
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3f248e14
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3f248e14
Branch: refs/heads/3.1.x-fixes
Commit: 3f248e14bc592d465accb3be678df55741f4a002
Parents: 589f6c7
Author: Daniel Kulp <dk...@apache.org>
Authored: Tue May 24 13:30:21 2016 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Wed May 25 10:23:24 2016 -0400
----------------------------------------------------------------------
.../java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java | 5 ++---
.../cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java | 4 +++-
.../cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java | 4 +++-
.../test/java/org/apache/cxf/systest/ws/fault/FaultTest.java | 2 --
4 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/3f248e14/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
index b35295e..c9e2e32 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
@@ -91,9 +91,8 @@ public class PolicyAnnotationListener implements FactoryBeanListener {
if (ep.getEndpointInfo().getInterface() != null) {
addPolicies(factory, ep, cls);
- // this will allow us to support annotations in Implementations, but only for
- // class level annotations. Method level annotations are not currently supported
- // for implementations. The call has been moved here so that the ServiceInfo
+ // this will allow us to support annotations in Implementations.
+ // The call has been moved here so that the ServiceInfo
// policy stuff is loaded before jaxws factory calls the PolicyEngineImpl
addEndpointImplPolicies(factory, ep, implCls);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/3f248e14/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java
index 1c65fac..c55b832 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java
@@ -84,6 +84,7 @@ import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.ServiceImpl;
import org.apache.cxf.service.ServiceModelSchemaValidator;
+import org.apache.cxf.service.factory.FactoryBeanListener;
import org.apache.cxf.service.factory.FactoryBeanListener.Event;
import org.apache.cxf.service.factory.ServiceConstructionException;
import org.apache.cxf.service.factory.SimpleMethodDispatcher;
@@ -355,7 +356,8 @@ public class ReflectionServiceFactoryBean extends org.apache.cxf.service.factory
}
public void updateBindingOperation(BindingOperationInfo boi) {
- //nothing
+ Method m = getMethodDispatcher().getMethod(boi);
+ sendEvent(FactoryBeanListener.Event.BINDING_OPERATION_CREATED, boi.getBinding(), boi, m);
}
public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
http://git-wip-us.apache.org/repos/asf/cxf/blob/3f248e14/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
index 0d3d6a7..fbbf957 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
@@ -30,7 +30,9 @@ import org.example.contract.doubleit.DoubleItFault;
import org.example.contract.doubleit.DoubleItPortType;
@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt",
- serviceName = "DoubleItService",
+ serviceName = "DoubleItService",
+ portName = "DoubleItSoap11NoPolicyBinding",
+ name = "DoubleItSoap11NoPolicyBinding",
endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml")
http://git-wip-us.apache.org/repos/asf/cxf/blob/3f248e14/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
index 755f11b..e34a511 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
@@ -259,10 +259,8 @@ public class FaultTest extends AbstractBusClientServerTestBase {
bus.shutdown(true);
}
- // TODO - There seems to be a bug when a security policy is applied to a method as opposed to the class
// See DoubleItPortTypeImplJavaFirst
@org.junit.Test
- @org.junit.Ignore
public void testJavaFirst() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
[3/3] cxf git commit: Recording .gitmergeinfo Changes
Posted by dk...@apache.org.
Recording .gitmergeinfo Changes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/289a3e1a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/289a3e1a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/289a3e1a
Branch: refs/heads/3.1.x-fixes
Commit: 289a3e1a9a1f4c304ac441463ecb8fe96785d127
Parents: 2e89c38
Author: Daniel Kulp <dk...@apache.org>
Authored: Wed May 25 10:26:33 2016 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Wed May 25 10:26:33 2016 -0400
----------------------------------------------------------------------
.gitmergeinfo | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/289a3e1a/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 2b78b4e..4d584f9 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -21,6 +21,7 @@ B 47a431412dbd7669d89a70d6fed49053e70dfed1
B 4b37844e9c15812d1855d0babded79880d2cd6fb
B 4ddf74b1acd8f65b685c8e11b809a06807799f84
B 4f1afbf76d3e525163663b71104ce2adb9cb7a85
+B 517ef67f1a69d386de44153e5e09d51cb47bf4d7
B 519a67dfa240471bb585929f263cd85051a9eb06
B 53a46205871434d8c47ed45822e078e5ad6d2c60
B 54910695917fb63a11982a8dc96a3b4d088963c5
[2/3] cxf git commit: Updating policies annotation test
Posted by dk...@apache.org.
Updating policies annotation test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2e89c38c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2e89c38c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2e89c38c
Branch: refs/heads/3.1.x-fixes
Commit: 2e89c38ccfddf8097dbcb874b64c5b2ed8805d72
Parents: 3f248e1
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 25 11:36:28 2016 +0100
Committer: Daniel Kulp <dk...@apache.org>
Committed: Wed May 25 10:23:34 2016 -0400
----------------------------------------------------------------------
.../ws/fault/DoubleItPortTypeImplJavaFirst.java | 17 ++++++++---------
.../org/apache/cxf/systest/ws/fault/FaultTest.java | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/2e89c38c/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
index fbbf957..5e20524 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java
@@ -24,7 +24,9 @@ import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
+import org.apache.cxf.annotations.Policies;
import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.annotations.Policy.Placement;
import org.apache.cxf.feature.Features;
import org.example.contract.doubleit.DoubleItFault;
import org.example.contract.doubleit.DoubleItPortType;
@@ -35,22 +37,19 @@ import org.example.contract.doubleit.DoubleItPortType;
name = "DoubleItSoap11NoPolicyBinding",
endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
-// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml")
public class DoubleItPortTypeImplJavaFirst implements DoubleItPortType {
@Resource
WebServiceContext wsContext;
- //@Policies({
- // @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml")
- //@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml",
- // placement = Placement.BINDING_OPERATION)
- //})
-
- @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml")
+ @Policies({
+ @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml"),
+ @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml",
+ placement = Placement.BINDING_OPERATION_OUTPUT)
+ })
public int doubleIt(int numberToDouble) throws DoubleItFault {
Principal pr = wsContext.getUserPrincipal();
- if (pr == null || "alice".equals(pr.getName())) {
+ if ("alice".equals(pr.getName())) {
return numberToDouble * 2;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/2e89c38c/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
index e34a511..471f07c 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java
@@ -280,7 +280,7 @@ public class FaultTest extends AbstractBusClientServerTestBase {
// Make a successful invocation
((BindingProvider)utPort).getRequestContext().put("security.username", "alice");
utPort.doubleIt(25);
- /*
+
// Now make an invocation using another username
((BindingProvider)utPort).getRequestContext().put("security.username", "bob");
((BindingProvider)utPort).getRequestContext().put("security.password", "password");
@@ -290,7 +290,7 @@ public class FaultTest extends AbstractBusClientServerTestBase {
} catch (Exception ex) {
assertTrue(ex.getMessage().contains("This is a fault"));
}
- */
+
((java.io.Closeable)utPort).close();
bus.shutdown(true);
}