Ejemplo n.º 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"));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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 $;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 7
0
 @Test
 public void selfDescribed() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(m3, m3.getMetamodel());
 }
Ejemplo n.º 8
0
 public void packageClassesIsMultivalued() {
   MetaRepository m3 = MetaRepository.createFM3();
   MetaDescription m = m3.descriptionNamed("MSE.Package");
   PropertyDescription p = m.attributeNamed("classes");
   assertEquals(true, p.isMultivalued());
 }
Ejemplo n.º 9
0
 @Test
 public void checkConstraints() {
   MetaRepository m3 = MetaRepository.createFM3();
   m3.checkConstraints();
 }
Ejemplo n.º 10
0
 @Test
 public void allClassDescriptionsAreElement() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertTrue(m3.getElements().containsAll(m3.allClassDescriptions()));
 }
Ejemplo n.º 11
0
 @Test
 public void has20Properties() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(20, m3.allPropertyDescriptions().size());
 }
Ejemplo n.º 12
0
 @Test
 public void has1Package() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(1, m3.allPackageDescriptions().size());
 }
Ejemplo n.º 13
0
 @Test
 public void has4Classes() {
   MetaRepository m3 = MetaRepository.createFM3();
   assertEquals(4, m3.allClassDescriptions().size());
 }