Package org.eclipselabs.mongoemf.junit.model

Examples of org.eclipselabs.mongoemf.junit.model.PrimaryObject


        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.PRIMARY_OBJECT:
      {
        PrimaryObject primaryObject = (PrimaryObject)theEObject;
        T result = casePrimaryObject(primaryObject);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.TARGET_OBJECT:
View Full Code Here


    // Setup : Create a primary object with a containment reference to a target object.

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceNoProxies(targetObject);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    targetObject1.setSingleAttribute("one");

    TargetObject targetObject2 = ModelFactory.eINSTANCE.createTargetObject();
    targetObject2.setSingleAttribute("two");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.getMultipleContainmentReferenceNoProxies().add(targetObject1);
    primaryObject.getMultipleContainmentReferenceNoProxies().add(targetObject2);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    // Setup : Create a primary object with a non containment reference to a target object.

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceNoProxies(targetObject);
    primaryObject.setSingleNonContainmentReference(targetObject);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    // Setup : Create a primary object with a non containment reference to a target object.

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceNoProxies(targetObject);
    primaryObject.setSingleNonContainmentReferenceNoProxies(targetObject);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    targetObject1.setSingleAttribute("one");

    TargetObject targetObject2 = ModelFactory.eINSTANCE.createTargetObject();
    targetObject2.setSingleAttribute("two");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.getMultipleContainmentReferenceNoProxies().add(targetObject1);
    primaryObject.getMultipleContainmentReferenceNoProxies().add(targetObject2);
    primaryObject.getMultipleNonContainmentReference().add(targetObject1);
    primaryObject.getMultipleNonContainmentReference().add(targetObject2);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");
    saveObject(resourceSet, targetObject);

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceProxies(targetObject);

    // Test : Store the object to MongoDB

    saveObject(resourceSet, primaryObject);
View Full Code Here

    TargetObject targetObject2 = ModelFactory.eINSTANCE.createTargetObject();
    targetObject2.setSingleAttribute("two");
    saveObject(resourceSet, targetObject2);

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.getMultipleContainmentReferenceProxies().add(targetObject1);
    primaryObject.getMultipleContainmentReferenceProxies().add(targetObject2);

    // Test : Store the object to MongoDB

    saveObject(primaryObject);
View Full Code Here

    ResourceSet resourceSet = createResourceSet();

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceProxies(targetObject);

    // Test : Store the object to MongoDB

    saveObject(resourceSet, primaryObject);
View Full Code Here

    TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
    targetObject.setSingleAttribute("junit");
    saveObject(resourceSet, targetObject);

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceProxies(targetObject);
    saveObject(resourceSet, primaryObject);

    // Test : Delete the target object and reload the primary object

    targetObject.eResource().delete(null);
    ResourceSet testResourceSet = createResourceSet();
    Resource resource = testResourceSet.getResource(primaryObject.eResource().getURI(), true);

    // Verify : Check that the object was stored correctly.

    assertThat(resource, is(notNullValue()));
    assertThat(resource.getContents().size(), is(1));
    PrimaryObject actual = (PrimaryObject) resource.getContents().get(0);
    assertThat(actual.getSingleContainmentReferenceProxies(), is(notNullValue()));
    assertTrue(actual.getSingleContainmentReferenceProxies().eIsProxy());
  }
View Full Code Here

TOP

Related Classes of org.eclipselabs.mongoemf.junit.model.PrimaryObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.