Package org.eclipselabs.mongoemf.junit.model

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


  @Test
  public void testXMLRepresentation() throws IOException
  {
    ResourceSet resourceSet = createResourceSet();

    TargetObject targetObject1 = ModelFactory.eINSTANCE.createTargetObject();
    targetObject1.setSingleAttribute("one");
    saveObject(resourceSet, targetObject1);

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

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.getMultipleContainmentReferenceProxies().add(targetObject1);
View Full Code Here


          }
        };
      }
    });

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

    XMLResource resource = (XMLResource) targetObject.eResource();
    String authorID = resource.getID(targetObject);

    // Test : Reload the target object

    resource.unload();
View Full Code Here

        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.TARGET_OBJECT:
      {
        TargetObject targetObject = (TargetObject)theEObject;
        T result = caseTargetObject(targetObject);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
View Full Code Here

  @Test
  public void testPrimaryObjectWithSingleContainmentReferenceNoProxies() throws IOException
  {
    // 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);
View Full Code Here

  @Test
  public void testPrimaryObjectWithMultipleContainmentReferenceNoProxies() throws IOException
  {
    // Setup : Create a primary object with multiple containment references to target objects.

    TargetObject targetObject1 = ModelFactory.eINSTANCE.createTargetObject();
    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);
View Full Code Here

  @Test
  public void testPrimaryObjectWithSingleNonContainmentReference() throws IOException
  {
    // 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);
View Full Code Here

  @Test
  public void testPrimaryObjectWithSingleNonContainmentReferenceNoProxies() throws IOException
  {
    // 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);
View Full Code Here

  @Test
  public void testPrimaryObjectWithMultipleNonContainmentReference() throws IOException
  {
    // Setup : Create a primary object with multiple containment references to target objects.

    TargetObject targetObject1 = ModelFactory.eINSTANCE.createTargetObject();
    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);
View Full Code Here

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

    ResourceSet resourceSet = createResourceSet();

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

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.setSingleContainmentReferenceProxies(targetObject);
View Full Code Here

    // Setup : Create a primary object with multiple cross-document containment references to target
    // objects.

    ResourceSet resourceSet = createResourceSet();

    TargetObject targetObject1 = ModelFactory.eINSTANCE.createTargetObject();
    targetObject1.setSingleAttribute("one");
    saveObject(resourceSet, targetObject1);

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

    PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
    primaryObject.setName("junit");
    primaryObject.getMultipleContainmentReferenceProxies().add(targetObject1);
View Full Code Here

TOP

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

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.