Spring Framework SettableListenableFuture - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SettableListenableFuture class.

This code example shows how to use the following methods:set
This code example shows how to use the following methods:
 
	@SuppressWarnings("unchecked") 
	@Before 
	public void setup() throws Exception {
		this.connectCallback = mock(ListenableFutureCallback.class);
		this.connectFuture = new SettableListenableFuture<>();
		this.connectFuture.addCallback(this.connectCallback);
		this.webSocketTransport = new TestTransport("WebSocketTestTransport");
		this.xhrTransport = new TestTransport("XhrTestTransport");
	} 
 
 
	@Test
	public void connect() throws Exception {
		DefaultTransportRequest request = createTransportRequest(this.webSocketTransport, TransportType.WEBSOCKET);
		request.connect(null, this.connectFuture);
		WebSocketSession session = mock(WebSocketSession.class);
		this.webSocketTransport.getConnectCallback().onSuccess(session);
		assertSame(session, this.connectFuture.get());
	} 
5
CodeRank
See Code Examples for Spring Framework SettableListenableFuture Methods: