Skip to content

Commit

Permalink
Add @GwtIncompatible to ConverterTest methods that fail J2CL comp…
Browse files Browse the repository at this point in the history
…ilation.

PiperOrigin-RevId: 571365750
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Oct 6, 2023
1 parent 67a0b3a commit fad1fa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.base.Functions.toStringFunction;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.primitives.Longs;
Expand All @@ -29,7 +30,7 @@
import junit.framework.TestCase;

/** Unit tests for {@link Converter}. */
@GwtCompatible
@GwtCompatible(emulated = true)
public class ConverterTest extends TestCase {

private static final Converter<String, Long> STR_TO_LONG =
Expand Down Expand Up @@ -111,6 +112,7 @@ public StringWrapper(String value) {
}
}

@GwtIncompatible // J2CL generics problem
public void testAndThen() {
Converter<StringWrapper, String> first =
new Converter<StringWrapper, String>() {
Expand Down Expand Up @@ -140,6 +142,7 @@ public String toString() {
assertEquals(first.andThen(STR_TO_LONG), first.andThen(STR_TO_LONG));
}

@GwtIncompatible // J2CL generics problem
public void testIdentityConverter() {
Converter<String, String> stringIdentityConverter = Converter.identity();

Expand Down Expand Up @@ -213,6 +216,7 @@ public void testSerialization_reverse() {
SerializableTester.reserializeAndAssert(reverseConverter);
}

@GwtIncompatible // J2CL generics problem
public void testSerialization_andThen() {
Converter<String, Long> converterA = Longs.stringConverter();
Converter<Long, String> reverseConverter = Longs.stringConverter().reverse();
Expand Down
6 changes: 5 additions & 1 deletion guava-tests/test/com/google/common/base/ConverterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.base.Functions.toStringFunction;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.primitives.Longs;
Expand All @@ -29,7 +30,7 @@
import junit.framework.TestCase;

/** Unit tests for {@link Converter}. */
@GwtCompatible
@GwtCompatible(emulated = true)
public class ConverterTest extends TestCase {

private static final Converter<String, Long> STR_TO_LONG =
Expand Down Expand Up @@ -111,6 +112,7 @@ public StringWrapper(String value) {
}
}

@GwtIncompatible // J2CL generics problem
public void testAndThen() {
Converter<StringWrapper, String> first =
new Converter<StringWrapper, String>() {
Expand Down Expand Up @@ -140,6 +142,7 @@ public String toString() {
assertEquals(first.andThen(STR_TO_LONG), first.andThen(STR_TO_LONG));
}

@GwtIncompatible // J2CL generics problem
public void testIdentityConverter() {
Converter<String, String> stringIdentityConverter = Converter.identity();

Expand Down Expand Up @@ -213,6 +216,7 @@ public void testSerialization_reverse() {
SerializableTester.reserializeAndAssert(reverseConverter);
}

@GwtIncompatible // J2CL generics problem
public void testSerialization_andThen() {
Converter<String, Long> converterA = Longs.stringConverter();
Converter<Long, String> reverseConverter = Longs.stringConverter().reverse();
Expand Down

0 comments on commit fad1fa3

Please sign in to comment.