Author: kstam
Date: Mon Aug 26 22:28:48 2013
New Revision: 1517716

URL: http://svn.apache.org/r1517716
Log:
JUDDI-622 no need for a stack trace here

Added:
    
juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/package-info.java 
  (with props)
    juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/
    
juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/GetPublisherDetailTest.java
Modified:
    
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java

Modified: 
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java?rev=1517716&r1=1517715&r2=1517716&view=diff
==============================================================================
--- 
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java
 (original)
+++ 
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckFindEntity.java
 Mon Aug 26 22:28:48 2013
@@ -120,9 +120,7 @@ public class TckFindEntity 
                        System.out.println(result.getBusinessEntity().size());
                } catch (Exception e) {
                        try {
-                               System.out.println(e.getMessage());
-                               System.out.println(e.getCause());
-                               e.printStackTrace();
+                               System.out.println("(Expected) Error message = 
" + e.getMessage());
                                DispositionReport report = 
DispositionReportFaultMessage.getDispositionReport(e);
                                assertNotNull(report);
                                
assertTrue(report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED));

Added: 
juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/package-info.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/package-info.java?rev=1517716&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/GetPublisherDetailTest.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/GetPublisherDetailTest.java?rev=1517716&view=auto
==============================================================================
--- 
juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/GetPublisherDetailTest.java
 (added)
+++ 
juddi/trunk/uddi-ws/src/test/java/org/apache/juddi/api_v3/GetPublisherDetailTest.java
 Mon Aug 26 22:28:48 2013
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2001-2009 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.api_v3;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.transform.stream.StreamSource;
+
+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;
+import org.uddi.api_v3.ObjectFactory;
+
+/**
+ * Testing marshalling functionality, making sure UTF-8 is handled correctly.
+ * 
+ * @author <a href="mailto:[email protected]";>Kurt T Stam</a>
+ */
+public class GetPublisherDetailTest {
+
+       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_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>";
+       /**
+        * Testing going from object to XML using JAXB using a XML Fragment.
+        */
+       @Test 
+       public void marshall()
+       {
+               try {
+                       JAXBContext 
jaxbContext=JAXBContext.newInstance("org.apache.juddi.api_v3");
+                       Marshaller marshaller = jaxbContext.createMarshaller();
+                       
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+                       marshaller.setProperty(Marshaller.JAXB_FRAGMENT, 
Boolean.TRUE);
+                       marshaller.setProperty(Marshaller.JAXB_ENCODING, 
"UTF-8");
+                       ObjectFactory factory = new ObjectFactory();
+                       GetPublisherDetail getPublisherDetail = new 
GetPublisherDetail();
+                       getPublisherDetail.authInfo = "some token";
+                       
+                       StringWriter writer = new StringWriter();
+                       JAXBElement<GetPublisherDetail> element = new 
JAXBElement<GetPublisherDetail>(new 
QName("","fragment"),GetPublisherDetail.class,getPublisherDetail);
+                       marshaller.marshal(element,writer);
+                       String actualXml=writer.toString();
+                       System.out.println(actualXml);
+                       
+                       
+               } catch (JAXBException jaxbe) {
+                       jaxbe.printStackTrace();
+                       
+                       fail("No exception should be thrown");
+               }
+       }
+       
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to