Java 8 AcceptPendingException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AcceptPendingException class.

This code example shows how to use the following methods:
		long acceptDelay = 20;
		long ioDelay = 80;
 
		BufferedReader bean = mock(BufferedReader.class);
		doReturn(bean).when(applicationContextMock).getBean(bean.getClass());
		when(bean.readLine()).thenThrow(new AcceptPendingException(), new EOFException());
 
		SpringSpout subject = new SpringSpout(bean.getClass(), "readLine()", "line");
		subject.setApplicationContext(applicationContextMock);
		subject.putDelayException(AcceptPendingException.class, acceptDelay);
		subject.putDelayException(IOException.class, ioDelay);
		subject.open(stormConf, contextMock, collectorMock);
 
		long start = System.currentTimeMillis();
		subject.nextTuple();
		long acceptEnd = System.currentTimeMillis();
		subject.nextTuple();
		long end = System.currentTimeMillis();
		verifyZeroInteractions(collectorMock);
		assertTrue("accept delay", acceptDelay <= acceptEnd - start);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 AcceptPendingException Methods: