@Test public void progressAreaOfInterestRemoveRequests_onFailure_zeroRequests() { final ChannelSchema channelSchema = new ChannelSchema( 0, ValueUtil.randomString(), String.class, ChannelSchema.FilterType.NONE, null, false, true, Collections.emptyList() ); final SystemSchema schema = new SystemSchema( 1, ValueUtil.randomString(), new ChannelSchema[]{ channelSchema }, new EntitySchema[]{} ); final Connector connector = createConnector( schema ); final Connection connection = newConnection( connector ); final ChannelAddress address1 = new ChannelAddress( 1, 0, 1 ); final AreaOfInterestRequest request1 = new AreaOfInterestRequest( address1, AreaOfInterestRequest.Type.REMOVE, null ); pauseScheduler(); connection.injectCurrentAreaOfInterestRequest( request1 ); final TestSpyEventHandler handler = registerTestSpyEventHandler(); assertFalse( connection.getCurrentAreaOfInterestRequests().isEmpty() ); final ArrayList<AreaOfInterestRequest> requests = new ArrayList<>(); connector.progressAreaOfInterestRemoveRequests( requests ); assertTrue( connection.getCurrentAreaOfInterestRequests().isEmpty() ); handler.assertEventCount( 0 ); }
void progressAreaOfInterestRemoveRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { removeUnneededRemoveRequests( requests ); if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( requests.size() > 1 ) { progressBulkAreaOfInterestRemoveRequests( requests ); } else { progressAreaOfInterestRemoveRequest( requests.get( 0 ) ); } }
Connector extends ReplicantService { void progressAreaOfInterestRemoveRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { removeUnneededRemoveRequests( requests ); if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( requests.size() > 1 ) { progressBulkAreaOfInterestRemoveRequests( requests ); } else { progressAreaOfInterestRemoveRequest( requests.get( 0 ) ); } } }
Connector extends ReplicantService { void progressAreaOfInterestRemoveRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { removeUnneededRemoveRequests( requests ); if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( requests.size() > 1 ) { progressBulkAreaOfInterestRemoveRequests( requests ); } else { progressAreaOfInterestRemoveRequest( requests.get( 0 ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { void progressAreaOfInterestRemoveRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { removeUnneededRemoveRequests( requests ); if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( requests.size() > 1 ) { progressBulkAreaOfInterestRemoveRequests( requests ); } else { progressAreaOfInterestRemoveRequest( requests.get( 0 ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { void progressAreaOfInterestRemoveRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { removeUnneededRemoveRequests( requests ); if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( requests.size() > 1 ) { progressBulkAreaOfInterestRemoveRequests( requests ); } else { progressAreaOfInterestRemoveRequest( requests.get( 0 ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }