Skip to content

Commit 419e810

Browse files
committed
Cleaning things up, trying to use AA but it wouldnt' work
1 parent b30f1c6 commit 419e810

32 files changed

+629
-282
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target
22
bin
33
gen
4+
.apt_generated

cleanandroidcode-it/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<classpath>
33
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
44
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5+
<classpathentry kind="src" path="gen"/>
56
<classpathentry kind="src" output="bin/classes" path="src/main/java">
67
<attributes>
78
<attribute name="maven.pomderived" value="true"/>
@@ -17,6 +18,5 @@
1718
<attribute name="maven.pomderived" value="true"/>
1819
</attributes>
1920
</classpathentry>
20-
<classpathentry kind="src" path="gen"/>
2121
<classpathentry kind="output" path="bin/classes"/>
2222
</classpath>
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="info.piwai.cleanandroidcode.test" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
3+
package="info.piwai.cleanandroidcode.test"
4+
android:versionCode="1"
5+
android:versionName="1.0-SNAPSHOT" >
46

57
<uses-sdk
68
android:minSdkVersion="8"
7-
android:targetSdkVersion="16" />
9+
android:targetSdkVersion="17" />
810

9-
<application android:icon="@drawable/icon" android:label="@string/app_name">
10-
<uses-library android:name="android.test.runner" />
11-
</application>
11+
<application
12+
android:allowBackup="false"
13+
android:icon="@drawable/icon"
14+
android:label="cleanandroidcode-it" >
15+
<uses-library android:name="android.test.runner" />
16+
</application>
1217

13-
<instrumentation android:targetPackage="info.piwai.cleanandroidcode"
14-
android:name="android.test.InstrumentationTestRunner" />
15-
16-
</manifest>
18+
<instrumentation
19+
android:name="android.test.InstrumentationTestRunner"
20+
android:targetPackage="info.piwai.cleanandroidcode" />
1721

22+
</manifest>

cleanandroidcode-it/pom.xml

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
55

6-
<parent>
7-
<groupId>info.piwai.cleanandroidcode</groupId>
8-
<artifactId>cleanandroidcode-parent</artifactId>
9-
<version>1.0-SNAPSHOT</version>
10-
</parent>
6+
<parent>
7+
<groupId>info.piwai.cleanandroidcode</groupId>
8+
<artifactId>cleanandroidcode-parent</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
1111

12-
<artifactId>cleanandroidcode-it</artifactId>
13-
<packaging>apk</packaging>
14-
<name>cleanandroidcode-it - Integration tests</name>
15-
16-
<properties>
17-
<platform.api>16</platform.api>
18-
</properties>
12+
<artifactId>cleanandroidcode-it</artifactId>
13+
<packaging>apk</packaging>
14+
<name>cleanandroidcode-it - Integration tests</name>
1915

20-
<dependencies>
21-
<dependency>
22-
<groupId>com.google.android</groupId>
23-
<artifactId>android</artifactId>
24-
</dependency>
25-
<dependency>
26-
<groupId>com.google.android</groupId>
27-
<artifactId>android-test</artifactId>
28-
</dependency>
29-
<dependency>
30-
<groupId>info.piwai.cleanandroidcode</groupId>
31-
<artifactId>cleanandroidcode</artifactId>
32-
<type>apk</type>
33-
<version>1.0-SNAPSHOT</version>
34-
</dependency>
35-
<dependency>
36-
<groupId>info.piwai.cleanandroidcode</groupId>
37-
<artifactId>cleanandroidcode</artifactId>
38-
<type>jar</type>
39-
<version>1.0-SNAPSHOT</version>
40-
</dependency>
41-
<dependency>
42-
<groupId>junit</groupId>
43-
<artifactId>junit</artifactId>
44-
</dependency>
45-
</dependencies>
46-
<build>
47-
<plugins>
48-
<plugin>
49-
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
50-
<artifactId>android-maven-plugin</artifactId>
51-
<configuration>
52-
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
53-
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
54-
<resourceDirectory>${project.basedir}/res</resourceDirectory>
55-
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
56-
<sdk>
57-
<platform>${platform.api}</platform>
58-
</sdk>
59-
<undeployBeforeDeploy>true</undeployBeforeDeploy>
60-
</configuration>
61-
<extensions>true</extensions>
62-
</plugin>
63-
<plugin>
64-
<artifactId>maven-compiler-plugin</artifactId>
65-
<configuration>
66-
<source>1.6</source>
67-
<target>1.6</target>
68-
</configuration>
69-
</plugin>
70-
</plugins>
71-
</build>
16+
<properties>
17+
<platform.api>16</platform.api>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>com.google.android</groupId>
23+
<artifactId>android</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.google.android</groupId>
27+
<artifactId>android-test</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>info.piwai.cleanandroidcode</groupId>
31+
<artifactId>cleanandroidcode</artifactId>
32+
<type>apk</type>
33+
<version>1.0-SNAPSHOT</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>info.piwai.cleanandroidcode</groupId>
37+
<artifactId>cleanandroidcode</artifactId>
38+
<type>jar</type>
39+
<version>1.0-SNAPSHOT</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>junit</groupId>
43+
<artifactId>junit</artifactId>
44+
</dependency>
45+
</dependencies>
46+
<build>
47+
<plugins>
48+
<plugin>
49+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
50+
<artifactId>android-maven-plugin</artifactId>
51+
<configuration>
52+
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
53+
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
54+
<resourceDirectory>${project.basedir}/res</resourceDirectory>
55+
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
56+
<sdk>
57+
<platform>${platform.api}</platform>
58+
</sdk>
59+
<undeployBeforeDeploy>true</undeployBeforeDeploy>
60+
</configuration>
61+
<extensions>true</extensions>
62+
</plugin>
63+
<plugin>
64+
<artifactId>maven-compiler-plugin</artifactId>
65+
<configuration>
66+
<source>1.6</source>
67+
<target>1.6</target>
68+
</configuration>
69+
</plugin>
70+
</plugins>
71+
</build>
7272
</project>
-1.68 KB
Binary file not shown.
-2.51 KB
Binary file not shown.

cleanandroidcode-it/res/layout/main.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

cleanandroidcode-it/res/values/strings.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package info.piwai.cleanandroidcode;
2+
3+
import android.annotation.SuppressLint;
4+
import android.app.Activity;
5+
import android.test.ActivityInstrumentationTestCase2;
6+
import android.test.UiThreadTest;
7+
8+
/*
9+
* TODO use support fragment
10+
*/
11+
@SuppressLint("NewApi")
12+
public class HelloAndroidActivityTest extends ActivityInstrumentationTestCase2<HelloAndroidActivity_> {
13+
14+
public HelloAndroidActivityTest() {
15+
super(HelloAndroidActivity_.class);
16+
}
17+
18+
public void testActivity() {
19+
HelloAndroidActivity activity = getActivity();
20+
assertNotNull(activity);
21+
}
22+
23+
@UiThreadTest
24+
public void testClickEventPropagated() {
25+
Activity activity = getActivity();
26+
String beforeClick = activity.getTitle().toString();
27+
HelloFragment fragment = (HelloFragment) activity.getFragmentManager().findFragmentById(R.id.hello_fragment);
28+
fragment.fragmentButton.performClick();
29+
String afterClick = activity.getTitle().toString();
30+
assertFalse(beforeClick.equals(afterClick));
31+
fragment.fragmentButton.performClick();
32+
String afterClick2 = activity.getTitle().toString();
33+
assertFalse(afterClick.equals(afterClick2));
34+
}
35+
36+
}

cleanandroidcode-it/src/main/java/info/piwai/cleanandroidcode/test/HelloAndroidActivityTest.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)