Package org.eclipselabs.mongoemf.junit.model

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


  @Test(expected = IOException.class)
  public void testLongURI() throws IOException
  {
    // Setup : Create a target object to save.

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

    // Test : Save the target object with a long (invalid) URI

    saveObject(targetObject, createCollectionURI(targetObject.eClass()).trimSegments(1), null);
  }
View Full Code Here


  @Test
  public void testExists() throws IOException
  {
    // Setup : Create and save a target object.

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

    // Verify : exists() on the URI converter return true / false as appropriate

    assertTrue(targetObject.eResource().getResourceSet().getURIConverter().exists(targetObject.eResource().getURI(), null));
    assertFalse(targetObject.eResource().getResourceSet().getURIConverter().exists(targetObject.eResource().getURI().trimSegments(1).appendQuery(""), null));
    assertFalse(targetObject.eResource().getResourceSet().getURIConverter().exists(targetObject.eResource().getURI().trimSegments(1).appendSegment("id"), null));
    assertFalse(targetObject.eResource().getResourceSet().getURIConverter().exists(URI.createURI("mongodb://host:8080/junit/junit/id"), null));
  }
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.