Examples of ETypes


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

  {
    switch (classifierID)
    {
      case ModelPackage.ETYPES:
      {
        ETypes eTypes = (ETypes)theEObject;
        T result = caseETypes(eTypes);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.PRIMARY_OBJECT:
View Full Code Here

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

  }

  @Test
  public void testQueryDefaultAttribute() throws IOException
  {
    ETypes eTypes = org.eclipselabs.mongoemf.junit.model.ModelFactory.eINSTANCE.createETypes();
    eTypes.setELong(1);

    ResourceSet resourceSet = createResourceSet();
    Resource resource = resourceSet.createResource(createCollectionURI(org.eclipselabs.mongoemf.junit.model.ModelPackage.Literals.ETYPES));
    resource.getContents().add(eTypes);
    HashMap<String, Object> options = new HashMap<String, Object>(1);
    options.put(Options.OPTION_SERIALIZE_DEFAULT_ATTRIBUTE_VALUES, Boolean.TRUE);
    resource.save(options);

    eTypes = org.eclipselabs.mongoemf.junit.model.ModelFactory.eINSTANCE.createETypes();
    eTypes.setEInt(1);

    resource = resourceSet.createResource(createCollectionURI(org.eclipselabs.mongoemf.junit.model.ModelPackage.Literals.ETYPES));
    resource.getContents().add(eTypes);
    resource.save(null);

    resourceSet = createResourceSet();
    resource = resourceSet.getResource(createQueryURI(org.eclipselabs.mongoemf.junit.model.ModelPackage.Literals.ETYPES, "eInt == 0"), true);
    ECollection eCollection = (ECollection) resource.getContents().get(0);
    assertThat(eCollection.getValues().size(), is(1));
    ETypes target = (ETypes) eCollection.getValues().get(0);
    assertThat(target.getEInt(), is(0));
    assertThat(target.getELong(), is(1L));
  }
View Full Code Here

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

  public void testQueryDate() throws IOException
  {
    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.DAY_OF_MONTH, 1);

    ETypes eTypes = org.eclipselabs.mongoemf.junit.model.ModelFactory.eINSTANCE.createETypes();
    eTypes.setEDate(calendar.getTime());

    ResourceSet resourceSet = createResourceSet();
    Resource resource = resourceSet.createResource(createCollectionURI(org.eclipselabs.mongoemf.junit.model.ModelPackage.Literals.ETYPES));
    resource.getContents().add(eTypes);
    resource.save(null);
View Full Code Here

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

  @Test
  public void testTypes() throws IOException
  {
    // Setup

    ETypes eTypes = ModelFactory.eINSTANCE.createETypes();
    eTypes.setEBigDecimal(BigDecimal.ONE);
    eTypes.setEBigInteger(new BigInteger(2, new Random()));
    eTypes.setEBoolean(true);
    eTypes.setEByte((byte) 3);
    eTypes.setEByteArray(new byte[] { 1, 2 });
    eTypes.setEChar('j');
    eTypes.setEDate(new Date());
    eTypes.setEDouble(1.0);
    eTypes.setEFloat(1.0f);
    eTypes.setEInt(1);
    eTypes.setELong(1L);
    eTypes.setEShort((short) 1);
    eTypes.setEString("j");
    eTypes.getUris().add(URI.createURI("mongodb://localhost/db/collection/id1"));
    eTypes.getUris().add(URI.createURI("mongodb://localhost/db/collection/id2"));

    // Test

    saveObject(eTypes);

    // Verify

    assertThat(eTypes.eResource().getURI().segmentCount(), is(3));
    assertThat(eTypes.eResource().getURI().segment(2), is(notNullValue()));
    EChecker.checkObject(eTypes, createResourceSet());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.