diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java b/src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java index e6f34ba9d4..ec4e16d8dd 100644 --- a/src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java +++ b/src/test/java/com/google/devtools/build/android/desugar/CoreLibrarySupportTest.java @@ -34,7 +34,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), null, - null, ImmutableList.of("java/time/"), ImmutableList.of(), ImmutableList.of(), @@ -53,7 +52,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter("__/"), null, - null, ImmutableList.of("java/time/"), ImmutableList.of(), ImmutableList.of(), @@ -72,7 +70,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), null, - null, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), @@ -87,7 +84,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter("__/"), null, - null, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), @@ -102,7 +98,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter("__/"), null, - null, ImmutableList.of("java/util/Helper"), ImmutableList.of(), ImmutableList.of("java/util/Existing#match -> java/util/Helper"), @@ -119,7 +114,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of("java/util/concurrent/"), ImmutableList.of("java/util/Map"), ImmutableList.of(), @@ -139,7 +133,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of(), ImmutableList.of("java/util/Collection"), ImmutableList.of(), @@ -176,7 +169,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of(), ImmutableList.of("java/util/Collection"), ImmutableList.of(), @@ -205,7 +197,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of(), ImmutableList.of("java/util/Map"), ImmutableList.of(), @@ -242,7 +233,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of(), ImmutableList.of("java/util/Comparator"), ImmutableList.of(), @@ -267,7 +257,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of("java/util/"), ImmutableList.of(), ImmutableList.of(), @@ -337,7 +326,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of("java/util/concurrent/"), // should return null for these ImmutableList.of("java/util/Map"), ImmutableList.of(), @@ -366,7 +354,6 @@ public class CoreLibrarySupportTest { new CoreLibrarySupport( new CoreLibraryRewriter(""), Thread.currentThread().getContextClassLoader(), - null, ImmutableList.of(), ImmutableList.of("java/util/Collection"), ImmutableList.of(), @@ -388,4 +375,27 @@ public class CoreLibrarySupportTest { false)) .isNull(); } + + @Test + public void testEmulatedMethod_nullExceptions() throws Exception { + CoreLibrarySupport.EmulatedMethod m = + CoreLibrarySupport.EmulatedMethod.create(1, Number.class, "a", "()V", null); + assertThat(m.access()).isEqualTo(1); + assertThat(m.owner()).isEqualTo(Number.class); + assertThat(m.name()).isEqualTo("a"); + assertThat(m.descriptor()).isEqualTo("()V"); + assertThat(m.exceptions()).isEmpty(); + } + + @Test + public void testEmulatedMethod_givenExceptions() throws Exception { + CoreLibrarySupport.EmulatedMethod m = + CoreLibrarySupport.EmulatedMethod.create( + 1, Number.class, "a", "()V", new String[] {"b", "c"}); + assertThat(m.access()).isEqualTo(1); + assertThat(m.owner()).isEqualTo(Number.class); + assertThat(m.name()).isEqualTo("a"); + assertThat(m.descriptor()).isEqualTo("()V"); + assertThat(m.exceptions()).containsExactly("b", "c").inOrder(); + } } |