@Test public void testSetName() { try { assertEquals("dts", applicationElement.getName()); applicationElement.setName("new_name"); assertEquals( "new_name", applicationElement.getApplicationStructure().getElementByName("new_name").getName()); applicationElement.setName("dts"); assertEquals("dts", applicationElement.getName()); } catch (AoException e) { fail(e.reason); } // empty attribute name try { applicationElement.setName(""); fail("AoException expected"); } catch (AoException e) { assertEquals(ErrorCode.AO_BAD_PARAMETER, e.errCode); } // name length > 30 try { applicationElement.setName("012345678901234567890123456789x"); fail("AoException expected"); } catch (AoException e) { assertEquals(ErrorCode.AO_BAD_PARAMETER, e.errCode); } // duplicate application element name try { applicationElement.setName("mea"); fail("AoException expected"); } catch (AoException e) { assertEquals(ErrorCode.AO_DUPLICATE_NAME, e.errCode); } }
@Test public void testGetName() { try { assertEquals("dts", applicationElement.getName()); } catch (AoException e) { fail(e.reason); } }