// Path: app/src/main/java/app/presentation/foundation/BaseApp.java
// public class BaseApp extends Application {
//     private PresentationComponent presentationComponent;
//     private GoogleAnalytics analytics;
//     private Tracker tracker;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         initInject();
//         AppCare.YesSir.takeCareOn(this);
//         initGcm();
//         initGoogleAnalytics();
//     }
// 
//     private void initInject() {
//         presentationComponent = DaggerPresentationComponent.builder()
//                 .presentationModule(new PresentationModule(this))
//                 .build();
//     }
// 
//     private void initGcm() {
//         RxGcm.Notifications.register(this, GcmMessageReceiver.class, GcmReceiverBackground.class)
//                 .subscribe(token -> {}, error -> {});
// 
//         RxGcm.Notifications.onRefreshToken(GcmTokenReceiver.class);
//     }
// 
//     private void initGoogleAnalytics() {
//         analytics = GoogleAnalytics.getInstance(this);
// 
//         if(BuildConfig.DEBUG) {
//             // true = for log output, it does not sent data to Google Analytics
//             analytics.setDryRun(true);
//             // To enable debug logging on a device run:
//             // adb shell setprop log.tag.GAv4 DEBUG
//             // adb logcat -s GAv4
//             // true = disable google analytics on the app
// //        analytics.setAppOptOut(true);
//         }
// 
//         tracker = analytics.newTracker(getString(R.string.ga_trackingId));
//         tracker.enableExceptionReporting(true);
//         tracker.enableAdvertisingIdCollection(true);
//         tracker.enableAutoActivityTracking(false);
//     }
// 
//     public Tracker getTracker() {
//         return tracker;
//     }
// 
//     public PresentationComponent getPresentationComponent() {
//         return presentationComponent;
//     }
// 
//     @Nullable public BaseActivity getLiveActivity(){
//         return (BaseActivity) AppCare.YesSir.getLiveActivityOrNull();
//     }
// }
// 
// Path: app/src/main/java/app/presentation/sections/launch/LaunchActivity.java
// public class LaunchActivity extends BaseActivity {
//     @Inject GoogleAnalyticsSender googleAnalytics;
// 
//     @Override protected void injectDagger() {
//         getApplicationComponent().inject(this);
//     }
// 
//     @Override protected void initViews() {
//         super.initViews();
//         wireframe.dashboard();
//         googleAnalytics.send(this.getClass().getSimpleName());
//     }
// }


import android.app.Activity;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
import org.junit.runner.RunWith;
import app.presentation.foundation.BaseApp;
import app.presentation.sections.launch.LaunchActivity;
/*
 * Copyright 2016 FuckBoilerplate
 *
 * 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 app.common;





@RunWith(AndroidJUnit4.class)
public abstract class BaseTest {
    public static final long SHORT_WAIT = 1000;
    public static final long MEDIUM_WAIT = 2500;
    public static final long LONG_WAIT = 5000;

    public static void shortWait() {
        waitTime(SHORT_WAIT);
    }

    public static void mediumWait() {
        waitTime(MEDIUM_WAIT);
    }

    public static void longWait() {
        waitTime(LONG_WAIT);
    }

    private static void waitTime(long time) {
        try {Thread.sleep(time);
        } catch (InterruptedException e) { e.printStackTrace();}
    }

// Path: app/src/main/java/app/presentation/foundation/BaseApp.java
// public class BaseApp extends Application {
//     private PresentationComponent presentationComponent;
//     private GoogleAnalytics analytics;
//     private Tracker tracker;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         initInject();
//         AppCare.YesSir.takeCareOn(this);
//         initGcm();
//         initGoogleAnalytics();
//     }
// 
//     private void initInject() {
//         presentationComponent = DaggerPresentationComponent.builder()
//                 .presentationModule(new PresentationModule(this))
//                 .build();
//     }
// 
//     private void initGcm() {
//         RxGcm.Notifications.register(this, GcmMessageReceiver.class, GcmReceiverBackground.class)
//                 .subscribe(token -> {}, error -> {});
// 
//         RxGcm.Notifications.onRefreshToken(GcmTokenReceiver.class);
//     }
// 
//     private void initGoogleAnalytics() {
//         analytics = GoogleAnalytics.getInstance(this);
// 
//         if(BuildConfig.DEBUG) {
//             // true = for log output, it does not sent data to Google Analytics
//             analytics.setDryRun(true);
//             // To enable debug logging on a device run:
//             // adb shell setprop log.tag.GAv4 DEBUG
//             // adb logcat -s GAv4
//             // true = disable google analytics on the app
// //        analytics.setAppOptOut(true);
//         }
// 
//         tracker = analytics.newTracker(getString(R.string.ga_trackingId));
//         tracker.enableExceptionReporting(true);
//         tracker.enableAdvertisingIdCollection(true);
//         tracker.enableAutoActivityTracking(false);
//     }
// 
//     public Tracker getTracker() {
//         return tracker;
//     }
// 
//     public PresentationComponent getPresentationComponent() {
//         return presentationComponent;
//     }
// 
//     @Nullable public BaseActivity getLiveActivity(){
//         return (BaseActivity) AppCare.YesSir.getLiveActivityOrNull();
//     }
// }
// 
// Path: app/src/main/java/app/presentation/sections/launch/LaunchActivity.java
// public class LaunchActivity extends BaseActivity {
//     @Inject GoogleAnalyticsSender googleAnalytics;
// 
//     @Override protected void injectDagger() {
//         getApplicationComponent().inject(this);
//     }
// 
//     @Override protected void initViews() {
//         super.initViews();
//         wireframe.dashboard();
//         googleAnalytics.send(this.getClass().getSimpleName());
//     }
// }


// Path: app/src/androidTest/java/app/common/BaseTest.java
import android.app.Activity;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
import org.junit.runner.RunWith;
import app.presentation.foundation.BaseApp;
import app.presentation.sections.launch.LaunchActivity;

/*
 * Copyright 2016 FuckBoilerplate
 *
 * 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 app.common;





@RunWith(AndroidJUnit4.class)
public abstract class BaseTest {
    public static final long SHORT_WAIT = 1000;
    public static final long MEDIUM_WAIT = 2500;
    public static final long LONG_WAIT = 5000;

    public static void shortWait() {
        waitTime(SHORT_WAIT);
    }

    public static void mediumWait() {
        waitTime(MEDIUM_WAIT);
    }

    public static void longWait() {
        waitTime(LONG_WAIT);
    }

    private static void waitTime(long time) {
        try {Thread.sleep(time);
        } catch (InterruptedException e) { e.printStackTrace();}
    }

    @Rule public ActivityTestRule<LaunchActivity> mActivityRule = new ActivityTestRule<>(LaunchActivity.class);