Skip to content

Commit

Permalink
Merge pull request #10 from NerdCats/GFETCH-79
Browse files Browse the repository at this point in the history
Travis CI build successful
  • Loading branch information
tonmoy71 committed Apr 21, 2016
2 parents af16cef + 7e8cf40 commit 8499d45
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
sudo: false
language: android
android:
components:
- tools
- platform-tools

# The BuildTools version used by your project
- build-tools-23.0.3

# The SDK version used to compile your project
- android-23

# Additional components
- extra-google-google_play_services
- extra-android-m2repository
- extra-google-m2repository
- extra-android-support


# Specify at least one system image,
# if you need to run emulator(s) during your tests
# - sys-img-armeabi-v7a-android-21
- sys-img-armeabi-v7a-android-23

env:
global:
# install timeout in minutes (2 minutes by default)
- ADB_INSTALL_TIMEOUT=8


# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window -gpu off -no-boot-anim &
- android-wait-for-emulator
- adb devices
- adb shell input keyevent 82 &

before_install:
- chmod +x gradlew

script:
- echo $ADB_INSTALL_TIMEOUT
- android list target
- ./gradlew build connectedCheck
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}
}

dependencies {
Expand Down
42 changes: 42 additions & 0 deletions app/src/main/java/co/gobd/gofetch/activity/RideActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package co.gobd.gofetch.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import co.gobd.gofetch.R;
import co.gobd.gofetch.ui.fragment.RideFragmentCallback;
import co.gobd.gofetch.ui.fragment.RoutePlanFragment;


public class RideActivity extends AppCompatActivity implements RideFragmentCallback {

private static final String TAG = "RideActivity";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ride);

startRoutePlanFragment();
}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}

// Fragment callback implementation
@Override
public void loadConfirmationFragment(Bundle bundle) {
Log.i(TAG, bundle.toString());
}


private void startRoutePlanFragment() {
RoutePlanFragment routePlanFragment = new RoutePlanFragment();
getSupportFragmentManager().beginTransaction()
.replace(R.id.layout_ride_activity, routePlanFragment)
.commit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.os.Bundle;

import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
Expand All @@ -24,7 +24,8 @@
import co.gobd.gofetch.presenter.RoutePlanPresenter;
import co.gobd.gofetch.ui.view.RoutePlanView;

import static co.gobd.gofetch.utility.Constant.*;
import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_DESTINATION_POINT;
import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_STARTING_POINT;

public class RoutePlanFragment extends Fragment implements RoutePlanView {

Expand Down Expand Up @@ -65,6 +66,7 @@ public class RoutePlanFragment extends Fragment implements RoutePlanView {
/* Callback to update activity */
private RideFragmentCallback callback;


public RoutePlanFragment() {
//Empty constructor for fragment initialization
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void setUp() throws Exception {
@Test
public void showErrorWhenStartingPointEmpty() throws Exception {
when(view.getStartingPointAddress()).thenReturn("");
when(view.getDestinationAddress()).thenReturn("Shyamoli");
presenter.onButtonClick();

verify(view).showErrorOnEmptyAddress(LocationType.STARTING_POINT);
Expand Down

0 comments on commit 8499d45

Please sign in to comment.