From e10875210adef2949aa4f9b56c40fb6d81b0f222 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Mon, 5 Mar 2018 16:13:33 +0000 Subject: [PATCH] Fix SettingsRoboTests build error with OpenJDK 9 - CL http://ag/3671365 broke git_pi-release/marlin-userdebug-jdk9 when building "m checkbuild". It shouldn't break the image build Test: m SettingsRoboTests ROBOTEST_FILTER=com.android.settings.datetime.timezone EXPERIMENTAL_USE_OPENJDK9=true USE_R8=true Change-Id: I161c0350cff55bd13ba4a6c63df4e4e9bc4b1a5f --- .../timezone/model/TimeZoneDataTest.java | 6 +-- .../src/libcore/util/CountryTimeZones.java | 45 ------------------- .../src/libcore/util/CountryZonesFinder.java | 38 ---------------- 3 files changed, 3 insertions(+), 86 deletions(-) delete mode 100644 tests/robotests/src/libcore/util/CountryTimeZones.java delete mode 100644 tests/robotests/src/libcore/util/CountryZonesFinder.java diff --git a/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java b/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java index e6073a8ecb4..4a624b70f6c 100644 --- a/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java +++ b/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java @@ -73,13 +73,13 @@ public class TimeZoneDataTest { CountryTimeZones US = mock(CountryTimeZones.class); when(US.getCountryIso()).thenReturn("us"); when(US.getTimeZoneMappings()).thenReturn(Arrays.asList( - new CountryTimeZones.TimeZoneMapping("Unknown/Secret_City", true), - new CountryTimeZones.TimeZoneMapping("Unknown/Secret_City2", false) + TimeZoneMapping.createForTests("Unknown/Secret_City", true), + TimeZoneMapping.createForTests("Unknown/Secret_City2", false) )); CountryTimeZones GB = mock(CountryTimeZones.class); when(GB.getCountryIso()).thenReturn("gb"); when(GB.getTimeZoneMappings()).thenReturn(Collections.singletonList( - new TimeZoneMapping("Unknown/Secret_City", true) + TimeZoneMapping.createForTests("Unknown/Secret_City", true) )); when(mCountryZonesFinder.lookupCountryTimeZonesForZoneId("Unknown/Secret_City")) .thenReturn(Arrays.asList(US, GB)); diff --git a/tests/robotests/src/libcore/util/CountryTimeZones.java b/tests/robotests/src/libcore/util/CountryTimeZones.java deleted file mode 100644 index 2087848609d..00000000000 --- a/tests/robotests/src/libcore/util/CountryTimeZones.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package libcore.util; - -import java.util.List; - -/** - * Empty implementation of CountryTimeZones for Robolectric test. - */ -public class CountryTimeZones { - public CountryTimeZones() { - } - - public final static class TimeZoneMapping { - public final String timeZoneId; - public final boolean showInPicker; - - public TimeZoneMapping(String timeZoneId, boolean showInPicker) { - this.timeZoneId = timeZoneId; - this.showInPicker = showInPicker; - } - } - - public List getTimeZoneMappings() { - return null; - } - - public String getCountryIso() { - return null; - } -} diff --git a/tests/robotests/src/libcore/util/CountryZonesFinder.java b/tests/robotests/src/libcore/util/CountryZonesFinder.java deleted file mode 100644 index 51149ecb915..00000000000 --- a/tests/robotests/src/libcore/util/CountryZonesFinder.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package libcore.util; - -import java.util.List; - -/** - * Empty implementation of CountryZonesFinder for Robolectric test. - */ -public class CountryZonesFinder { - public CountryZonesFinder(List countryTimeZonesList) {} - - public List lookupAllCountryIsoCodes() { - return null; - } - - public List lookupCountryTimeZonesForZoneId(String zoneId) { - return null; - } - - public CountryTimeZones lookupCountryTimeZones(String countryIso) { - return null; - } -}