From c486b1796253ab2b1f27eafa06df23aa6edfa9d7 Mon Sep 17 00:00:00 2001 From: Abdulhafiz67 <43554997+Abdulhafiz67@users.noreply.github.com> Date: Wed, 30 Oct 2019 17:33:56 -0600 Subject: [PATCH 1/4] Create travis.yml --- travis.yml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 travis.yml diff --git a/travis.yml b/travis.yml new file mode 100644 index 00000000..e52c153e --- /dev/null +++ b/travis.yml @@ -0,0 +1,61 @@ +language: android +jdk: oraclejdk8 + +env: + global: + - ANDROID_TARGET=android-22 + - ANDROID_ABI=armeabi-v7a + +android: + components: + # Uncomment the lines below if you want to + # use the latest revision of Android SDK Tools + - tools + - platform-tools + + # The BuildTools version used by your project + - build-tools-23.0.3 + + # The SDK version used to compile your project + # TODO: why is this here explicitly in addition to $ANDROID_TARGET below + - android-23 + + # Additional components + - extra-google-google_play_services + - extra-google-m2repository + - extra-android-m2repository + + # The SDK version used to compile your project + - $ANDROID_TARGET + + # Specify at least one system image, + # if you need to run emulator(s) during your tests. + # The line should look like this after interpolation: + # - sys-img-armeabi-v7a-android-22 + - sys-img-${ANDROID_ABI}-${ANDROID_TARGET} + +licenses: + - 'android-sdk-license-.+' + +before_install: + # Accept sdk licenses + - yes | sdkmanager "platforms;android-29" + + # Get gradle + - chmod +x gradlew + - wget http://services.gradle.org/distributions/gradle-5.3-bin.zip + - unzip -qq gradle-5.3-bin.zip + - export GRADLE_HOME=$PWD/gradle-5.3 + - export PATH=$GRADLE_HOME/bin:$PATH + + # Build the project + - gradle -v + + # Start the emulator + - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI + - emulator -avd test -no-skin -no-audio -no-window & + - android-wait-for-emulator + - adb shell input keyevent 82 & + + # The app will now automatically be installed and tested via + # the command `gradle connectedCheck` From edc48bcd69d9a68493696b605dc54ccc492c23b4 Mon Sep 17 00:00:00 2001 From: Abdulhafiz67 <43554997+Abdulhafiz67@users.noreply.github.com> Date: Wed, 30 Oct 2019 17:35:31 -0600 Subject: [PATCH 2/4] Rename travis.yml to .travis.yml --- travis.yml => .travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename travis.yml => .travis.yml (100%) diff --git a/travis.yml b/.travis.yml similarity index 100% rename from travis.yml rename to .travis.yml From 66fe565b86d660196581122be0f20aaef0a04f00 Mon Sep 17 00:00:00 2001 From: Abdulhafiz67 <43554997+Abdulhafiz67@users.noreply.github.com> Date: Wed, 30 Oct 2019 17:44:08 -0600 Subject: [PATCH 3/4] Rename .travis.yml to travis.yml --- .travis.yml => travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .travis.yml => travis.yml (100%) diff --git a/.travis.yml b/travis.yml similarity index 100% rename from .travis.yml rename to travis.yml From 389b2e5621f775a03a73f7879f18ea6bcc1cd35a Mon Sep 17 00:00:00 2001 From: abdulhafiz67 Date: Wed, 30 Oct 2019 19:34:15 -0600 Subject: [PATCH 4/4] Created test for the function; clearAll --- .../example/simpleparadox/listycity/CityList.java | 8 ++++++++ .../simpleparadox/listycity/CityListTest.java | 14 ++++++++++++++ build.gradle | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java index 6da242f3..42e5d34e 100644 --- a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java +++ b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java @@ -69,6 +69,14 @@ public void delete(City city) { } } + /*** + * This function has not been implemented yet + */ + public void clearAll(){ + + } + + /** * Return the size of the city list * @return diff --git a/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java b/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java index 787eab7e..88a5f2ec 100644 --- a/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java +++ b/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java @@ -29,6 +29,20 @@ void testAdd() { assertTrue(cityList.hasCity(new City("Regina", "Saskatchewan"))); } + @Test + void testClearAll() { + CityList cityList = mockCityList(); + + assertEquals(1, cityList.countCities()); + + cityList.add(new City("Regina", "Saskatchewan")); + + assertEquals(2, cityList.countCities()); + assertTrue(cityList.hasCity(new City("Regina", "Saskatchewan"))); + cityList.clearAll();// Not implemented yet + assertEquals(0, cityList.countCities()); + } + @Test void testAddException() { CityList cityList = mockCityList(); diff --git a/build.gradle b/build.gradle index 5509623a..aec661f6 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:3.5.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files