use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class ObjectArraysTest method testNullPointerExceptions.
// NullPointerTester
@GwtIncompatible
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(ObjectArrays.class);
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class BaseEncodingTest method testStreamingEncodes.
// Writer
@GwtIncompatible
private static void testStreamingEncodes(BaseEncoding encoding, String decoded, String encoded) throws IOException {
StringWriter writer = new StringWriter();
OutputStream encodingStream = encoding.encodingStream(writer);
encodingStream.write(decoded.getBytes(UTF_8));
encodingStream.close();
assertThat(writer.toString()).isEqualTo(encoded);
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class BaseEncodingTest method testStreamingDecodes.
// Reader
@GwtIncompatible
private static void testStreamingDecodes(BaseEncoding encoding, String encoded, String decoded) throws IOException {
byte[] bytes = decoded.getBytes(UTF_8);
InputStream decodingStream = encoding.decodingStream(new StringReader(encoded));
for (int i = 0; i < bytes.length; i++) {
assertThat(decodingStream.read()).isEqualTo(bytes[i] & 0xFF);
}
assertThat(decodingStream.read()).isEqualTo(-1);
decodingStream.close();
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class TreeMultisetTest method suite.
// suite
@GwtIncompatible
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(SortedMultisetTestSuiteBuilder.using(new TestStringMultisetGenerator() {
@Override
protected Multiset<String> create(String[] elements) {
return TreeMultiset.create(Arrays.asList(elements));
}
@Override
public List<String> order(List<String> insertionOrder) {
return Ordering.natural().sortedCopy(insertionOrder);
}
}).withFeatures(CollectionSize.ANY, CollectionFeature.KNOWN_ORDER, CollectionFeature.GENERAL_PURPOSE, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES, MultisetFeature.ENTRIES_ARE_VIEWS).named("TreeMultiset, Ordering.natural").createTestSuite());
suite.addTest(SortedMultisetTestSuiteBuilder.using(new TestStringMultisetGenerator() {
@Override
protected Multiset<String> create(String[] elements) {
Multiset<String> result = TreeMultiset.create(NullsBeforeB.INSTANCE);
Collections.addAll(result, elements);
return result;
}
@Override
public List<String> order(List<String> insertionOrder) {
sort(insertionOrder, NullsBeforeB.INSTANCE);
return insertionOrder;
}
}).withFeatures(CollectionSize.ANY, CollectionFeature.KNOWN_ORDER, CollectionFeature.GENERAL_PURPOSE, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_VALUES, MultisetFeature.ENTRIES_ARE_VIEWS).named("TreeMultiset, NullsBeforeB").createTestSuite());
suite.addTest(NavigableSetTestSuiteBuilder.using(new TestStringSetGenerator() {
@Override
protected Set<String> create(String[] elements) {
return TreeMultiset.create(Arrays.asList(elements)).elementSet();
}
@Override
public List<String> order(List<String> insertionOrder) {
return Lists.newArrayList(Sets.newTreeSet(insertionOrder));
}
}).named("TreeMultiset[Ordering.natural].elementSet").withFeatures(CollectionSize.ANY, CollectionFeature.REMOVE_OPERATIONS, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
suite.addTestSuite(TreeMultisetTest.class);
return suite;
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class FuturesTest method testScheduleAsync_asyncCallable_error.
// threads
@GwtIncompatible
public void testScheduleAsync_asyncCallable_error() throws InterruptedException {
final Error error = new Error("deliberate");
AsyncCallable<Integer> callable = new AsyncCallable<Integer>() {
@Override
public ListenableFuture<Integer> call() {
throw error;
}
};
SettableFuture<String> inputFuture = SettableFuture.create();
ListenableFuture<Integer> outputFuture = submitAsync(callable, directExecutor());
inputFuture.set("value");
try {
getDone(outputFuture);
fail();
} catch (ExecutionException expected) {
assertSame(error, expected.getCause());
}
}
Aggregations