@Test public void testExecute_WithInspectionHook_ExpectFailure() throws Exception { doThrow(new Exception()).when(this.sdnApi).removeInspectionHook(INSPECTION_HOOK_ID); this.exception.expect(Exception.class); SfcFlowClassifierDeleteTask deleteTask = this.task.create(this.sg, this.port); deleteTask.execute(); }
public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask(); task.securityGroup = securityGroup; task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
SfcFlowClassifierDeleteTask extends TransactionalTask { public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask(); task.securityGroup = securityGroup; task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
SfcFlowClassifierDeleteTask extends TransactionalTask { public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask(); task.securityGroup = securityGroup; task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
SfcFlowClassifierDeleteTask extends TransactionalTask { public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask(); task.securityGroup = securityGroup; task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
SfcFlowClassifierDeleteTask extends TransactionalTask { public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask(); task.securityGroup = securityGroup; task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }