/* * Test the clone() method */ @Test public void testRegularIFNetTransitionClone() throws ParameterException { IFNet sNet = IFNetTestUtil.createSimpleIFNet(); RegularIFNetTransition t = (RegularIFNetTransition) sNet.getTransition("t0"); t.setSilent(true); // Create an instance of TestGuardDataContainer TestGuardDataContainer tgdc = new TestGuardDataContainer(sNet.getTokenColors()); t.setGuardDataContainer(tgdc); RegularIFNetTransition tClone = t.clone(); assertEquals(t, tClone); assertNotSame(t, tClone); assertTrue(tClone.isSilent()); assertEquals(t.getName(), tClone.getName()); assertEquals(t.getLabel(), tClone.getLabel()); assertEquals(t.isPlace(), tClone.isPlace()); assertEquals(t.isDrain(), tClone.isDrain()); assertEquals(t.isSource(), tClone.isSource()); assertEquals(t.isTransition(), tClone.isTransition()); assertEquals(t.getGuards().size(), tClone.getGuards().size()); assertEquals(t.getGuardDataContainer(), tClone.getGuardDataContainer()); // assertNotSame(t.getGuardDataContainer(), tClone.getGuardDataContainer()); // Access modes for (Entry<String, Set<AccessMode>> color : t.getAccessModes().entrySet()) { assertEquals(color.getValue(), tClone.getAccessModes(color.getKey())); } }
/* * Test method for {@link de.uni.freiburg.iig.telematik.sepia.petrinet.ifnet.RegularIFNetTransition#RegularSNetTransition(java.lang.String, java.lang.String)}. */ @Test public void testRegularSNetTransitionStringString() { RegularIFNetTransition rst = null; try { rst = new RegularIFNetTransition("TransitionName", "TransitionLabel"); } catch (ParameterException e) { fail("Unable to create RegularSNetTransition."); } // check that the name got set assertEquals("TransitionName", rst.getName()); assertEquals("TransitionLabel", rst.getLabel()); assertFalse(rst.isSilent()); }