示例#1
0
 @BeforeClass
 public static void init() {
   action = new DeleteTunnelAction();
   action.setModelToUpdate(new ComputerSystem());
   helper = new ActionTestHelper();
   action.setParams(helper.newParamsInterfaceEthernet());
   helper = new ActionTestHelper();
   protocolsessionmanager = helper.getProtocolSessionManager();
 }
示例#2
0
  /**
   * Execute the action
   *
   * @throws IOException
   * @throws ActionException
   */
  @Test
  public void executeActionTest() throws IOException, ActionException {
    action.setModelToUpdate(getComputerSystem());
    // Add params
    GRETunnelService greTunnelService = getGRETunnelService();
    action.setParams(greTunnelService);

    ActionResponse response = action.execute(protocolsessionmanager);
    Assert.assertTrue(response.getActionID().equals(ActionConstants.DELETETUNNEL));

    org.opennaas.extensions.router.model.System computerSystem =
        (org.opennaas.extensions.router.model.System) action.getModelToUpdate();
    Assert.assertNotNull(computerSystem);
  }
示例#3
0
 @Test
 public void templateTest() {
   // this action always have this template as a default
   Assert.assertEquals("Not accepted param", "/VM_files/deleteTunnel.vm", action.getTemplate());
 }
示例#4
0
 @Test
 public void paramsTest() {
   // this action always have null params
   Assert.assertNotNull("Null parameters", action.getParams());
 }
示例#5
0
 @Test
 public void actionIDTest() {
   Assert.assertEquals("Wrong ActionID", ActionConstants.DELETETUNNEL, action.getActionID());
 }