コード例 #1
0
 @BeforeClass
 public static void setUpBeforeClass() throws Exception {
   ORB orb = ORB.init(new String[0], System.getProperties());
   URL url = ApplicationElementImpl.class.getResource("/de/rechner/openatfx/example.atfx");
   aoSession =
       AoServiceFactory.getInstance()
           .newAoFactory(orb)
           .newSession("FILENAME=" + new File(url.getFile()));
   applicationElement = aoSession.getApplicationStructure().getElementByName("dts");
 }
コード例 #2
0
  @Test
  public void testGetAllRelatedElements() {
    try {
      // dts
      assertEquals(7, applicationElement.getAllRelatedElements().length);

      // audifahrzeug
      ApplicationElement aeFzg =
          aoSession.getApplicationStructure().getElementByName("audifahrzeug");
      assertEquals(8, aeFzg.getAllRelatedElements().length);
    } catch (AoException e) {
      fail(e.reason);
    }
  }
コード例 #3
0
  @Test
  public void testGetRelationsByBaseName() {
    try {
      // dts
      assertEquals(1, applicationElement.getRelationsByBaseName("test").length);
      assertEquals(1, applicationElement.getRelationsByBaseName("measurement_quantities").length);
      assertEquals(1, applicationElement.getRelationsByBaseName("units_under_test").length);

      // audifahrzeug
      ApplicationElement aeFzg =
          aoSession.getApplicationStructure().getElementByName("audifahrzeug");
      assertEquals(5, aeFzg.getRelationsByBaseName("children").length);

    } catch (AoException e) {
      fail(e.reason);
    }
  }
コード例 #4
0
 @AfterClass
 public static void tearDownAfterClass() throws Exception {
   aoSession.close();
 }