Author: coheigea
Date: Thu Mar 21 12:20:41 2013
New Revision: 1459257
URL: http://svn.apache.org/r1459257
Log:
Fixing build
Modified:
cxf/branches/2.5.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
Modified:
cxf/branches/2.5.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1459257&r1=1459256&r2=1459257&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
(original)
+++
cxf/branches/2.5.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
Thu Mar 21 12:20:41 2013
@@ -148,96 +148,5 @@ public class JavaFirstPolicyServiceTest
outProps.put(WSHandlerConstants.USER, username);
return outProps;
}
-<<<<<<< HEAD
-=======
- @org.junit.Test
- public void testJavaFirstWsdl() throws Exception {
- Document doc = loadWsdl("JavaFirstPolicyService");
-
- Element portType =
DOMUtils.getFirstChildWithName(doc.getDocumentElement(), WSDL_NAMESPACE,
"portType");
- assertNotNull(portType);
-
- List<Element> operationMessages =
DOMUtils.getChildrenWithName(portType, WSDL_NAMESPACE, "operation");
- assertEquals(5, operationMessages.size());
-
- Element operationOne = getOperationElement("doOperationOne",
operationMessages);
- assertEquals("#InternalTransportAndUsernamePolicy",
- getMessagePolicyReferenceId(operationOne, Type.INPUT,
Constants.URI_POLICY_NS));
- Element operationTwo = getOperationElement("doOperationTwo",
operationMessages);
- assertEquals("#TransportAndUsernamePolicy",
- getMessagePolicyReferenceId(operationTwo, Type.INPUT,
Constants.URI_POLICY_NS));
- Element operationThree = getOperationElement("doOperationThree",
operationMessages);
- assertEquals("#InternalTransportAndUsernamePolicy",
- getMessagePolicyReferenceId(operationThree, Type.INPUT,
Constants.URI_POLICY_NS));
- Element operationFour = getOperationElement("doOperationFour",
operationMessages);
- assertEquals("#TransportAndUsernamePolicy",
- getMessagePolicyReferenceId(operationFour, Type.INPUT,
Constants.URI_POLICY_NS));
- Element operationPing = getOperationElement("doPing",
operationMessages);
- assertNull(getMessagePolicyReferenceId(operationPing, Type.INPUT,
Constants.URI_POLICY_NS));
-
- List<Element> policyMessages =
DOMUtils.getChildrenWithName(doc.getDocumentElement(),
-
Constants.URI_POLICY_NS, "Policy");
-
- assertEquals(2, policyMessages.size());
-
- // validate that both the internal and external policies are included
- assertEquals("TransportAndUsernamePolicy",
getPolicyId(policyMessages.get(0)));
- assertEquals("InternalTransportAndUsernamePolicy",
getPolicyId(policyMessages.get(1)));
- }
-
- private Document loadWsdl(String serviceName) throws Exception {
- HttpURLConnection connection = getHttpConnection("http://localhost:" +
PORT
- + "/" + serviceName +
"?wsdl");
- InputStream is = connection.getInputStream();
- String wsdlContents = IOUtils.toString(is);
-
- //System.out.println(wsdlContents);
- return DOMUtils.readXml(new StringReader(wsdlContents));
- }
-
- private String getPolicyId(Element element) {
- return element.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
- PolicyConstants.WSU_ID_ATTR_NAME);
- }
-
- private Element getOperationElement(String operationName, List<Element>
operationMessages) {
- Element operationElement = null;
- for (Element operation : operationMessages) {
- if (operationName.equals(operation.getAttributeNS(null, "name"))) {
- operationElement = operation;
- break;
- }
- }
- assertNotNull(operationElement);
- return operationElement;
- }
-
- private String getMessagePolicyReferenceId(Element operationElement, Type
type, String policyNamespace) {
- Element messageElement =
DOMUtils.getFirstChildWithName(operationElement, WSDL_NAMESPACE,
-
type.name().toLowerCase());
- assertNotNull(messageElement);
- Element policyReference =
DOMUtils.getFirstChildWithName(messageElement, policyNamespace,
-
"PolicyReference");
- if (policyReference != null) {
- return policyReference.getAttributeNS(null, "URI");
- } else {
- return null;
- }
- }
-
-<<<<<<< HEAD
- private String getOperationPolicyReferenceId(Element operationElement,
String policyNamespace) {
- Element policyReference =
DOMUtils.getFirstChildWithName(operationElement, policyNamespace,
->>>>>>> 4c6a8d2... Merged revisions 1458926 via git cherry-pick from
-
"PolicyReference");
- if (policyReference != null) {
- return policyReference.getAttributeNS(null, "URI");
- } else {
- return null;
- }
- }
->>>>>>> ba4d301... Merged revisions 1458929 via git cherry-pick from
-=======
->>>>>>> 8e9bd13... Fixing failing build
}