Beispiel #1
0
 @Test
 @Given("metamodelNames")
 public Repository model(MetaRepository metamodel) {
   Repository $ = new Repository(metamodel);
   assertEquals(metamodel, $.getMetamodel());
   return $;
 }
Beispiel #2
0
 @Test
 @Ignore // FIXME
 @Given("tower;exportMSE;metamodel")
 public Repository importMSE(Tower t, String mse) {
   t.getModel().importMSE(mse);
   Repository m = t.getModel();
   assertEquals(3, m.getElements().size());
   return m;
 }
Beispiel #3
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 #4
0
 @Test
 @Given("model;newChildB")
 public Leaf numberPropertyB(Repository m, Leaf b) {
   assertEquals(0, b.count);
   assertEquals((Integer) 0, m.read("count", b));
   m.write("count", b, 23);
   assertEquals(23, b.count);
   assertEquals((Integer) 23, m.read("count", b));
   return b;
 }
Beispiel #5
0
 @Test
 @Given("model;newChildA")
 public Leaf numberPropertyA(Repository m, Leaf a) {
   assertEquals((Integer) 0, (Integer) a.count);
   assertEquals((Integer) 0, (Integer) m.read("count", a));
   m.write("count", a, 42);
   assertEquals(42, a.count);
   assertEquals((Integer) 42, (Integer) m.read("count", a));
   return a;
 }
Beispiel #6
0
 @Test
 @Ignore // FIXME
 @Given("model;newParent;newChildA;newChildB")
 public Repository createInstances(Repository $) {
   assertEquals(3, $.getElements().size());
   return $;
 }
Beispiel #7
0
 @Test
 @Given("model")
 public Container newParent(Repository repo) {
   Object $ = repo.newInstance("TEST.Container");
   assertNotNull($);
   assertEquals(Container.class, $.getClass());
   return (Container) $;
 }
Beispiel #8
0
 @Test
 @Given("model")
 public Leaf newChildB(Repository repo) {
   Object $ = repo.newInstance("TEST.Leaf");
   assertNotNull($);
   assertEquals(Leaf.class, $.getClass());
   return (Leaf) $;
 }
Beispiel #9
0
 @Test
 @Given("model;newParent;newChildA;newChildB;parentChildrenAreOpposite")
 public Container parentWithChildren(Repository m, Container p, Leaf a, Leaf b) {
   assertEquals(0, p.children.size());
   assertEquals(null, a.parent);
   assertEquals(null, b.parent);
   m.write("children", p, a, b);
   assertEquals(2, p.children.size());
   assertEquals(p, a.parent);
   assertEquals(p, b.parent);
   return p;
 }
Beispiel #10
0
 @Test
 @Given("model;parentWithChildren")
 public String exportMSE(Repository m) {
   String mse = m.exportMSE();
   return mse;
 }