juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfa...@apache.org
Subject svn commit: r726777 - /webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java
Date Mon, 15 Dec 2008 19:29:50 GMT
Author: jfaath
Date: Mon Dec 15 11:29:50 2008
New Revision: 726777

URL: http://svn.apache.org/viewvc?rev=726777&view=rev
Log:
fixing AuthInfoTest whereas reversal of namespace was causing test failure.

Modified:
    webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java

Modified: webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java?rev=726777&r1=726776&r2=726777&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-ws/src/test/java/org/uddi/api_v3/AuthInfoTest.java
Mon Dec 15 11:29:50 2008
@@ -13,6 +13,7 @@
 
 import static junit.framework.Assert.fail;
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
 
 import org.junit.Test;
 import org.uddi.api_v3.AuthToken;
@@ -21,11 +22,18 @@
 
 public class AuthInfoTest {
 
-	private final static String EXPECTED_XML_FRAGMENT = "<fragment xmlns:ns3=\"urn:uddi-org:api_v3\"
xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\">\n"
+	private final static String EXPECTED_XML_FRAGMENT1 = "<fragment xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\"
xmlns:ns3=\"urn:uddi-org:api_v3\">\n"
                                                        +"    <ns3:authInfo>AuthInfo
String</ns3:authInfo>\n"
                                                        +"</fragment>";
+	private final static String EXPECTED_XML_FRAGMENT2 = "<fragment xmlns:ns3=\"urn:uddi-org:api_v3\"
xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\">\n"
+        +"    <ns3:authInfo>AuthInfo String</ns3:authInfo>\n"
+        +"</fragment>";
 	private final static String UTF8_WORD = "メインページ";
-	private final static String EXPECTED_UTF8_XML_FRAGMENT = "<fragment xmlns:ns3=\"urn:uddi-org:api_v3\"
xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\">\n"
+
+	private final static String EXPECTED_UTF8_XML_FRAGMENT1 = "<fragment xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\"
xmlns:ns3=\"urn:uddi-org:api_v3\">\n"
+        +"    <ns3:authInfo>" + UTF8_WORD + "</ns3:authInfo>\n"
+        +"</fragment>";
+	private final static String EXPECTED_UTF8_XML_FRAGMENT2 = "<fragment xmlns:ns3=\"urn:uddi-org:api_v3\"
xmlns:ns2=\"http://www.w3.org/2000/09/xmldsig#\">\n"
         +"    <ns3:authInfo>" + UTF8_WORD + "</ns3:authInfo>\n"
         +"</fragment>";
 	/**
@@ -47,7 +55,9 @@
 			JAXBElement<AuthToken> element = new JAXBElement<AuthToken>(new QName("","fragment"),AuthToken.class,authToken);
 			marshaller.marshal(element,writer);
 			String actualXml=writer.toString();
-			assertEquals(EXPECTED_XML_FRAGMENT, actualXml);
+			
+			boolean assertion = EXPECTED_XML_FRAGMENT1.equals(actualXml) || EXPECTED_XML_FRAGMENT2.equals(actualXml);
+			assertTrue(assertion);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}
@@ -61,7 +71,7 @@
 		try {
 			JAXBContext jaxbContext=JAXBContext.newInstance("org.uddi.api_v3");
 			Unmarshaller unMarshaller = jaxbContext.createUnmarshaller();
-			StringReader reader = new StringReader(EXPECTED_XML_FRAGMENT);
+			StringReader reader = new StringReader(EXPECTED_XML_FRAGMENT1);
 			JAXBElement<AuthToken> element = unMarshaller.unmarshal(new StreamSource(reader),AuthToken.class);
 			String infoString = element.getValue().getAuthInfo();
 			assertEquals("AuthInfo String", infoString);
@@ -88,7 +98,9 @@
 			JAXBElement<AuthToken> element = new JAXBElement<AuthToken>(new QName("","fragment"),AuthToken.class,authToken);
 			marshaller.marshal(element,writer);
 			String actualXml=writer.toString();
-			assertEquals(EXPECTED_UTF8_XML_FRAGMENT, actualXml);
+
+			boolean assertion = EXPECTED_UTF8_XML_FRAGMENT1.equals(actualXml) || EXPECTED_UTF8_XML_FRAGMENT2.equals(actualXml);
+			assertTrue(assertion);
 		} catch (JAXBException jaxbe) {
 			fail("No exception should be thrown");
 		}
@@ -103,7 +115,7 @@
 		try {
 			JAXBContext jaxbContext=JAXBContext.newInstance("org.uddi.api_v3");
 			Unmarshaller unMarshaller = jaxbContext.createUnmarshaller();
-			StringReader reader = new StringReader(EXPECTED_UTF8_XML_FRAGMENT);
+			StringReader reader = new StringReader(EXPECTED_UTF8_XML_FRAGMENT1);
 			JAXBElement<AuthToken> utf8Element = unMarshaller.unmarshal(new StreamSource(reader),AuthToken.class);
 			String infoString = utf8Element.getValue().getAuthInfo();
 			assertEquals(UTF8_WORD, infoString);



---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org


Mime
View raw message