mirror of https://github.com/apache/jclouds.git
Throw exceptions in static blocks
This reports any errors instead of silently ignoring them.
This commit is contained in:
parent
a895869e6f
commit
d45404a338
|
@ -39,6 +39,7 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.base.Throwables;
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
import com.google.inject.Guice;
|
import com.google.inject.Guice;
|
||||||
import com.google.inject.TypeLiteral;
|
import com.google.inject.TypeLiteral;
|
||||||
|
@ -50,13 +51,13 @@ import com.google.inject.TypeLiteral;
|
||||||
@Test(groups = { "unit" })
|
@Test(groups = { "unit" })
|
||||||
public class BindServerToPlainTextStringTest {
|
public class BindServerToPlainTextStringTest {
|
||||||
|
|
||||||
public static String CREATED_SERVER;
|
public static final String CREATED_SERVER;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
CREATED_SERVER = Strings2.toStringAndClose(BindServerToPlainTextStringTest.class
|
CREATED_SERVER = Strings2.toStringAndClose(BindServerToPlainTextStringTest.class
|
||||||
.getResourceAsStream("/create_server.txt"));
|
.getResourceAsStream("/create_server.txt"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
CREATED_SERVER = null;
|
throw Throwables.propagate(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static final Server SERVER = new Server.Builder()
|
public static final Server SERVER = new Server.Builder()
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.base.Throwables;
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
import com.google.inject.Guice;
|
import com.google.inject.Guice;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
|
@ -52,13 +53,13 @@ import com.google.inject.TypeLiteral;
|
||||||
@Test(groups = { "unit" })
|
@Test(groups = { "unit" })
|
||||||
public class BindServerToPlainTextStringTest {
|
public class BindServerToPlainTextStringTest {
|
||||||
|
|
||||||
public static String CREATED_SERVER;
|
public static final String CREATED_SERVER;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
CREATED_SERVER = Strings2.toStringAndClose(BindServerToPlainTextStringTest.class
|
CREATED_SERVER = Strings2.toStringAndClose(BindServerToPlainTextStringTest.class
|
||||||
.getResourceAsStream("/create_server.txt"));
|
.getResourceAsStream("/create_server.txt"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
CREATED_SERVER = null;
|
throw Throwables.propagate(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static final Server SERVER = new Server.Builder()
|
public static final Server SERVER = new Server.Builder()
|
||||||
|
|
Loading…
Reference in New Issue