Пример #1
0
  @Override
  public void setUp() throws Exception {
    super.setUp();

    pkg = EMFUtil.createEPackage("customTest", "ct", "http://cdo.emf.eclipse.org/customTest.ecore");
    EDataType custom = EcoreFactory.eINSTANCE.createEDataType();
    custom.setInstanceClass(CustomType.class);
    custom.setName("CustomType");

    pkg.getEClassifiers().add(custom);

    cls = EMFUtil.createEClass(pkg, "Foobar", false, false);
    att = EMFUtil.createEAttribute(cls, "att", custom);

    CDOUtil.prepareDynamicEPackage(pkg);
  }
 @Override
 public void setUp() throws Exception {
   super.setUp();
   CDOSession session = openSession();
   CDOTransaction transaction = session.openTransaction();
   CDOResource resource = transaction.createResource(getResourcePath(RESOURCE_NAME));
   Company company = getModel1Factory().createCompany();
   for (int i = 0; i < NB_CATEGORY; i++) {
     Category category = getModel1Factory().createCategory();
     company.getCategories().add(category);
   }
   resource.getContents().add(company);
   transaction.commit();
   transaction.close();
   session.close();
 }