- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ScheduledThreadPoolExecutor s =
new ScheduledThreadPoolExecutor(corePoolSize)
ThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
String str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
- Smart code suggestions by Codota
}
public static ServiceDocument buildDefaultStateInstance() { HostNetworkListDataCollectionState state = new HostNetworkListDataCollectionState(); state.documentSelfLink = DEFAULT_HOST_NETWORK_LIST_DATA_COLLECTION_LINK; state.taskInfo = new TaskState(); state.taskInfo.stage = TaskStage.STARTED; state.containerHostLinks = new HashMap<>(); return state; }
@Test public void testCreateDCShouldFailIfAlreadyExists() throws Throwable { HostNetworkListDataCollectionState dc = new HostNetworkListDataCollectionState(); dc.containerHostLinks = new HashMap<>(); try { doPost(dc, HostNetworkListDataCollection.DEFAULT_HOST_NETWORK_LIST_DATA_COLLECTION_LINK); fail("Should have failed because only single DC can exists."); } catch (LocalizableValidationException e) { assertEquals("Only one instance of networks data collection can be started", e.getMessage()); } }