}
@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));
}