1 22 package org.jboss.test.jaxr.scout.publish.infomodel; 23 24 import java.util.ArrayList ; 25 import java.util.Collection ; 26 27 import javax.xml.registry.BulkResponse ; 28 import javax.xml.registry.LifeCycleManager ; 29 import javax.xml.registry.infomodel.ClassificationScheme ; 30 import javax.xml.registry.infomodel.Concept ; 31 import javax.xml.registry.infomodel.ExternalLink ; 32 import javax.xml.registry.infomodel.Key ; 33 34 import org.jboss.test.jaxr.scout.JaxrBaseTestCase; 35 36 38 45 public class JaxrClassficationTestCase extends JaxrBaseTestCase 46 { 47 private static final String UUID_TYPE = "uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4"; 48 49 public void testClassificationOnConcepts() throws Exception 50 { 51 login(); 52 getJAXREssentials(); 53 Concept concept=null; 54 Collection concepts = new ArrayList (1); 55 String portTypeName = "Test Port Type"; 56 concept = blm.createConcept( null, portTypeName ,"" ); 57 ExternalLink wsdlLink = blm.createExternalLink("http://test.org/"+portTypeName,"TEST Port Type definition"); 58 concept.addExternalLink(wsdlLink); 59 60 ClassificationScheme TYPE = (ClassificationScheme )bqm.getRegistryObject(UUID_TYPE, LifeCycleManager.CLASSIFICATION_SCHEME); 61 assertTrue("Classifications are not empty", TYPE.getClassifications().size() > 0); 62 System.out.println("TYPE.Classifications = " +TYPE.getClassifications()); 63 concept.addClassification(blm.createClassification( TYPE, blm.createInternationalString("TEST CLASSIFICATION"), "test portType") ); 64 65 concepts.add(concept); 66 BulkResponse response = blm.saveConcepts( concepts ); 67 if (response != null && response.getCollection().size() > 0) 68 { 69 concept.setKey((Key )response.getCollection().iterator().next() ); 70 assertNotNull("Key created != null", concept.getKey()); 71 System.out.println("Concept Key = " + concept.getKey() + "\"."); 72 } 73 74 Concept savedConcept = (Concept )bqm.getRegistryObject(concept.getKey().getId(), 76 LifeCycleManager.CONCEPT ); 77 assertNotNull("savedConcept is not null", savedConcept); 78 Collection collection = savedConcept.getClassifications(); 79 assertNotNull("Classifications is not null", collection); 80 assertTrue("Classifications is not empty", collection.isEmpty() == false); 81 } 82 } 83 | Popular Tags |