// Path: lib/src/main/java/com/mindbodyonline/ironhide/Fixture/BaseInstrumentTestCase.java
// @RunWith(AndroidJUnit4.class)
// public class BaseInstrumentTestCase<T extends Activity> extends ActivityInstrumentationTestCase2<T> {
// 
//     protected T initActivity;
// 
//     /**
//      * @see ActivityInstrumentationTestCase2#ActivityInstrumentationTestCase2(Class)
//      */
//     public BaseInstrumentTestCase(Class<T> activityClass) {
//         super(activityClass);
//     }
// 
//     /**
//      * {@inheritDoc}
//      * The default setup for AndroidJUnit tests.
//      * If overrode, include the @Before tag.
//      */
//     @Override
//     @Before
//     public void setUp() throws Exception {
//         injectInstrumentation(InstrumentationRegistry.getInstrumentation());
//         initActivity = getActivity();
//         setFailureHandler(new BaseFailureHandler(this));
//     }
// 
//     /**
//      *  {@inheritDoc}
//      * The default tear down for AndroidJUnit tests.
//      * If overrode, include the @After tag.
//      */
//     @Override
//     @After
//     public void tearDown() throws Exception {
//         super.tearDown();
//     }
//     
//     /** @see android.support.test.espresso.Espresso#setFailureHandler(android.support.test.espresso.FailureHandler) */
//     protected void onFailure(FailureHandler delegate, Throwable error, Matcher<View> viewMatcher) {
//         delegate.handle(error, viewMatcher);
//     }
// 
//     /**
//      * A failure handler that calls {@link BaseInstrumentTestCase#onFailure(FailureHandler, Throwable, Matcher)}
//      *  so that failures can be more easily handled. Does not prevent use of ones own FailureHandler
//      *  to handle errors as seen fit.  
//      */
//     private static class BaseFailureHandler implements FailureHandler {
//         private final FailureHandler delegate;
//         private final BaseInstrumentTestCase fixture;
// 
//         public BaseFailureHandler(BaseInstrumentTestCase fixture) {
//             this.fixture = fixture;
//             this.delegate = new DefaultFailureHandler(fixture.getInstrumentation().getTargetContext());
//         }
// 
//         @Override
//         public void handle(Throwable error, Matcher<View> viewMatcher) {
//             fixture.onFailure(delegate, error, viewMatcher);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/mindbodyonline/ironhidetestapp/DisplayActivity.java
// public class DisplayActivity extends Activity {
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.display_activity);
//         TextView textView = (TextView) findViewById(R.id.display_data);
//         textView.setText(getIntent().getStringExtra(SendActivity.EXTRA_DATA));
//     }
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/models/DisplayModel.java
// public class DisplayModel extends PageObject {
//     public Clickable<DisplayModel> displayText = new Clickable<>(DisplayModel.class, R.id.display_data);
// }


import android.content.Intent;
import android.test.suitebuilder.annotation.LargeTest;
import com.mindbodyonline.ironhide.Fixture.BaseInstrumentTestCase;
import com.mindbodyonline.ironhidetestapp.DisplayActivity;
import com.mindbodyonline.ironhidetestapp.models.DisplayModel;
import org.junit.Test;
package com.mindbodyonline.ironhidetestapp.tests;




/**
 * Demonstrates the usage of
 * {@link android.test.ActivityInstrumentationTestCase2#setActivityIntent(android.content.Intent)}
 */
@LargeTest
public class InjectActivityTest extends BaseInstrumentTestCase<DisplayActivity> {
    private static final String INJECTED_TEXT = "this is my cool injection text string";

    public InjectActivityTest() {
        super(DisplayActivity.class);
    }

    @Override
    public void setUp() throws Exception {
        Intent toStart = new Intent(Intent.ACTION_MAIN);

        toStart.putExtra("com.mindbodyonline.ironhidetestapp.DATA" /* aka. SendActivity.EXTRA_DATA*/, INJECTED_TEXT);
        setActivityIntent(toStart);

        // call this after so that we can start the activity with the intent we want
        super.setUp();
    }

    @Test
    public void testInjectedText() {
// Path: lib/src/main/java/com/mindbodyonline/ironhide/Fixture/BaseInstrumentTestCase.java
// @RunWith(AndroidJUnit4.class)
// public class BaseInstrumentTestCase<T extends Activity> extends ActivityInstrumentationTestCase2<T> {
// 
//     protected T initActivity;
// 
//     /**
//      * @see ActivityInstrumentationTestCase2#ActivityInstrumentationTestCase2(Class)
//      */
//     public BaseInstrumentTestCase(Class<T> activityClass) {
//         super(activityClass);
//     }
// 
//     /**
//      * {@inheritDoc}
//      * The default setup for AndroidJUnit tests.
//      * If overrode, include the @Before tag.
//      */
//     @Override
//     @Before
//     public void setUp() throws Exception {
//         injectInstrumentation(InstrumentationRegistry.getInstrumentation());
//         initActivity = getActivity();
//         setFailureHandler(new BaseFailureHandler(this));
//     }
// 
//     /**
//      *  {@inheritDoc}
//      * The default tear down for AndroidJUnit tests.
//      * If overrode, include the @After tag.
//      */
//     @Override
//     @After
//     public void tearDown() throws Exception {
//         super.tearDown();
//     }
//     
//     /** @see android.support.test.espresso.Espresso#setFailureHandler(android.support.test.espresso.FailureHandler) */
//     protected void onFailure(FailureHandler delegate, Throwable error, Matcher<View> viewMatcher) {
//         delegate.handle(error, viewMatcher);
//     }
// 
//     /**
//      * A failure handler that calls {@link BaseInstrumentTestCase#onFailure(FailureHandler, Throwable, Matcher)}
//      *  so that failures can be more easily handled. Does not prevent use of ones own FailureHandler
//      *  to handle errors as seen fit.  
//      */
//     private static class BaseFailureHandler implements FailureHandler {
//         private final FailureHandler delegate;
//         private final BaseInstrumentTestCase fixture;
// 
//         public BaseFailureHandler(BaseInstrumentTestCase fixture) {
//             this.fixture = fixture;
//             this.delegate = new DefaultFailureHandler(fixture.getInstrumentation().getTargetContext());
//         }
// 
//         @Override
//         public void handle(Throwable error, Matcher<View> viewMatcher) {
//             fixture.onFailure(delegate, error, viewMatcher);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/mindbodyonline/ironhidetestapp/DisplayActivity.java
// public class DisplayActivity extends Activity {
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.display_activity);
//         TextView textView = (TextView) findViewById(R.id.display_data);
//         textView.setText(getIntent().getStringExtra(SendActivity.EXTRA_DATA));
//     }
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/models/DisplayModel.java
// public class DisplayModel extends PageObject {
//     public Clickable<DisplayModel> displayText = new Clickable<>(DisplayModel.class, R.id.display_data);
// }


// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/tests/InjectActivityTest.java
import android.content.Intent;
import android.test.suitebuilder.annotation.LargeTest;
import com.mindbodyonline.ironhide.Fixture.BaseInstrumentTestCase;
import com.mindbodyonline.ironhidetestapp.DisplayActivity;
import com.mindbodyonline.ironhidetestapp.models.DisplayModel;
import org.junit.Test;

package com.mindbodyonline.ironhidetestapp.tests;




/**
 * Demonstrates the usage of
 * {@link android.test.ActivityInstrumentationTestCase2#setActivityIntent(android.content.Intent)}
 */
@LargeTest
public class InjectActivityTest extends BaseInstrumentTestCase<DisplayActivity> {
    private static final String INJECTED_TEXT = "this is my cool injection text string";

    public InjectActivityTest() {
        super(DisplayActivity.class);
    }

    @Override
    public void setUp() throws Exception {
        Intent toStart = new Intent(Intent.ACTION_MAIN);

        toStart.putExtra("com.mindbodyonline.ironhidetestapp.DATA" /* aka. SendActivity.EXTRA_DATA*/, INJECTED_TEXT);
        setActivityIntent(toStart);

        // call this after so that we can start the activity with the intent we want
        super.setUp();
    }

    @Test
    public void testInjectedText() {
        new DisplayModel().displayText.withText(INJECTED_TEXT);