1 /* 2 * $Header: /cvsroot/ebxmlrr/ebxmlrr/test/com/sun/ebxml/registry/conformance/SetUsefulClassificationSchemes.java,v 1.7 2002/12/27 13:32:54 ritzmann Exp $ 3 */ 4 5 package com.sun.ebxml.registry.conformance; 6 7 import junit.framework.*; 8 import com.sun.ebxml.registry.interfaces.soap.*; 9 import javax.xml.soap.*; 10 import java.io.*; 11 12 /*** 13 * 14 * @author mzaremba 15 */ 16 public class SetUsefulClassificationSchemes extends TestCase{ 17 18 private static String url = null; 19 20 private SOAPSender sender; 21 private SOAPMessage reply; 22 private TestSupport supportMethods; 23 24 public SetUsefulClassificationSchemes(String name) { 25 super(name); 26 supportMethods = new TestSupport(); 27 } 28 29 public void setUp() { 30 try { 31 sender = supportMethods.connectRegistry(url); 32 } catch (Exception e) { 33 fail("Tests failed during Set up phase"); 34 e.printStackTrace(); 35 } 36 } 37 protected void tearDown() throws Exception { 38 sender = null; 39 System.gc(); 40 } 41 42 43 /*** 44 * Submit UNSPSC Classification Scheme with 10 000+ Classification Nodes 45 */ 46 public void testUNSPSCClassificationScheme() { 47 try { 48 supportMethods.printMessage("SUBMIT UNSPSC CLASSIFICATION SCHEME"); 49 supportMethods.submitFileToRegistry(sender, "SubmitUNSPSC.xml"); 50 } catch(Exception e) { 51 fail("Exception has been thrown during setting" + 52 " useful classification schemes by SubmitUNSPSC.xml"); 53 e.printStackTrace(); 54 } 55 } 56 57 /*** 58 * Submit RosettaNet Technical Dictionary Classification 59 */ 60 public void testRosettaNetClassificationScheme() { 61 try { 62 supportMethods.printMessage("SUBMIT ROSETTANET TECH. DICT. CLASS."); 63 supportMethods.submitFileToRegistry(sender, "SubmitRNTDCSscheme.xml"); 64 } catch(Exception e) { 65 fail("Exception has been thrown during setting" + 66 " useful classification schemes by SubmitRNTDCSscheme.xml"); 67 e.printStackTrace(); 68 } 69 } 70 71 /*** 72 * Determine UUID of the RosettaNet Technical Dictionary Scheme and 73 * UUID of External Identifier Identification Scheme 74 * Submit 350+ new Classification Nodes elements to link to the 75 * RosettaNet Technical Dictionary Classification Scheme, and whose leaf 76 * nodes carry the class external identifier assigned by RNTD 77 */ 78 public void testUpdateRosettaNetClassificationScheme() { 79 try { 80 supportMethods.printMessage("DETERMINE UUID OF ROSETTANET T.D.C."); 81 reply = supportMethods.submitFileToRegistry(sender, "FindRNTDC128bitUUID.xml"); 82 String UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 83 supportMethods.setUUIDInFile(UUID, "RNTDCS128bitUUID", "SubmitRNTDCSnodes.xml"); 84 85 supportMethods.printMessage("UUID OF EXTERNAL IDENTIFIER IDENT. SCHEME"); 86 reply = supportMethods.submitFileToRegistry(sender, "FindEXTIDCS128bitUUID.xml"); 87 UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 88 supportMethods.setUUIDInFile(UUID, "EXTIDCS128bitUUID", "SubmitRNTDCSnodes_new.xml"); 89 90 supportMethods.printMessage("SUBMIT 350 (421) NEW NODES TO ROSETTANET T.D.C."); 91 supportMethods.submitFileToRegistry(sender, "SubmitRNTDCSnodes_new_new.xml"); 92 } catch(Exception e) { 93 fail("Exception thrown during setting Classification Nodes in" + 94 " Roseta Net Classification Scheme"); 95 e.printStackTrace(); 96 } 97 } 98 99 /*** 100 * Submit a partial collection of ClassificationNode elements from 101 * Data Type Hierarchy Classification 102 */ 103 public void testDataHierarchyClassificationScheme() { 104 try { 105 supportMethods.printMessage("SUBMIT DATA TYPE HIERARCHY CLASSIFICATION"); 106 supportMethods.submitFileToRegistry(sender, "SubmitDTCSscheme.xml"); 107 } catch(Exception e) { 108 fail("Exception has been thrown during setting" + 109 " useful classification schemes by SubmitDTCSscheme.xml"); 110 e.printStackTrace(); 111 } 112 } 113 114 /*** 115 * 116 */ 117 public void testUpdateDataHierarchyClassificationScheme() { 118 try { 119 supportMethods.printMessage("UUID OF DATA TYPE HIERARCHY CLASS."); 120 reply = supportMethods.submitFileToRegistry(sender, "FindDTCbitUUID.xml"); 121 String UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 122 123 supportMethods.setUUIDInFile(UUID, "xxxxxxx", "FindNumberUUID.xml"); 124 supportMethods.setUUIDInFile(UUID, "xxxxxxx", "FindStringUUID.xml"); 125 supportMethods.setUUIDInFile(UUID, "xxxxxxx", "FindLogicalUUID.xml"); 126 127 supportMethods.printMessage("UUID OF NUMBER IN DATA TYPE HIERARCHY CLASS."); 128 reply = supportMethods.submitFileToRegistry(sender, "FindNumberUUID_new.xml"); 129 UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 130 supportMethods.setUUIDInFile(UUID, "DTCS:Number128bitUUID", "SubmitDTCSnodes.xml"); 131 132 supportMethods.printMessage("UUID OF STRING IN DATA TYPE HIERARCHY CLASS."); 133 reply = supportMethods.submitFileToRegistry(sender, "FindStringUUID_new.xml"); 134 UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 135 supportMethods.setUUIDInFile(UUID, "DTCS:String128bitUUID", "SubmitDTCSnodes_new.xml"); 136 137 supportMethods.printMessage("UUID OF LOGICAL IN DATA TYPE HIERARCHY CLASS."); 138 reply = supportMethods.submitFileToRegistry(sender, "FindLogicalUUID_new.xml"); 139 UUID = supportMethods.getAttributeValue(reply, "ObjectRef", "id"); 140 supportMethods.setUUIDInFile(UUID, "DTCS:Logical128bitUUID", "SubmitDTCSnodes_new_new.xml"); 141 142 supportMethods.printMessage("SUBMIT DATA TYPE HIERARCHY NODES"); 143 supportMethods.submitFileToRegistry(sender, "SubmitDTCSnodes_new_new_new.xml"); 144 145 146 } catch(Exception e) { 147 fail("Exception has been thrown during updating Classification Nodes in" + 148 " Data Type Hierarchy Classification Scheme"); 149 e.printStackTrace(); 150 } 151 } 152 153 /*** 154 * Add tests to the suite 155 */ 156 public static Test suite() { 157 TestSuite suite = new TestSuite(); 158 suite.addTest(new SetUsefulClassificationSchemes("testUNSPSCClassificationScheme")); 159 suite.addTest(new SetUsefulClassificationSchemes("testRosettaNetClassificationScheme")); 160 suite.addTest(new SetUsefulClassificationSchemes("testUpdateRosettaNetClassificationScheme")); 161 suite.addTest(new SetUsefulClassificationSchemes("testDataHierarchyClassificationScheme")); 162 suite.addTest(new SetUsefulClassificationSchemes("testUpdateDataHierarchyClassificationScheme")); 163 return suite; 164 } 165 166 public void runMyTests() { 167 TestSuite suite = new TestSuite(); 168 suite.addTest(suite()); 169 TestResult result = new TestResult(); 170 suite.run(result); 171 supportMethods.processResults("Set useful classification schemes", result); 172 supportMethods.printRaport("CONFORMANCE TESTS", true); 173 } 174 175 public static void main(String[] args) { 176 url = TestSupport.getURL(args); 177 new SetUsefulClassificationSchemes("SetUsefulClassificationSchemes").runMyTests(); 178 } 179 }

This page was automatically generated by Maven