(boolean) true
(boolean) false
(String)
121122123124125126127128
/* Test constructor */ @Test(expected=IllegalArgumentException.class) public void testConstructorNegativeNodeId() { new RequestQueueClient(-1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); }
127128129130131132133134
RETRY_WAIT, QUEUE_SIZE); } @Test(expected=NullPointerException.class) public void testConstructorNullSocketFactory() { new RequestQueueClient(1, null, failureReporter, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); }
133134135136137138139140
QUEUE_SIZE); } @Test(expected=NullPointerException.class) public void testConstructorNullFailureHandler() { new RequestQueueClient(1, socketFactory, null, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); }
139140141142143144145146
QUEUE_SIZE); } @Test(expected=IllegalArgumentException.class) public void testConstructorIllegalMaxRetry() { new RequestQueueClient(1, socketFactory, failureReporter, 0, RETRY_WAIT, QUEUE_SIZE); }
145146147148149150151152
QUEUE_SIZE); } @Test(expected=IllegalArgumentException.class) public void testConstructorIllegalRetryWait() { new RequestQueueClient(1, socketFactory, failureReporter, MAX_RETRY, 0, QUEUE_SIZE); }
151152153154155156157158
QUEUE_SIZE); } @Test(expected=IllegalArgumentException.class) public void testConstructorQueueSizeTooSmall() { new RequestQueueClient(1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, 0); }
157158159160161162163164165
RETRY_WAIT, 0); } @Test(expected=IllegalArgumentException.class) public void testConstructorQueueSizeTooBig() { new RequestQueueClient( 1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, RequestQueueServer.MAX_OUTSTANDING + 1); }
168169170171172173174175176177
@Test public void testConnectionServerSocketClosed() throws Exception { listener.shutdown(); NoteFailure failureReporter = new NoteFailure(); client = new RequestQueueClient( 1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); failureReporter.checkCalled(MAX_RETRY); }
177178179180181182183184185186
} @Test public void testConnectionServerUnknown() throws Exception { NoteFailure failureReporter = new NoteFailure(); client = new RequestQueueClient( 1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); failureReporter.checkCalled(MAX_RETRY); }
187188189190191192193194195196197
/* Test addRequest */ @Test public void testAddRequestNullRequest() { client = new RequestQueueClient( 1, socketFactory, failureReporter, MAX_RETRY, RETRY_WAIT, QUEUE_SIZE); try { client.addRequest(null); fail("Expected NullPointerException");