From 8656d00fd514333be84f7842ec6328b1b686b5d9 Mon Sep 17 00:00:00 2001 From: Melisse Doroteo <33183156+melissed99@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:57:38 -0600 Subject: [PATCH 1/3] create config file --- .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 414fa081199c48432f15ae12bdc8b278d2b2b750 Mon Sep 17 00:00:00 2001 From: Melisse Doroteo <33183156+melissed99@users.noreply.github.com> Date: Thu, 31 Oct 2019 09:43:20 -0600 Subject: [PATCH 2/3] add test --- .../example/simpleparadox/listycity/CityList.java | 12 ------------ 1 file changed, 12 deletions(-) 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..513b89e1 100644 --- a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java +++ b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java @@ -10,18 +10,6 @@ public class CityList { private List cities = new ArrayList<>(); - /** - * This adds a city to the list if the city does not exist - * @param city - * This is a candidate city to add - */ - public void add(City city) { - if (hasCity(city)) { - throw new IllegalArgumentException(); - } - cities.add(city); - } - /** * This returns a sorted list of cities * @return From 8830f653f7e6ae6e7c30b6e8f5c29b18265c8a50 Mon Sep 17 00:00:00 2001 From: Melisse Doroteo <33183156+melissed99@users.noreply.github.com> Date: Thu, 31 Oct 2019 09:55:40 -0600 Subject: [PATCH 3/3] fix error --- .../example/simpleparadox/listycity/CityList.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 513b89e1..ce93521a 100644 --- a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java +++ b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java @@ -9,6 +9,18 @@ */ public class CityList { private List cities = new ArrayList<>(); + + /** + * This adds a city to the list if the city does not exist + * @param city + * This is a candidate city to add + */ + public void add(City city) { + if (hasCity(city)) { + throw new IllegalArgumentException(); + } + cities.add(city); + } /** * This returns a sorted list of cities