Skip to content
Permalink
Browse files
JCLOUDS-1333: Fix Java 8 and Guava 21 issues
  • Loading branch information
gaul committed Apr 15, 2018
1 parent 7e2b058 commit e8e68c4008201d4da48183cadc37858475003adc
Showing 6 changed files with 12 additions and 12 deletions.
@@ -17,7 +17,7 @@
package org.jclouds.azurecompute.internal;

import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.IOException;
@@ -39,7 +39,7 @@

public class BaseAzureComputeApiMockTest {

private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(sameThreadExecutor()));
private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(newDirectExecutorService()));

protected String provider;

@@ -40,7 +40,7 @@
import java.util.Properties;
import java.util.Set;

import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.NETWORK_DOMAIN_DELETED_PREDICATE;
import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.NETWORK_DOMAIN_NORMAL_PREDICATE;
import static org.jclouds.dimensiondata.cloudcontrol.config.DimensionDataCloudControlComputeServiceContextModule.SERVER_DELETED_PREDICATE;
@@ -54,7 +54,7 @@
@Test(groups = "live")
public class BaseDimensionDataCloudControlApiLiveTest extends BaseApiLiveTest<DimensionDataCloudControlApi> {

private static final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(sameThreadExecutor()));
private static final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(newDirectExecutorService()));

protected static final String PREPARED_CUSTOMER_IMAGE_ID = "fb438e00-10f8-47ac-a434-f3f9461c3a76";

@@ -46,7 +46,7 @@
import java.util.Set;

import static com.google.common.collect.Iterables.size;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import static org.assertj.core.api.Assertions.assertThat;
import static org.jclouds.util.Strings2.toStringAndClose;
import static org.testng.Assert.assertEquals;
@@ -61,7 +61,7 @@ public class BaseDimensionDataCloudControlMockTest implements IHookable {
private static final String DEFAULT_ENDPOINT = PROVIDER_METADATA.getEndpoint();
protected static final String VERSION = PROVIDER_METADATA.getApiMetadata().getVersion();

private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(sameThreadExecutor()));
private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(newDirectExecutorService()));

protected MockWebServer server;
protected DimensionDataCloudControlApi api;
@@ -17,7 +17,6 @@
package org.jclouds.joyent.cloudapi.v6_5.compute.predicates;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Predicates.and;
import static com.google.common.collect.Iterables.all;
import static org.jclouds.compute.predicates.NodePredicates.TERMINATED;
import static org.jclouds.compute.predicates.NodePredicates.inGroup;
@@ -29,6 +28,7 @@
import org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.DatacenterAndName;

import com.google.common.base.Predicate;
import com.google.common.base.Predicates;

public class AllNodesInGroupTerminated implements Predicate<DatacenterAndName> {
private final ComputeService computeService;
@@ -42,6 +42,6 @@ public AllNodesInGroupTerminated(ComputeService computeService) {

@Override
public boolean apply(DatacenterAndName input) {
return all(computeService.listNodesDetailsMatching(locationId(input.getDatacenter())), and(inGroup(input.getName()), TERMINATED));
return all(computeService.listNodesDetailsMatching(locationId(input.getDatacenter())), Predicates.and(inGroup(input.getName()), TERMINATED));
}
}
@@ -20,7 +20,7 @@
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Resources;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import com.google.gson.JsonParser;
import com.google.inject.Module;
import com.squareup.okhttp.mockwebserver.MockWebServer;
@@ -43,7 +43,7 @@ public class BaseOneAndOneApiMockTest {
private static final OneAndOneProviderMetadata METADATA = new OneAndOneProviderMetadata();
protected static final String AUTH_HEADER = "token";
private static final String DEFAULT_ENDPOINT = METADATA.getEndpoint();
private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(sameThreadExecutor()));
private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(newDirectExecutorService()));
protected MockWebServer server;
protected OneAndOneApi api;
private Json json;
@@ -16,7 +16,7 @@
*/
package org.apache.jclouds.profitbricks.rest.internal;

import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
import static org.testng.Assert.assertEquals;

import java.io.IOException;
@@ -47,7 +47,7 @@ public class BaseProfitBricksApiMockTest {
protected static final String authHeader = BasicAuthentication.basic("username", "password");
private static final String DEFAULT_ENDPOINT = new ProfitBricksProviderMetadata().getEndpoint();

private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(sameThreadExecutor()));
private final Set<Module> modules = ImmutableSet.<Module>of(new ExecutorServiceModule(newDirectExecutorService()));

protected MockWebServer server;
protected ProfitBricksApi api;

0 comments on commit e8e68c4

Please sign in to comment.