@Test public void testExecute_WhenSGIHasNetworkSGMember_DeallocatesDAIsOfVMPort() throws Exception { SecurityGroup sg = new SecurityGroup(null, null, null); sg.addSecurityGroupMember(newSGMWithPort(Network.class, 1L)); SecurityGroupInterface sgi = registerNewSGI(sg); DistributedApplianceInstance dai = registerNewDAI(); assignDAIToProtectedPorts(dai); DeallocateDAIOfSGIMembersTask task = this.factory.create(sgi, dai); task.execute(); assertExpectedProtectedPorts(dai); }
@Override public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) { DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
DeallocateDAIOfSGIMembersTask extends UpdateDAIToSGIMembersTask { @Override public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) { DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
DeallocateDAIOfSGIMembersTask extends UpdateDAIToSGIMembersTask { @Override public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) { DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } DeallocateDAIOfSGIMembersTask(); private  DeallocateDAIOfSGIMembersTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); }
DeallocateDAIOfSGIMembersTask extends UpdateDAIToSGIMembersTask { @Override public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) { DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } DeallocateDAIOfSGIMembersTask(); private  DeallocateDAIOfSGIMembersTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override void updatePortProtection(VirtualPort protectedPort); @Override String getName(); }
DeallocateDAIOfSGIMembersTask extends UpdateDAIToSGIMembersTask { @Override public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) { DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } DeallocateDAIOfSGIMembersTask(); private  DeallocateDAIOfSGIMembersTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override void updatePortProtection(VirtualPort protectedPort); @Override String getName();  }