コード例 #1
0
 @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();
 }
コード例 #2
0
  @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());
    }
  }
コード例 #3
0
 @Test
 public void actionIDTest() {
   Assert.assertEquals("Wrong ActionID", ActionConstants.CREATETUNNEL, action.getActionID());
 }