Package archmapper.acmeconverter

Source Code of archmapper.acmeconverter.AcmeConverterTest

package archmapper.acmeconverter;

import static junit.framework.Assert.*;

import org.junit.Test;

import archmapper.main.model.architecture.Component;
import archmapper.main.model.architecture.Configuration;
import archmapper.main.model.architecture.Connector;

public class AcmeConverterTest {
 
  @Test
  public void testConvertFromAdl() {
    AcmeConverter converter = new AcmeConverter();
   
    Configuration conf = converter.convertFromAdl("testfiles/families",
        "testfiles/TestArchitecture.acme");
    assertNotNull(conf);
   
    Component productManager = conf.getComponentByName("ProductAdmin.ProductManager");
    Component productModel = conf.getComponentByName("ProductAdmin.ProductModel");
   
    Connector conn = conf.getConnectorByName("ProductAdmin.MethodCallT0");
    Connector conn2 = conf.getConnectorByName("ProductAdmin.MethodCallT1");
   
    assertNotNull(productManager);
    assertEquals("DAOT", productManager.getStyleType());
   
    assertNotNull(productModel);
    assertEquals(1, productManager.getPorts().size());
    assertEquals(conn, productManager.getPorts().get(0).getRoles().get(0).getConnector());
    assertEquals(conn2, productModel.getPorts().get(0).getRoles().get(0).getConnector());
   
    assertTrue(conf.getArchitectureRuleViolations().size() > 0);
  }
}
TOP

Related Classes of archmapper.acmeconverter.AcmeConverterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.