@BeforeClass public static void init() { action = new CreateTunnelAction(); action.setModelToUpdate(new ComputerSystem()); helper = new ActionTestHelper(); action.setParams(helper.newParamsInterfaceEthernet()); helper = new ActionTestHelper(); protocolsessionmanager = helper.getProtocolSessionManager(); }
@Test public void velocityMessageTest() throws ActionException { try { GRETunnelService greTunnelService = getGRETunnelService(); action.setParams(greTunnelService); action.prepareMessage(); Assert.assertEquals( "Wrong Velocity Template", "/VM_files/createTunnelv6.vm", action.getTemplate()); String expectedMessage = XmlHelper.formatXML(textFileToString("/actions/greTunnelv6.xml")); String actionMessage = XmlHelper.formatXML(action.getVelocityMessage()); Assert.assertEquals(expectedMessage, actionMessage); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }