コード例 #1
0
  /** Test of SavePersonData method, of class MetadataRDFConverter. */
  @Test
  public void testSavePersonData() {
    System.out.println("* MetadataRDFConverterTest: SavePersonData");
    try {
      foaf_Person oPersonNull = null;
      OntModel oModel = MetadataGlobal.LoadOWL(MetadataConstants.sLocationLoadAlert);
      MetadataRDFConverter.SavePersonData(oPersonNull, oModel);
      MetadataGlobal.SaveOWL(oModel, MetadataConstants.sLocationSaveAlert);

      foaf_Person oPerson = new foaf_Person();
      oPerson.m_sFirstName = "Ivan";
      oPerson.m_sLastName = "Obradovic";
      // oPerson.m_sGender = ""; //???
      oPerson.m_sID = "*****@*****.**";
      oPerson.m_sEmail = "*****@*****.**"; // ???
      MetadataRDFConverter.SavePersonData(oPerson, oModel);
      MetadataGlobal.SaveOWL(oModel, MetadataConstants.sLocationSaveAlert);
      assertNotNull(oPerson);
      assertEquals(oPerson.m_sObjectURI.isEmpty(), false);

      //// TO-DO review the generated test code and remove the default call to fail.
      // fail("The test case is a prototype.");
    } catch (Exception ex) {
      System.out.println("Error: " + ex.getMessage());
    }
  }
コード例 #2
0
  /** Test of SavePerson method, of class MetadataRDFConverter. */
  @Test
  public void testSavePerson() {
    System.out.println("* MetadataRDFConverterTest: SavePerson");
    foaf_Person oPersonNull = null;
    foaf_Person expResult = null;
    foaf_Person resultNull = MetadataRDFConverter.SavePerson(oPersonNull);
    assertEquals(expResult, resultNull);

    foaf_Person oPerson = new foaf_Person();
    oPerson.m_sFirstName = "Ivan";
    oPerson.m_sLastName = "Obradovic";
    oPerson.m_sGender = ""; // ???
    oPerson.m_sID = "*****@*****.**";
    // oPerson.m_sEmail = "*****@*****.**"; //???

    foaf_Person result = MetadataRDFConverter.SavePerson(oPerson);
    assertNotNull(result);
    assertEquals(result.m_sObjectURI.isEmpty(), false);
    // assertNotSame("", result.m_sObjectURI);

    //// TO-DO review the generated test code and remove the default call to fail.
    // fail("The test case is a prototype.");
  }