File tree Expand file tree Collapse file tree 4 files changed +497
-0
lines changed
src/test/java/net/rdrei/android/absshadow/test Expand file tree Collapse file tree 4 files changed +497
-0
lines changed Original file line number Diff line number Diff line change 4040 <version >1.1-SNAPSHOT</version >
4141 <scope >test</scope >
4242 </dependency >
43+ <dependency >
44+ <groupId >junit</groupId >
45+ <artifactId >junit</artifactId >
46+ <version >4.9</version >
47+ <scope >test</scope >
48+ </dependency >
4349 <dependency >
4450 <groupId >com.actionbarsherlock</groupId >
4551 <artifactId >library</artifactId >
Original file line number Diff line number Diff line change 1+ package net .rdrei .android .absshadow .test ;
2+
3+ import org .junit .runners .model .InitializationError ;
4+
5+ import com .xtremelabs .robolectric .Robolectric ;
6+ import com .xtremelabs .robolectric .RobolectricTestRunner ;
7+ import net .rdrei .android .absshadow .test .shadow .ShadowFragmentActivity ;
8+
9+ public class CustomTestRunner extends RobolectricTestRunner {
10+
11+ public CustomTestRunner (Class <?> testClass ) throws InitializationError {
12+ super (testClass );
13+ }
14+
15+ @ Override
16+ protected void bindShadowClasses () {
17+ super .bindShadowClasses ();
18+ Robolectric .bindShadowClass (ShadowFragmentActivity .class );
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ package net .rdrei .android .absshadow .test ;
2+
3+ import net .rdrei .android .absshadow .MainActivity ;
4+ import org .junit .runner .RunWith ;
5+ import org .junit .Test ;
6+
7+ @ RunWith (CustomTestRunner .class )
8+ public class MainActivityTest {
9+
10+ @ Test
11+ public void initialize () {
12+ MainActivity activity = new MainActivity ();
13+ activity .onCreate (null );
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments