コード例 #1
0
 protected void setUp() throws Exception {
   super.setUp();
   final Mapping m = getMapping();
   myTransformer = new DiagramGenModelTransformer(myDiagramModelHelper);
   myTransformer.setEMFGenModel(Utils.createGenModel(m.getDiagram().getDomainModel()));
   myTransformer.transform(m);
   myTransformationResult = myTransformer.getResult();
 }
コード例 #2
0
 public void testCreatedPalette() {
   final Palette palette = myTransformationResult.getDiagram().getPalette();
   for (TopNodeReference topNode : getMapping().getNodes()) {
     final NodeMapping nodeMapping = topNode.getChild();
     GenTopLevelNode genNode = myTransformer.getTrace().findTopNode(nodeMapping);
     assertNotNull(genNode);
     assertEquals(nodeMapping.getTool() != null ? 1 : 0, countUses(genNode, palette));
   }
   for (LinkMapping linkMapping : getMapping().getLinks()) {
     GenLink genLink = myTransformer.getTrace().find(linkMapping);
     assertNotNull(genLink);
     assertEquals(linkMapping.getTool() != null ? 1 : 0, countUses(genLink, palette));
   }
   // TODO add grooping test
 }
コード例 #3
0
  public void testGenModelTransform() {
    assertNotNull(
        "GenEditorGenerator is expected as result of mapping transformation",
        myTransformationResult);
    assertNotNull("GenDiagram is expected to be set...", myTransformationResult.getDiagram());
    assertNotNull(
        "... as well as GenPlugin is expected to be set", myTransformationResult.getPlugin());
    assertNotNull(
        "Diagram filename extension not set", myTransformationResult.getDiagramFileExtension());
    // FIXME add more

    GenNode[] genNodes = myTransformer.getTrace().find(getNodeMapping());
    assertEquals("Result model contains no GenNode for nodeMapping", 1, genNodes.length);
    // FIXME add more

    GenLink genLink = myTransformer.getTrace().find(getLinkMapping());
    assertNotNull("Result model contains no GenLink for linkMapping", genLink);
    // FIXME add more
  }