From 963e3eeb003093b3934dab7f1c73a4c46d75321c Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Thu, 26 Apr 2018 21:07:05 -0700 Subject: updater_sample: Improve UpdateConfig UpdateConfig: - constant names changed - added parsing streaming metadata - added InnerFile to describe a file in zip Android.mk - added guava tests fixed Test: using junit4 Change-Id: Ibe3c8a3bde20259b0eea9a79aca4b22ed7b048f4 Signed-off-by: Zhomart Mukhamejanov --- .../example/android/systemupdatersample/util/UpdateConfigsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java') diff --git a/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java b/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java index 4aa8c6453..c85698c0f 100644 --- a/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java +++ b/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java @@ -54,8 +54,8 @@ public class UpdateConfigsTest { @Test public void configsToNames_extractsNames() { List configs = Arrays.asList( - new UpdateConfig("blah", "http://", UpdateConfig.TYPE_NON_STREAMING), - new UpdateConfig("blah 2", "http://", UpdateConfig.TYPE_STREAMING) + new UpdateConfig("blah", "http://", UpdateConfig.AB_INSTALL_TYPE_NON_STREAMING), + new UpdateConfig("blah 2", "http://", UpdateConfig.AB_INSTALL_TYPE_STREAMING) ); String[] names = UpdateConfigs.configsToNames(configs); assertArrayEquals(new String[] {"blah", "blah 2"}, names); -- cgit v1.2.3 From e606f6d3ff728ff4a1cb279aa9294a087fd57dd4 Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Wed, 2 May 2018 20:47:05 -0700 Subject: updater_sample: update tests - fix tools/gen_update_config.py - add tests for PayloadSpecs#forStreaming Test: junit4 Change-Id: Ife1980c5f72944ed35500aa820b30031fc99e820 Signed-off-by: Zhomart Mukhamejanov --- .../android/systemupdatersample/util/UpdateConfigsTest.java | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java') diff --git a/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java b/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java index c85698c0f..4ccae9380 100644 --- a/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java +++ b/updater_sample/tests/src/com/example/android/systemupdatersample/util/UpdateConfigsTest.java @@ -18,14 +18,11 @@ package com.example.android.systemupdatersample.util; import static org.junit.Assert.assertArrayEquals; -import android.content.Context; -import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; import android.support.test.runner.AndroidJUnit4; import com.example.android.systemupdatersample.UpdateConfig; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -41,16 +38,9 @@ import java.util.List; @SmallTest public class UpdateConfigsTest { - private Context mContext; - @Rule public final ExpectedException thrown = ExpectedException.none(); - @Before - public void setUp() { - mContext = InstrumentationRegistry.getTargetContext(); - } - @Test public void configsToNames_extractsNames() { List configs = Arrays.asList( -- cgit v1.2.3