@Test public void testDescriptionNamed() { MetaRepository m3 = MetaRepository.createFM3(); assertNotNull(m3.descriptionNamed("FM3.Class")); assertNotNull(m3.descriptionNamed("FM3.Package")); assertNotNull(m3.descriptionNamed("FM3.Property")); }
@Test public void writeFile() { MetaRepository m3 = MetaRepository.createFM3(); Appendable stream = new StringBuilder(); m3.accept(new MSEPrinter(stream)); String mse = stream.toString(); assertTrue(mse.length() != 0); // out(mse); }
@Test public void readFile() { MetaRepository m3 = MetaRepository.createFM3(); StringBuilder buffer = new StringBuilder(); m3.accept(new MSEPrinter(buffer)); Importer builder = new Importer(m3); builder.readFrom(InputSource.fromString(buffer)); Repository m2 = builder.getResult(); m2.getElements(); }
@Test public void selfDescribed() { MetaRepository m3 = MetaRepository.createFM3(); assertEquals(m3, m3.getMetamodel()); }
public void packageClassesIsMultivalued() { MetaRepository m3 = MetaRepository.createFM3(); MetaDescription m = m3.descriptionNamed("MSE.Package"); PropertyDescription p = m.attributeNamed("classes"); assertEquals(true, p.isMultivalued()); }
@Test public void checkConstraints() { MetaRepository m3 = MetaRepository.createFM3(); m3.checkConstraints(); }
@Test public void allClassDescriptionsAreElement() { MetaRepository m3 = MetaRepository.createFM3(); assertTrue(m3.getElements().containsAll(m3.allClassDescriptions())); }
@Test public void has20Properties() { MetaRepository m3 = MetaRepository.createFM3(); assertEquals(20, m3.allPropertyDescriptions().size()); }
@Test public void has1Package() { MetaRepository m3 = MetaRepository.createFM3(); assertEquals(1, m3.allPackageDescriptions().size()); }
@Test public void has4Classes() { MetaRepository m3 = MetaRepository.createFM3(); assertEquals(4, m3.allClassDescriptions().size()); }