コード例 #1
0
 public static synchronized RegistryObjectList create() {
   RegistryObjectList rol = new RegistryObjectList();
   rol.setIso19139Id("63C2378A-17A7-B863-BFF4-CC3EF507D10E");
   RegistryObject ro = RegistryObjectFactory.create();
   rol.add(ro);
   return rol;
 }
コード例 #2
0
  public void testDeleteByISOId() throws Exception {
    assertEquals(0, coreDao.loadAllRegistryObject().size());
    String iso19139Id = "go with the flow";
    RegistryObject ro = (RegistryObject) RandomPopulator.instantiate(RegistryObject.class);
    RegistryPackage rp1 = (RegistryPackage) RandomPopulator.instantiate(RegistryPackage.class);
    RegistryPackage rp2 = (RegistryPackage) RandomPopulator.instantiate(RegistryPackage.class);
    RegistryObjectList registryObjectList = new RegistryObjectList();
    registryObjectList.add(ro);
    registryObjectList.add(rp1);
    registryObjectList.add(rp2);
    registryObjectList.setIso19139Id(iso19139Id);
    registryObjectListDao.saveRegistryObjectList(registryObjectList);

    assertTrue(ro.getHibernateId() > 0);
    assertTrue(rp1.getHibernateId() > 0);
    assertTrue(rp2.getHibernateId() > 0);
    assertTrue(registryObjectList.getHibernateId() > 0);

    assertTrue(coreDao.loadAllRegistryObject().size() > 0);
    deleteFacade.deleteByISOId(iso19139Id);
    assertEquals(0, coreDao.loadAllRegistryObject().size());
  }