Beispiel #1
0
 @Test
 public void testDescriptionNamed() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertNotNull(m3.descriptionNamed("FM3.Class"));
   assertNotNull(m3.descriptionNamed("FM3.Package"));
   assertNotNull(m3.descriptionNamed("FM3.Property"));
 }
Beispiel #2
0
 @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);
 }
Beispiel #3
0
 @Test
 @Given("metamodel")
 public MetaRepository metamodelNames(MetaRepository mm) {
   assertNull(mm.descriptionNamed("FAME"));
   assertNotNull(mm.descriptionNamed("TEST.Container"));
   assertNotNull(mm.descriptionNamed("TEST.Leaf"));
   assertNotNull(mm.descriptionNamed("TEST.Composite"));
   return mm;
 }
Beispiel #4
0
 @Test
 @Given("#tower")
 public MetaRepository metamodel(Tower t) {
   t.getMetamodel().withAll(Composite.class, Container.class, Leaf.class);
   MetaRepository $ = t.getMetamodel();
   assertEquals(3, $.allClassDescriptions().size());
   assertEquals(4, $.all(PropertyDescription.class).size());
   return $;
 }
Beispiel #5
0
 @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();
 }
Beispiel #6
0
 @Test
 @Given("metamodel;metamodelNames")
 public void parentChildrenAreOpposite(MetaRepository mm) {
   PropertyDescription parent = mm.descriptionNamed("TEST.Composite").attributeNamed("parent");
   PropertyDescription children = mm.descriptionNamed("TEST.Container").attributeNamed("children");
   assertNotNull(parent);
   assertNotNull(children);
   assertTrue(parent.hasOpposite());
   assertTrue(children.hasOpposite());
   assertEquals(parent, children.getOpposite());
   assertEquals(children, parent.getOpposite());
 }
Beispiel #7
0
 @Test
 public void selfDescribed() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(m3, m3.getMetamodel());
 }
Beispiel #8
0
 public void packageClassesIsMultivalued() {
   MetaRepository m3 = MetaRepository.createFM3();
   MetaDescription m = m3.descriptionNamed("MSE.Package");
   PropertyDescription p = m.attributeNamed("classes");
   assertEquals(true, p.isMultivalued());
 }
Beispiel #9
0
 @Test
 public void checkConstraints() {
   MetaRepository m3 = MetaRepository.createFM3();
   m3.checkConstraints();
 }
Beispiel #10
0
 @Test
 public void allClassDescriptionsAreElement() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertTrue(m3.getElements().containsAll(m3.allClassDescriptions()));
 }
Beispiel #11
0
 @Test
 public void has20Properties() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(20, m3.allPropertyDescriptions().size());
 }
Beispiel #12
0
 @Test
 public void has1Package() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(1, m3.allPackageDescriptions().size());
 }
Beispiel #13
0
 @Test
 public void has4Classes() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(4, m3.allClassDescriptions().size());
 }