aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r--src/test/java/com/google/devtools/build/android/AaptCommandBuilderTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/android/AndroidDataBuilder.java2
-rw-r--r--src/test/java/com/google/devtools/build/android/AndroidDataMergerTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/android/AndroidDataSerializerAndDeserializerTest.java57
-rw-r--r--src/test/java/com/google/devtools/build/android/AndroidResourceClassWriterTest.java90
-rw-r--r--src/test/java/com/google/devtools/build/android/DataResourceXmlTest.java17
-rw-r--r--src/test/java/com/google/devtools/build/android/DensitySpecificManifestProcessorTest.java8
-rw-r--r--src/test/java/com/google/devtools/build/android/DensitySpecificResourceFilterTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/android/DependencyAndroidDataTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/android/ManifestMergerActionTest.java14
-rw-r--r--src/test/java/com/google/devtools/build/android/ParsedAndroidDataBuilder.java5
-rw-r--r--src/test/java/com/google/devtools/build/android/ParsedAndroidDataSubject.java6
-rw-r--r--src/test/java/com/google/devtools/build/android/ParsedAndroidDataTest.java23
-rw-r--r--src/test/java/com/google/devtools/build/android/RClassGeneratorActionTest.java36
-rw-r--r--src/test/java/com/google/devtools/build/android/SerializedAndroidDataTest.java11
-rw-r--r--src/test/java/com/google/devtools/build/android/SplitConfigurationFilterTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDataTest.java28
-rw-r--r--src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDirectoriesTest.java24
18 files changed, 202 insertions, 135 deletions
diff --git a/src/test/java/com/google/devtools/build/android/AaptCommandBuilderTest.java b/src/test/java/com/google/devtools/build/android/AaptCommandBuilderTest.java
index 3ff518720c..319fa488f1 100644
--- a/src/test/java/com/google/devtools/build/android/AaptCommandBuilderTest.java
+++ b/src/test/java/com/google/devtools/build/android/AaptCommandBuilderTest.java
@@ -111,7 +111,7 @@ public class AaptCommandBuilderTest {
@Test
public void testAddRepeatedWithEmptyValuesAddsNothing() {
- assertThat(new AaptCommandBuilder(aapt).addRepeated("-0", ImmutableList.of()).build())
+ assertThat(new AaptCommandBuilder(aapt).addRepeated("-0", ImmutableList.<String>of()).build())
.doesNotContain("-0");
}
diff --git a/src/test/java/com/google/devtools/build/android/AndroidDataBuilder.java b/src/test/java/com/google/devtools/build/android/AndroidDataBuilder.java
index 2270ca1248..5e64ef4b9b 100644
--- a/src/test/java/com/google/devtools/build/android/AndroidDataBuilder.java
+++ b/src/test/java/com/google/devtools/build/android/AndroidDataBuilder.java
@@ -123,7 +123,7 @@ public class AndroidDataBuilder {
}
public AndroidDataBuilder createManifest(String path, String manifestPackage, String... lines) {
- return createManifest(path, manifestPackage, ImmutableList.of(), lines);
+ return createManifest(path, manifestPackage, ImmutableList.<String>of(), lines);
}
public AndroidDataBuilder createManifest(
diff --git a/src/test/java/com/google/devtools/build/android/AndroidDataMergerTest.java b/src/test/java/com/google/devtools/build/android/AndroidDataMergerTest.java
index 95c90157fd..80bf3386b1 100644
--- a/src/test/java/com/google/devtools/build/android/AndroidDataMergerTest.java
+++ b/src/test/java/com/google/devtools/build/android/AndroidDataMergerTest.java
@@ -61,7 +61,7 @@ public class AndroidDataMergerTest {
@Before
public void setUp() throws Exception {
fileSystem = Jimfs.newFileSystem();
- fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.of());
+ fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.<String>of());
mergerLogger = Logger.getLogger(AndroidDataMerger.class.getCanonicalName());
loggingHandler = new TestLoggingHandler();
mergerLogger.addHandler(loggingHandler);
diff --git a/src/test/java/com/google/devtools/build/android/AndroidDataSerializerAndDeserializerTest.java b/src/test/java/com/google/devtools/build/android/AndroidDataSerializerAndDeserializerTest.java
index 7f388c30b8..94529e3db3 100644
--- a/src/test/java/com/google/devtools/build/android/AndroidDataSerializerAndDeserializerTest.java
+++ b/src/test/java/com/google/devtools/build/android/AndroidDataSerializerAndDeserializerTest.java
@@ -47,7 +47,7 @@ public class AndroidDataSerializerAndDeserializerTest {
@Before
public void createCleanEnvironment() throws Exception {
fs = Jimfs.newFileSystem();
- fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.of());
+ fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.<String>of());
source = Files.createDirectory(fs.getPath("source"));
manifest = Files.createFile(source.resolve("AndroidManifest.xml"));
}
@@ -80,7 +80,8 @@ public class AndroidDataSerializerAndDeserializerTest {
UnwrittenMergedAndroidData.of(
manifest,
ParsedAndroidDataBuilder.buildOn(source, fqnFactory)
- .combining(xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
+ .combining(
+ xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
.build(),
ParsedAndroidDataBuilder.empty());
expected.serializeTo(serializer);
@@ -158,7 +159,10 @@ public class AndroidDataSerializerAndDeserializerTest {
.createManifest("AndroidManifest.xml", "com.carroll.lewis", "")
.buildParsed();
UnwrittenMergedAndroidData expected =
- UnwrittenMergedAndroidData.of(manifest, direct, ParsedAndroidDataBuilder.empty());
+ UnwrittenMergedAndroidData.of(
+ manifest,
+ direct,
+ ParsedAndroidDataBuilder.empty());
expected.serializeTo(serializer);
serializer.flushTo(binaryPath);
@@ -168,8 +172,10 @@ public class AndroidDataSerializerAndDeserializerTest {
deserializer.read(
binaryPath,
KeyValueConsumers.of(
- overwriting, combining, null // assets
- ));
+ overwriting,
+ combining,
+ null // assets
+ ));
Truth.assertThat(overwriting).isEqualTo(expected.getPrimary().getOverwritingResources());
Truth.assertThat(combining).isEqualTo(expected.getPrimary().getCombiningResources());
}
@@ -184,17 +190,17 @@ public class AndroidDataSerializerAndDeserializerTest {
ParsedAndroidDataBuilder.buildOn(source, fqnFactory)
.overwritable(
file("layout/banker").source("layout/banker.xml"),
- xml("<resources>/foo")
- .source("values/ids.xml")
- .value(
- ResourcesAttribute.of(
- fqnFactory.parse("<resources>/foo"), "foo", "fooVal")))
- .combining(xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
+ xml("<resources>/foo").source("values/ids.xml")
+ .value(ResourcesAttribute.of(
+ fqnFactory.parse("<resources>/foo"), "foo", "fooVal")))
+ .combining(
+ xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
.assets(file().source("hunting/of/the/boojum"))
.build(),
ParsedAndroidDataBuilder.buildOn(source, fqnFactory)
.overwritable(file("layout/butcher").source("layout/butcher.xml"))
- .combining(xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
+ .combining(
+ xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
.assets(file().source("hunting/of/the/snark"))
.build());
expected.serializeTo(serializer);
@@ -226,43 +232,36 @@ public class AndroidDataSerializerAndDeserializerTest {
ParsedAndroidDataBuilder.buildOn(source, fqnFactory)
.overwritable(
file("layout/banker").source("layout/banker.xml"),
- xml("<resources>/foo")
- .source("values/res.xml")
- .value(
- ResourcesAttribute.of(
- fqnFactory.parse("<resources>/foo"), "foo", "fooVal")))
- .combining(xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
+ xml("<resources>/foo").source("values/ids.xml")
+ .value(ResourcesAttribute.of(
+ fqnFactory.parse("<resources>/foo"), "foo", "fooVal")))
+ .combining(
+ xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
.assets(file().source("hunting/of/the/boojum"))
.build(),
ParsedAndroidDataBuilder.buildOn(source, fqnFactory)
.overwritable(file("layout/butcher").source("layout/butcher.xml"))
- .combining(xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
+ .combining(
+ xml("id/snark").source("values/ids.xml").value(IdXmlResourceValue.of()))
.assets(file().source("hunting/of/the/snark"))
.build());
expected.serializeTo(serializer);
serializer.flushTo(binaryPath);
- // Create a file to demonstrate an overmatched filtering
- Files.createDirectories(source.resolve("res/values/ids.xml"));
-
AndroidDataDeserializer deserializer =
AndroidParsedDataDeserializer.withFilteredResources(
- ImmutableList.of(
- "the/boojum", "values/ids.xml", "layout/banker.xml", "values/res.xml"));
+ ImmutableList.of("the/boojum", "values/ids.xml", "layout/banker.xml"));
KeyValueConsumers primary =
KeyValueConsumers.of(
TestMapConsumer.ofResources(), // overwriting
TestMapConsumer.ofResources(), // combining
- TestMapConsumer.ofAssets() // assets
+ null // assets
);
deserializer.read(binaryPath, primary);
Truth.assertThat(primary.overwritingConsumer).isEqualTo(Collections.emptyMap());
- Truth.assertThat(primary.combiningConsumer)
- .named("Filtered resources that exist should not be filtered.")
- .isEqualTo(expected.getPrimary().getCombiningResources());
- Truth.assertThat(primary.assetConsumer).isEqualTo(Collections.emptyMap());
+ Truth.assertThat(primary.combiningConsumer).isEqualTo(Collections.emptyMap());
}
private static class TestMapConsumer<T extends DataValue>
diff --git a/src/test/java/com/google/devtools/build/android/AndroidResourceClassWriterTest.java b/src/test/java/com/google/devtools/build/android/AndroidResourceClassWriterTest.java
index 86d6a28c00..4fdaaa70c1 100644
--- a/src/test/java/com/google/devtools/build/android/AndroidResourceClassWriterTest.java
+++ b/src/test/java/com/google/devtools/build/android/AndroidResourceClassWriterTest.java
@@ -24,6 +24,7 @@ import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Rule;
@@ -44,7 +45,7 @@ public class AndroidResourceClassWriterTest {
public final ExpectedException thrown = ExpectedException.none();
private static final AndroidFrameworkAttrIdProvider mockAndroidFrameworkIds =
- new MockAndroidFrameworkAttrIdProvider(ImmutableMap.of());
+ new MockAndroidFrameworkAttrIdProvider(ImmutableMap.<String, Integer>of());
@Before
public void createCleanEnvironment() {
@@ -99,13 +100,17 @@ public class AndroidResourceClassWriterTest {
ImmutableMap.of(
"AdiosButton", 0x7f030000,
"HelloView", 0x7f030001),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
assertAbout(paths)
.that(target)
.withClass("com.carroll.lewis.R$layout")
.classContentsIsEqualTo(
- ImmutableMap.of("some_layout", 0x7f020000), ImmutableMap.of(), false);
+ ImmutableMap.of("some_layout", 0x7f020000),
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
@Test
@@ -149,8 +154,9 @@ public class AndroidResourceClassWriterTest {
ImmutableMap.of(
"light", 0x7f020000,
"patchface", 0x7f020001),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
@Test
@@ -201,8 +207,9 @@ public class AndroidResourceClassWriterTest {
"light18", 0x7f020001,
"light19", 0x7f020002,
"light20", 0x7f020003),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
@Test
@@ -307,8 +314,9 @@ public class AndroidResourceClassWriterTest {
"x_color", 0x7f010000,
"y_color", 0x7f010001,
"z_color", 0x7f010002),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
assertAbout(paths)
.that(target)
.withClass("com.carroll.lewis.R$style")
@@ -316,8 +324,9 @@ public class AndroidResourceClassWriterTest {
ImmutableMap.of(
"YStyle", 0x7f020000,
"ZStyle_ABC", 0x7f020001),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
assertAbout(paths)
.that(target)
.withClass("com.carroll.lewis.R$styleable")
@@ -330,12 +339,14 @@ public class AndroidResourceClassWriterTest {
.put("com_google_android_Swirls_Fancy_y_color", 1)
.put("com_google_android_Swirls_Fancy_z_color", 2)
.build(),
- ImmutableMap.of(
+ ImmutableMap.<String, List<Integer>>of(
"com_google_android_Dots",
ImmutableList.of(0x7f010000, 0x7f010001, 0x7f010002),
"com_google_android_Swirls_Fancy",
- ImmutableList.of(0x7f010000, 0x7f010001, 0x7f010002)),
- false);
+ ImmutableList.of(0x7f010000, 0x7f010001, 0x7f010002)
+ ),
+ false
+ );
}
@Test
@@ -418,12 +429,18 @@ public class AndroidResourceClassWriterTest {
ImmutableMap.of(
"aaa", 0x7f010000,
"zzz", 0x7f010001),
- ImmutableMap.of(),
- false);
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
assertAbout(paths)
.that(target)
.withClass("com.carroll.lewis.R$style")
- .classContentsIsEqualTo(ImmutableMap.of("YStyle", 0x7f020000), ImmutableMap.of(), false);
+ .classContentsIsEqualTo(
+ ImmutableMap.of(
+ "YStyle", 0x7f020000),
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
assertAbout(paths)
.that(target)
.withClass("com.carroll.lewis.R$styleable")
@@ -432,11 +449,14 @@ public class AndroidResourceClassWriterTest {
"com_google_android_Dots_android_textColor", 0,
"com_google_android_Dots_android_textSize", 1,
"com_google_android_Dots_aaa", 2,
- "com_google_android_Dots_zzz", 3),
- ImmutableMap.of(
+ "com_google_android_Dots_zzz", 3
+ ),
+ ImmutableMap.<String, List<Integer>>of(
"com_google_android_Dots",
- ImmutableList.of(0x01000000, 0x01000010, 0x7f010000, 0x7f010001)),
- false);
+ ImmutableList.of(0x01000000, 0x01000010, 0x7f010000, 0x7f010001)
+ ),
+ false
+ );
}
@Test
@@ -445,7 +465,9 @@ public class AndroidResourceClassWriterTest {
Path source = fs.getPath("source");
AndroidResourceClassWriter resourceClassWriter =
AndroidResourceClassWriter.of(
- new MockAndroidFrameworkAttrIdProvider(ImmutableMap.of()), target, "com.carroll.lewis");
+ new MockAndroidFrameworkAttrIdProvider(ImmutableMap.<String, Integer>of()),
+ target,
+ "com.carroll.lewis");
ParsedAndroidData direct =
AndroidDataBuilder.of(source)
.addResource(
@@ -478,7 +500,9 @@ public class AndroidResourceClassWriterTest {
Path source = fs.getPath("source");
AndroidResourceClassWriter resourceClassWriter =
AndroidResourceClassWriter.of(
- new MockAndroidFrameworkAttrIdProvider(ImmutableMap.of()), target, "com.carroll.lewis");
+ new MockAndroidFrameworkAttrIdProvider(ImmutableMap.<String, Integer>of()),
+ target,
+ "com.carroll.lewis");
ParsedAndroidData direct =
AndroidDataBuilder.of(source)
.addResource(
@@ -543,7 +567,11 @@ public class AndroidResourceClassWriterTest {
assertAbout(paths)
.that(target)
.withClass("com.boop.R$drawable")
- .classContentsIsEqualTo(ImmutableMap.of("1", 0x7f020000), ImmutableMap.of(), false);
+ .classContentsIsEqualTo(
+ ImmutableMap.of("1", 0x7f020000),
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
/**
@@ -585,7 +613,11 @@ public class AndroidResourceClassWriterTest {
assertAbout(paths)
.that(target)
.withClass("com.boop.R$drawable")
- .classContentsIsEqualTo(ImmutableMap.of("c++", 0x7f020000), ImmutableMap.of(), false);
+ .classContentsIsEqualTo(
+ ImmutableMap.of("c++", 0x7f020000),
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
/**
@@ -628,7 +660,11 @@ public class AndroidResourceClassWriterTest {
assertAbout(paths)
.that(target)
.withClass("com.boop.R$integer")
- .classContentsIsEqualTo(ImmutableMap.of("c++", 0x7f020000), ImmutableMap.of(), false);
+ .classContentsIsEqualTo(
+ ImmutableMap.of("c++", 0x7f020000),
+ ImmutableMap.<String, List<Integer>>of(),
+ false
+ );
}
private static class MockAndroidFrameworkAttrIdProvider
diff --git a/src/test/java/com/google/devtools/build/android/DataResourceXmlTest.java b/src/test/java/com/google/devtools/build/android/DataResourceXmlTest.java
index b8309e8022..aa91bf91c3 100644
--- a/src/test/java/com/google/devtools/build/android/DataResourceXmlTest.java
+++ b/src/test/java/com/google/devtools/build/android/DataResourceXmlTest.java
@@ -77,11 +77,12 @@ public class DataResourceXmlTest {
@Before
public void createCleanEnvironment() {
fs = Jimfs.newFileSystem();
- fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.of());
+ fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.<String>of());
}
private Path writeResourceXml(String... xml) throws IOException {
- return writeResourceXml(ImmutableMap.of(), ImmutableMap.of(), xml);
+ return writeResourceXml(ImmutableMap.<String, String>of(), ImmutableMap.<String, String>of(),
+ xml);
}
private Path writeResourceXml(Map<String, String> namespaces, Map<String, String> attributes,
@@ -756,7 +757,7 @@ public class DataResourceXmlTest {
.xmlContentsIsEqualTo(
resourcesXmlFrom(
XLIFF_NAMESPACES,
- ImmutableMap.of(),
+ ImmutableMap.<String, String>of(),
source,
"<string name=\"star_rating\">Check out our 5",
" <xliff:g id=\"star\">\\u2605</xliff:g>",
@@ -791,7 +792,7 @@ public class DataResourceXmlTest {
.xmlContentsIsEqualTo(
resourcesXmlFrom(
ImmutableMap.of("ns1", "urn:oasis:names:tc:xliff:document:1.2"),
- ImmutableMap.of(),
+ ImmutableMap.<String, String>of(),
source,
"<string name=\"star_rating\">Check out our 5 ",
"<ns1:g xmlns:foglebert=\"defogle\" " + "foglebert:id=\"star\">\\u2605</ns1:g>",
@@ -829,10 +830,11 @@ public class DataResourceXmlTest {
"</string>"
};
- Path source = writeResourceXml(XLIFF_NAMESPACES, ImmutableMap.of(), xml);
+ Path source = writeResourceXml(XLIFF_NAMESPACES, ImmutableMap.<String, String>of(), xml);
assertAbout(resourcePaths)
.that(parsedAndWritten(source, fqn("string/AAP_SUGGEST_ACCEPT_SUGGESTION")))
- .xmlContentsIsEqualTo(resourcesXmlFrom(XLIFF_NAMESPACES, ImmutableMap.of(), source, xml));
+ .xmlContentsIsEqualTo(
+ resourcesXmlFrom(XLIFF_NAMESPACES, ImmutableMap.<String, String>of(), source, xml));
}
@Test
@@ -1272,7 +1274,8 @@ public class DataResourceXmlTest {
}
private String[] resourcesXmlFrom(Path source, String... lines) {
- return resourcesXmlFrom(ImmutableMap.of(), ImmutableMap.of(), source, lines);
+ return resourcesXmlFrom(ImmutableMap.<String, String>of(), ImmutableMap.<String, String>of(),
+ source, lines);
}
private String[] resourcesXmlFrom(Map<String, String> namespaces, Map<String, String> attributes,
diff --git a/src/test/java/com/google/devtools/build/android/DensitySpecificManifestProcessorTest.java b/src/test/java/com/google/devtools/build/android/DensitySpecificManifestProcessorTest.java
index 96fa095df4..e43cc9f8c9 100644
--- a/src/test/java/com/google/devtools/build/android/DensitySpecificManifestProcessorTest.java
+++ b/src/test/java/com/google/devtools/build/android/DensitySpecificManifestProcessorTest.java
@@ -54,10 +54,8 @@ public class DensitySpecificManifestProcessorTest {
"<manifest xmlns:android='http://schemas.android.com/apk/res/android'",
" package='com.google.test'>",
"</manifest>");
- Path modified =
- new DensitySpecificManifestProcessor(
- ImmutableList.of(), tmp.resolve("manifest-filtered/AndroidManifest.xml"))
- .process(manifest);
+ Path modified = new DensitySpecificManifestProcessor(ImmutableList.<String>of(),
+ tmp.resolve("manifest-filtered/AndroidManifest.xml")).process(manifest);
assertThat((Object) modified).isEqualTo(manifest);
}
@@ -142,7 +140,7 @@ public class DensitySpecificManifestProcessorTest {
Path modified = new DensitySpecificManifestProcessor(densities,
tmp.resolve("manifest-filtered/AndroidManifest.xml")).process(manifest);
assertThat((Object) modified).isNotNull();
- checkModification(modified, ImmutableList.of("ldpi", "xxhdpi"));
+ checkModification(modified, ImmutableList.<String>of("ldpi", "xxhdpi"));
}
@Test public void testMalformedManifest() throws Exception {
diff --git a/src/test/java/com/google/devtools/build/android/DensitySpecificResourceFilterTest.java b/src/test/java/com/google/devtools/build/android/DensitySpecificResourceFilterTest.java
index 628dc3bf18..03f38e93e9 100644
--- a/src/test/java/com/google/devtools/build/android/DensitySpecificResourceFilterTest.java
+++ b/src/test/java/com/google/devtools/build/android/DensitySpecificResourceFilterTest.java
@@ -132,7 +132,8 @@ public class DensitySpecificResourceFilterTest {
@Test public void testUnknownDensityFails() {
try {
checkTransformedResources(
- ImmutableList.of(), ImmutableList.of(), ImmutableList.of("xxhdpi", "322dpi"));
+ ImmutableList.<String>of(), ImmutableList.<String>of(),
+ ImmutableList.of("xxhdpi", "322dpi"));
fail("expected MergingException");
} catch (MergingException expected) {
}
diff --git a/src/test/java/com/google/devtools/build/android/DependencyAndroidDataTest.java b/src/test/java/com/google/devtools/build/android/DependencyAndroidDataTest.java
index 769b46896c..5aef80cf65 100644
--- a/src/test/java/com/google/devtools/build/android/DependencyAndroidDataTest.java
+++ b/src/test/java/com/google/devtools/build/android/DependencyAndroidDataTest.java
@@ -105,7 +105,7 @@ public class DependencyAndroidDataTest {
":assets:AndroidManifest.xml:r.txt:symbols.bin", fileSystem))
.isEqualTo(
new DependencyAndroidData(
- ImmutableList.of(), ImmutableList.of(assets), manifest, rTxt, symbols, null));
+ ImmutableList.<Path>of(), ImmutableList.of(assets), manifest, rTxt, symbols, null));
}
@Test public void flagParseWithEmptyAssets() throws Exception{
@@ -113,7 +113,7 @@ public class DependencyAndroidDataTest {
DependencyAndroidData.valueOf("res::AndroidManifest.xml:r.txt:symbols.bin", fileSystem))
.isEqualTo(
new DependencyAndroidData(
- ImmutableList.of(res), ImmutableList.of(), manifest, rTxt, symbols, null));
+ ImmutableList.of(res), ImmutableList.<Path>of(), manifest, rTxt, symbols, null));
}
@Test public void flagParseWithEmptyResourcesAndAssets() throws Exception{
@@ -121,7 +121,7 @@ public class DependencyAndroidDataTest {
DependencyAndroidData.valueOf("::AndroidManifest.xml:r.txt:symbols.bin", fileSystem))
.isEqualTo(
new DependencyAndroidData(
- ImmutableList.of(), ImmutableList.of(), manifest, rTxt, symbols, null));
+ ImmutableList.<Path>of(), ImmutableList.<Path>of(), manifest, rTxt, symbols, null));
}
@Test public void flagNoManifestFails() {
diff --git a/src/test/java/com/google/devtools/build/android/ManifestMergerActionTest.java b/src/test/java/com/google/devtools/build/android/ManifestMergerActionTest.java
index 5e3cf8e0ea..9b989adba0 100644
--- a/src/test/java/com/google/devtools/build/android/ManifestMergerActionTest.java
+++ b/src/test/java/com/google/devtools/build/android/ManifestMergerActionTest.java
@@ -173,8 +173,8 @@ public class ManifestMergerActionTest {
.getManifest();
// libFoo manifest merging
- List<String> args =
- generateArgs(libFooManifest, ImmutableMap.of(), true, ImmutableMap.of(), "", libFooOutput);
+ List<String> args = generateArgs(libFooManifest, ImmutableMap.<Path, String>of(), true,
+ ImmutableMap.<String, String>of(), "", libFooOutput);
ManifestMergerAction.main(args.toArray(new String[0]));
assertThat(Joiner.on(" ")
.join(Files.readAllLines(libFooOutput, UTF_8))
@@ -186,14 +186,8 @@ public class ManifestMergerActionTest {
+ "</manifest>");
// libBar manifest merging
- args =
- generateArgs(
- libBarManifest,
- ImmutableMap.of(),
- true,
- ImmutableMap.of(),
- "com.google.libbar",
- libBarOutput);
+ args = generateArgs(libBarManifest, ImmutableMap.<Path, String>of(), true,
+ ImmutableMap.<String, String>of(), "com.google.libbar", libBarOutput);
ManifestMergerAction.main(args.toArray(new String[0]));
assertThat(Joiner.on(" ")
.join(Files.readAllLines(libBarOutput, UTF_8))
diff --git a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataBuilder.java b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataBuilder.java
index 59cae58f4d..21e79dae94 100644
--- a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataBuilder.java
+++ b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataBuilder.java
@@ -48,7 +48,10 @@ public class ParsedAndroidDataBuilder {
public static ParsedAndroidData empty() {
return ParsedAndroidData.of(
- ImmutableSet.of(), ImmutableMap.of(), ImmutableMap.of(), ImmutableMap.of());
+ ImmutableSet.<MergeConflict>of(),
+ ImmutableMap.<DataKey, DataResource>of(),
+ ImmutableMap.<DataKey, DataResource>of(),
+ ImmutableMap.<DataKey, DataAsset>of());
}
public static ParsedAndroidDataBuilder buildOn(
diff --git a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataSubject.java b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataSubject.java
index 824a109857..07c6fa42a6 100644
--- a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataSubject.java
+++ b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataSubject.java
@@ -31,14 +31,14 @@ class ParsedAndroidDataSubject extends Subject<ParsedAndroidDataSubject, ParsedA
public void isEqualTo(ParsedAndroidData expectation) {
List<String> errors = new ArrayList<>();
- this.compareDataValues(
+ this.<DataAsset>compareDataValues(
actual().iterateAssetEntries(), expectation.iterateAssetEntries(), errors, "assets");
- this.compareDataValues(
+ this.<DataResource>compareDataValues(
actual().iterateCombiningEntries(),
expectation.iterateCombiningEntries(),
errors,
"combining");
- this.compareDataValues(
+ this.<DataResource>compareDataValues(
actual().iterateOverwritableEntries(),
expectation.iterateOverwritableEntries(),
errors,
diff --git a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataTest.java b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataTest.java
index d296252151..e7a55bc9a4 100644
--- a/src/test/java/com/google/devtools/build/android/ParsedAndroidDataTest.java
+++ b/src/test/java/com/google/devtools/build/android/ParsedAndroidDataTest.java
@@ -47,7 +47,7 @@ public class ParsedAndroidDataTest {
@Before
public void createCleanEnvironment() {
fs = Jimfs.newFileSystem();
- fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.of());
+ fqnFactory = FullyQualifiedName.Factory.from(ImmutableList.<String>of());
}
@Test
@@ -98,9 +98,10 @@ public class ParsedAndroidDataTest {
ImmutableSet.of(
MergeConflict.of(
key, DataValueFile.of(assetSource), DataValueFile.of(otherAssetSource))),
- ImmutableMap.of(),
- ImmutableMap.of(),
- ImmutableMap.of(key, DataValueFile.of(otherAssetSource.overwrite(assetSource)))));
+ ImmutableMap.<DataKey, DataResource>of(),
+ ImmutableMap.<DataKey, DataResource>of(),
+ ImmutableMap.<DataKey, DataAsset>of(
+ key, DataValueFile.of(otherAssetSource.overwrite(assetSource)))));
}
@Test
@@ -141,7 +142,7 @@ public class ParsedAndroidDataTest {
.buildDependency()));
FullyQualifiedName.Factory fqnFactory =
- FullyQualifiedName.Factory.from(ImmutableList.of("hdpi", "v4"));
+ FullyQualifiedName.Factory.from(ImmutableList.<String>of("hdpi", "v4"));
FullyQualifiedName drawable = fqnFactory.parse("drawable/seven_eight");
assertThat(dataSet.getOverwritingResources())
.containsExactly(
@@ -182,7 +183,9 @@ public class ParsedAndroidDataTest {
ParsedAndroidData dataSet =
ParsedAndroidData.from(
new UnvalidatedAndroidData(
- ImmutableList.of(root), ImmutableList.of(), root.resolve("AndroidManifest.xml")));
+ ImmutableList.of(root),
+ ImmutableList.<Path>of(),
+ root.resolve("AndroidManifest.xml")));
FullyQualifiedName layoutFoo = fqnFactory.parse("layout/foo");
FullyQualifiedName drawableMenu = fqnFactory.parse("drawable/menu");
@@ -359,7 +362,7 @@ public class ParsedAndroidDataTest {
DataResourceXml.createWithNoNamespace(
otherRootValuesPath,
ResourcesAttribute.of(attributeFoo, "foo", "fooVal")))),
- ImmutableMap.of(
+ ImmutableMap.<DataKey, DataResource>of(
drawableMenu, // key
DataValueFile.of(
otherRootDrawableMenuPath.overwrite(rootDrawableMenuPath)), // value
@@ -373,12 +376,12 @@ public class ParsedAndroidDataTest {
SimpleXmlResourceValue.createWithValue(
SimpleXmlResourceValue.Type.STRING, "way out")) // value
),
- ImmutableMap.of(
+ ImmutableMap.<DataKey, DataResource>of(
idSomeId, // key
DataResourceXml.createWithNoNamespace(
rootValuesPath, IdXmlResourceValue.of()) // value
),
- ImmutableMap.of()));
+ ImmutableMap.<DataKey, DataAsset>of()));
}
@Test
@@ -544,7 +547,7 @@ public class ParsedAndroidDataTest {
.createManifest("AndroidManifest.xml", "com.carroll.lewis", "")
.buildParsed();
FullyQualifiedName.Factory fqnV21Factory =
- FullyQualifiedName.Factory.from(ImmutableList.of("v21"));
+ FullyQualifiedName.Factory.from(ImmutableList.<String>of("v21"));
FullyQualifiedName drawableKey = fqnV21Factory.parse("drawable/some_drawable");
Path drawablePath = root.resolve("res/drawable-v21/some_drawable.xml");
assertThat(dataSet.getOverwritingResources())
diff --git a/src/test/java/com/google/devtools/build/android/RClassGeneratorActionTest.java b/src/test/java/com/google/devtools/build/android/RClassGeneratorActionTest.java
index 2f3ae78549..e03348cdaa 100644
--- a/src/test/java/com/google/devtools/build/android/RClassGeneratorActionTest.java
+++ b/src/test/java/com/google/devtools/build/android/RClassGeneratorActionTest.java
@@ -109,7 +109,7 @@ public class RClassGeneratorActionTest {
Path jarPath = tempDir.resolve("app_resources.jar");
RClassGeneratorAction.main(
- ImmutableList.of(
+ ImmutableList.<String>of(
"--primaryRTxt",
binarySymbols.toString(),
"--primaryManifest",
@@ -165,7 +165,7 @@ public class RClassGeneratorActionTest {
Path jarPath = tempDir.resolve("app_resources.jar");
RClassGeneratorAction.main(
- ImmutableList.of(
+ ImmutableList.<String>of(
"--library",
libFooSymbols + "," + libFooManifest,
"--library",
@@ -212,12 +212,11 @@ public class RClassGeneratorActionTest {
Path jarPath = tempDir.resolve("app_resources.jar");
- RClassGeneratorAction.main(
- ImmutableList.of(
- "--primaryRTxt", binarySymbols.toString(),
- "--primaryManifest", binaryManifest.toString(),
- "--classJarOutput", jarPath.toString())
- .toArray(new String[0]));
+ RClassGeneratorAction.main(ImmutableList.<String>of(
+ "--primaryRTxt", binarySymbols.toString(),
+ "--primaryManifest", binaryManifest.toString(),
+ "--classJarOutput", jarPath.toString()
+ ).toArray(new String[0]));
assertThat(Files.exists(jarPath)).isTrue();
assertThat(Files.getLastModifiedTime(jarPath)).isEqualTo(FileTime.fromMillis(0));
@@ -240,8 +239,9 @@ public class RClassGeneratorActionTest {
@Test
public void noBinary() throws Exception {
Path jarPath = tempDir.resolve("app_resources.jar");
- RClassGeneratorAction.main(
- ImmutableList.of("--classJarOutput", jarPath.toString()).toArray(new String[0]));
+ RClassGeneratorAction.main(ImmutableList.<String>of(
+ "--classJarOutput", jarPath.toString()
+ ).toArray(new String[0]));
assertThat(Files.exists(jarPath)).isTrue();
assertThat(Files.getLastModifiedTime(jarPath)).isEqualTo(FileTime.fromMillis(0));
@@ -271,7 +271,7 @@ public class RClassGeneratorActionTest {
"int string ok 0x1");
Path jarPath = tempDir.resolve("app_resources.jar");
RClassGeneratorAction.main(
- ImmutableList.of(
+ ImmutableList.<String>of(
"--primaryRTxt",
binarySymbols.toString(),
"--primaryManifest",
@@ -313,13 +313,13 @@ public class RClassGeneratorActionTest {
Path binarySymbols = createFile("R.txt", "");
Path jarPath = tempDir.resolve("app_resources.jar");
RClassGeneratorAction.main(
- ImmutableList.of(
- "--primaryRTxt",
- binarySymbols.toString(),
- "--primaryManifest",
- binaryManifest.toString(),
- "--classJarOutput",
- jarPath.toString())
+ ImmutableList.<String>of(
+ "--primaryRTxt",
+ binarySymbols.toString(),
+ "--primaryManifest",
+ binaryManifest.toString(),
+ "--classJarOutput",
+ jarPath.toString())
.toArray(new String[0]));
assertThat(Files.exists(jarPath)).isTrue();
diff --git a/src/test/java/com/google/devtools/build/android/SerializedAndroidDataTest.java b/src/test/java/com/google/devtools/build/android/SerializedAndroidDataTest.java
index cc3cba7293..eb9837f39f 100644
--- a/src/test/java/com/google/devtools/build/android/SerializedAndroidDataTest.java
+++ b/src/test/java/com/google/devtools/build/android/SerializedAndroidDataTest.java
@@ -78,10 +78,11 @@ public class SerializedAndroidDataTest {
@Test
public void flagParseWithEmptyResources() throws Exception {
Truth.assertThat(
- SerializedAndroidData.valueOf(";assets;//some_target/foo:foo;symbols.bin", fileSystem))
+ SerializedAndroidData.valueOf(
+ ";assets;//some_target/foo:foo;symbols.bin", fileSystem))
.isEqualTo(
new SerializedAndroidData(
- ImmutableList.of(), ImmutableList.of(assets), label, symbols));
+ ImmutableList.<Path>of(), ImmutableList.of(assets), label, symbols));
}
@Test
@@ -89,7 +90,8 @@ public class SerializedAndroidDataTest {
Truth.assertThat(
SerializedAndroidData.valueOf("res;;//some_target/foo:foo;symbols.bin", fileSystem))
.isEqualTo(
- new SerializedAndroidData(ImmutableList.of(res), ImmutableList.of(), label, symbols));
+ new SerializedAndroidData(
+ ImmutableList.of(res), ImmutableList.<Path>of(), label, symbols));
}
@Test
@@ -97,7 +99,8 @@ public class SerializedAndroidDataTest {
Truth.assertThat(
SerializedAndroidData.valueOf(";;//some_target/foo:foo;symbols.bin", fileSystem))
.isEqualTo(
- new SerializedAndroidData(ImmutableList.of(), ImmutableList.of(), label, symbols));
+ new SerializedAndroidData(
+ ImmutableList.<Path>of(), ImmutableList.<Path>of(), label, symbols));
}
@Test
diff --git a/src/test/java/com/google/devtools/build/android/SplitConfigurationFilterTest.java b/src/test/java/com/google/devtools/build/android/SplitConfigurationFilterTest.java
index e3c1195ee5..db55ac1e68 100644
--- a/src/test/java/com/google/devtools/build/android/SplitConfigurationFilterTest.java
+++ b/src/test/java/com/google/devtools/build/android/SplitConfigurationFilterTest.java
@@ -34,7 +34,8 @@ public final class SplitConfigurationFilterTest {
@Test
public void mapFilenamesToSplitFlagsShouldReturnEmptyMapForEmptyInput()
throws UnrecognizedSplitsException {
- assertThat(mapFilenamesToSplitFlags(ImmutableList.of(), ImmutableList.of())).isEmpty();
+ assertThat(mapFilenamesToSplitFlags(ImmutableList.<String>of(), ImmutableList.<String>of()))
+ .isEmpty();
}
@Test
diff --git a/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDataTest.java b/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDataTest.java
index ee97a77d1a..2a662f7430 100644
--- a/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDataTest.java
+++ b/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDataTest.java
@@ -58,19 +58,33 @@ public class UnvalidatedAndroidDataTest {
}
@Test public void flagParseWithEmptyResources() throws Exception {
- Truth.assertThat(UnvalidatedAndroidData.valueOf(":assets:AndroidManifest.xml", fileSystem))
- .isEqualTo(
- new UnvalidatedAndroidData(ImmutableList.of(), ImmutableList.of(assets), manifest));
+ Truth.assertThat(
+ UnvalidatedAndroidData.valueOf(
+ ":assets:AndroidManifest.xml", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidData(ImmutableList.<Path>of(),
+ ImmutableList.of(assets),
+ manifest));
}
@Test public void flagParseWithEmptyAssets() throws Exception {
- Truth.assertThat(UnvalidatedAndroidData.valueOf("res::AndroidManifest.xml", fileSystem))
- .isEqualTo(new UnvalidatedAndroidData(ImmutableList.of(res), ImmutableList.of(), manifest));
+ Truth.assertThat(
+ UnvalidatedAndroidData.valueOf(
+ "res::AndroidManifest.xml", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidData(ImmutableList.of(res),
+ ImmutableList.<Path>of(),
+ manifest));
}
@Test public void flagParseWithEmptyResourcesAndAssets() throws Exception {
- Truth.assertThat(UnvalidatedAndroidData.valueOf("::AndroidManifest.xml", fileSystem))
- .isEqualTo(new UnvalidatedAndroidData(ImmutableList.of(), ImmutableList.of(), manifest));
+ Truth.assertThat(
+ UnvalidatedAndroidData.valueOf(
+ "::AndroidManifest.xml", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidData(ImmutableList.<Path>of(),
+ ImmutableList.<Path>of(),
+ manifest));
}
@Test public void flagNoManifestFails() {
diff --git a/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDirectoriesTest.java b/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDirectoriesTest.java
index a0b1129dac..1d70d81915 100644
--- a/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDirectoriesTest.java
+++ b/src/test/java/com/google/devtools/build/android/UnvalidatedAndroidDirectoriesTest.java
@@ -52,18 +52,30 @@ public class UnvalidatedAndroidDirectoriesTest {
}
@Test public void flagParseWithEmptyAssets() throws Exception {
- Truth.assertThat(UnvalidatedAndroidDirectories.valueOf("res:", fileSystem))
- .isEqualTo(new UnvalidatedAndroidDirectories(ImmutableList.of(res), ImmutableList.of()));
+ Truth.assertThat(
+ UnvalidatedAndroidDirectories.valueOf(
+ "res:", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidDirectories(ImmutableList.of(res),
+ ImmutableList.<Path>of()));
}
@Test public void flagParseWithEmptyResources() throws Exception {
- Truth.assertThat(UnvalidatedAndroidDirectories.valueOf(":assets", fileSystem))
- .isEqualTo(new UnvalidatedAndroidDirectories(ImmutableList.of(), ImmutableList.of(assets)));
+ Truth.assertThat(
+ UnvalidatedAndroidDirectories.valueOf(
+ ":assets", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidDirectories(ImmutableList.<Path>of(),
+ ImmutableList.of(assets)));
}
@Test public void flagParseWithEmptyResourcesAndAssets() throws Exception {
- Truth.assertThat(UnvalidatedAndroidDirectories.valueOf(":", fileSystem))
- .isEqualTo(new UnvalidatedAndroidDirectories(ImmutableList.of(), ImmutableList.of()));
+ Truth.assertThat(
+ UnvalidatedAndroidDirectories.valueOf(
+ ":", fileSystem)
+ ).isEqualTo(
+ new UnvalidatedAndroidDirectories(ImmutableList.<Path>of(),
+ ImmutableList.<Path>of()));
}
}