コード例 #1
0
ファイル: MMSFunctionalTest.java プロジェクト: CBIIT/cagrid2
  @Test
  public void testFunctionalMMSService() {
    try {

      MetadataModelService mmsService = getOsgiService(MetadataModelService.class, 30000L);
      assertNotNull(mmsService);

      // make sure we can generate domain models and annotate metadata
      UMLProjectIdentifer project = new UMLProjectIdentifer();
      project.setIdentifier("caCORE 3.2");
      project.setVersion("3.2");

      System.out.println(
          "Creating domain model for project: "
              + project.getIdentifier()
              + " (version:"
              + project.getVersion()
              + ")");

      // TEST THE MMS OSGI SERVICE
      DomainModel model = null;
      try {
        model =
            mmsService.generateDomainModelForPackages(
                project, new String[] {"gov.nih.nci.cabio.domain"});
        System.out.println(model.getProjectLongName());
        for (Iterator iterator = model.getExposedUMLClassCollection().getUMLClass().iterator();
            iterator.hasNext(); ) {
          UMLClass type = (UMLClass) iterator.next();
          System.out.println("\t" + type.getClassName());
        }
      } catch (InvalidUMLProjectIndentifier e) {
        e.printStackTrace();
        fail(ExceptionUtils.getFullStackTrace(e));
      }

      assertNotNull(model);

    } catch (Exception e) {
      e.printStackTrace();
      fail(ExceptionUtils.getFullStackTrace(e));
    }
  }
コード例 #2
0
ファイル: MMSFunctionalTest.java プロジェクト: CBIIT/cagrid2
  @Test
  public void testFunctionalMMS() {
    try {

      MMS mmsImpl = getOsgiService(MMS.class, 30000L);
      assertNotNull(mmsImpl);

      // make sure we can generate domain models and annotate metadata
      UMLProjectIdentifer project = new UMLProjectIdentifer();
      project.setIdentifier("caCORE 3.2");
      project.setVersion("3.2");

      System.out.println(
          "Creating domain model for project: "
              + project.getIdentifier()
              + " (version:"
              + project.getVersion()
              + ")");

      // TEST THE MMS CADSR IMPL
      DomainModel domainModel = null;
      try {
        domainModel =
            mmsImpl.generateDomainModelForPackages(
                project, (List<String>) Arrays.asList(new String[] {"gov.nih.nci.cabio.domain"}));
        System.out.println("FOUND A DOMAIN MODEL" + domainModel.getProjectLongName());
        for (Iterator iterator =
                domainModel.getExposedUMLClassCollection().getUMLClass().iterator();
            iterator.hasNext(); ) {
          UMLClass type = (UMLClass) iterator.next();
          System.out.println("\t" + type.getClassName());
        }
      } catch (InvalidUMLProjectIndentifier e) {
        e.printStackTrace();
      }

      assertNotNull(domainModel);
    } catch (Exception e) {
      e.printStackTrace();
      fail(ExceptionUtils.getFullStackTrace(e));
    }
  }
コード例 #3
0
ファイル: MMSFunctionalTest.java プロジェクト: CBIIT/cagrid2
  @Test
  public void testFunctionalMMSSoap() {
    try {

      // get mms soap client
      MetadataModelServicePortType mmsSoap = getMMSSoapClient();
      assertNotNull(mmsSoap);
      MMS mmsSoapClient = new MMSSoapClient(mmsSoap);

      // make sure we can generate domain models and annotate metadata
      UMLProjectIdentifer project = new UMLProjectIdentifer();
      project.setIdentifier("caCORE 3.2");
      project.setVersion("3.2");

      System.out.println(
          "Creating domain model for project: "
              + project.getIdentifier()
              + " (version:"
              + project.getVersion()
              + ")");

      // TEST THE MMS Soap SERVICE
      DomainModel dmodel = null;
      try {
        dmodel =
            mmsSoapClient.generateDomainModelForPackages(
                project, Arrays.asList(new String[] {"gov.nih.nci.cabio.domain"}));
        System.out.println(dmodel.getProjectLongName());
        for (Iterator iterator = dmodel.getExposedUMLClassCollection().getUMLClass().iterator();
            iterator.hasNext(); ) {
          UMLClass type = (UMLClass) iterator.next();
          System.out.println("\t" + type.getClassName());
        }
      } catch (InvalidUMLProjectIndentifier e) {
        e.printStackTrace();
        fail(ExceptionUtils.getFullStackTrace(e));
      }

      dmodel = null;
      try {
        dmodel =
            mmsSoapClient.generateDomainModelForClasses(
                project,
                Arrays.asList(
                    new String[] {
                      "gov.nih.nci.cabio.domain.Agent",
                      "gov.nih.nci.cabio.domain.Clone",
                      "gov.nih.nci.cabio.domain.Cytoband"
                    }));
        System.out.println(dmodel.getProjectLongName());
        assertNotNull(dmodel);
        Assert.assertEquals(dmodel.getExposedUMLClassCollection().getUMLClass().size(), 3);
        for (Iterator iterator = dmodel.getExposedUMLClassCollection().getUMLClass().iterator();
            iterator.hasNext(); ) {
          UMLClass type = (UMLClass) iterator.next();
          System.out.println("\t" + type.getClassName());
        }
      } catch (InvalidUMLProjectIndentifier e) {
        e.printStackTrace();
        fail(ExceptionUtils.getFullStackTrace(e));
      }

    } catch (Exception e) {
      e.printStackTrace();
      fail(ExceptionUtils.getFullStackTrace(e));
    }
  }