1 /* 2 * $Header: /cvsroot/ebxmlrr/ebxmlrr/test/com/sun/ebxml/registry/conformance/SetPreDefinedClassificationSchemes.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 * 3. Structure population and verification 15 * 3.1 Pre-defined classification schemes 16 * 17 * RIM requires the pre-defined auditable event types to be supported by the Registry as 18 * a specific ClassificationSchemes instance with "EventType", and also requires 19 * that each ExternalIdentifier instance reference a pre-existing classification scheme 20 * 21 * @author mzaremba 22 */ 23 24 public class SetPreDefinedClassificationSchemes extends TestCase { 25 26 private static String url = null; 27 28 private SOAPSender sender; 29 private SOAPMessage reply; 30 private TestSupport supportMethods; 31 private static String[] fileNames = {"SubmitEventTypeCS.xml", "SubmitEXTIDCS.xml", 32 "SubmitRIMObjectTypeCS.xml", "SubmitRIMStabilityTypesCS.xml", 33 "SubmitRIMStatusTypesCS.xml", "SubmitRIMAssocTypesCS.xml", 34 "SubmitRIMDataTypesCS.xml"}; 35 private String fileName =""; 36 37 public SetPreDefinedClassificationSchemes(String name) { 38 super(name); 39 supportMethods = new TestSupport(); 40 try { 41 sender = supportMethods.connectRegistry(url); 42 } catch (Exception e) { 43 e.printStackTrace(); 44 fail("Tests failed during Set up phase"); 45 } 46 } 47 48 public void setUp() { 49 50 } 51 52 protected void tearDown() throws Exception { 53 System.gc(); 54 } 55 56 /*** 57 * 1.3. Predefined classification schemes 58 */ 59 public void testPreDefinedClassificationSchemes() { 60 try { 61 supportMethods.printMessage("SUBMIT CLASSIFICATION: " + fileName); 62 supportMethods.submitFileToRegistry(sender, fileName); 63 } catch(Exception e) { 64 e.printStackTrace(); 65 fail("Exception has been thrown during setting" + 66 " Pre-defined classification schemes by " + fileName); 67 } 68 } 69 70 public void setTestName(String name){ 71 fileName = name; 72 } 73 74 /*** 75 * Add tests to the suite 76 */ 77 public static Test suite() { 78 TestSuite suite = new TestSuite(); 79 for (int i=0; i < fileNames.length; i++) { 80 SetPreDefinedClassificationSchemes test = 81 new SetPreDefinedClassificationSchemes("testPreDefinedClassificationSchemes"); 82 test.setTestName(fileNames[i]); 83 suite.addTest(test); 84 } 85 return suite; 86 } 87 88 public void runMyTests() { 89 TestSuite suite = new TestSuite(); 90 suite.addTest(suite()); 91 TestResult result = new TestResult(); 92 suite.run(result); 93 supportMethods.processResults("Set Pre-Defined Classification Schemes", result); 94 } 95 96 public static void main(String[] args) { 97 url = TestSupport.getURL(args); 98 new SetPreDefinedClassificationSchemes("SetPreDefinedClassificationSchemes").runMyTests(); 99 } 100 }

This page was automatically generated by Maven