Skip to content

Commit

Permalink
WIP: tests for issue #25
Browse files Browse the repository at this point in the history
Requires Android SDK at ANDROID_HOME.
The version used was android-studio-bundle-135.1245622-windows.
Contains lots of hacks in getting the tests to compile in Maven.
  • Loading branch information
luontola committed Jul 24, 2014
1 parent 374c4f2 commit b7faea6
Show file tree
Hide file tree
Showing 19 changed files with 532 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__com_android_platform_19.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__com_android_support_support_v4_19_0_1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__commons_lang_commons_lang_2_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions android-tests-helper/android-tests-helper.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.android.support:support-v4:19.0.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.9.5" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.0" level="project" />
</component>
</module>

124 changes: 124 additions & 0 deletions android-tests-helper/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.orfjackal.retrolambda</groupId>
<artifactId>parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<artifactId>android-tests-helper</artifactId>
<packaging>jar</packaging>

<dependencies>

<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services</artifactId>
<version>${android.play-services.version}</version>
<type>aar</type>
<scope>provided</scope>
</dependency>

<!-- <dependency>
<groupId>com.android</groupId>
<artifactId>platform</artifactId>
<version>${android.platform.version}</version>
<scope>system</scope>
<systemPath>${env.ANDROID_HOME}/platforms/android-${android.platform.version}/android.jar</systemPath>
</dependency>-->

</dependencies>

<repositories>
<repository>
<id>android</id>
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
</repository>
<repository>
<id>android-google</id>
<url>file://${env.ANDROID_HOME}/extras/google/m2repository</url>
</repository>
</repositories>

<build>
<plugins>

<!-- Don't deploy the tests to Maven Central -->

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<!-- Extract jar-in-jar dependencies for our tests from the Android SDK -->

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-android-aar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeTypes>aar</includeTypes>
<outputDirectory>${project.build.directory}/android</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>unpack-android-aar</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<unzip src="${project.build.directory}/android/play-services.aar"
dest="${project.build.directory}/android/play-services/"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>


<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>install-android-jars</id>
<phase>generate-sources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services</artifactId>
<version>${android.play-services.version}</version>
<classifier>classes</classifier>
<packaging>jar</packaging>
<file>${project.build.directory}/android/play-services/classes.jar</file>
<!--<generatePom>true</generatePom>-->
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>
5 changes: 5 additions & 0 deletions end-to-end-tests/end-to-end-tests.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.google.guava:guava:11.0.2" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="module" module-name="android-tests-helper" scope="TEST" />
<orderEntry type="library" scope="TEST" name="Maven: com.android.support:support-v4:19.0.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.google.android.gms:play-services:classes:4.4.52" level="project" />
<orderEntry type="library" name="Maven: com.android:platform:19" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
Expand Down
101 changes: 101 additions & 0 deletions end-to-end-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,57 @@
<version>11.0.2</version>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>android-tests-helper</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services</artifactId>
<version>${android.play-services.version}</version>
<type>aar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services</artifactId>
<version>${android.play-services.version}</version>
<type>jar</type>
<classifier>classes</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.android</groupId>
<artifactId>platform</artifactId>
<version>${android.platform.version}</version>
<scope>system</scope>
<systemPath>${env.ANDROID_HOME}/platforms/android-${android.platform.version}/android.jar</systemPath>
</dependency>

</dependencies>

<repositories>
<repository>
<id>android</id>
<url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
</repository>
<repository>
<id>android-google</id>
<url>file://${env.ANDROID_HOME}/extras/google/m2repository</url>
</repository>
</repositories>

<build>
<plugins>

Expand Down Expand Up @@ -58,6 +107,7 @@
</plugin>

<!-- Process our byte codes to make them run on Java 7 -->

<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
<artifactId>retrolambda-maven-plugin</artifactId>
Expand All @@ -75,6 +125,57 @@
</configuration>
</plugin>

<!-- Extract jar-in-jar dependencies for our tests from the Android SDK -->
<!--
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-android-aar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeTypes>aar</includeTypes>
<outputDirectory>${project.build.directory}/android</outputDirectory>
<stripVersion>true</stripVersion>
&lt;!&ndash;
<artifactItems>
<artifactItem>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services</artifactId>
<version>5.0.77</version>
<type>aar</type>
<outputDirectory>${project.build.directory}/android</outputDirectory>
<destFileName>play-services.zip</destFileName>
</artifactItem>
</artifactItems>
&ndash;&gt;
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>unpack-android-aar</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<unzip src="${project.build.directory}/android/play-services.aar"
dest="${project.build.directory}/android/play-services/"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>-->

</plugins>
</build>

Expand Down
Loading

0 comments on commit b7faea6

Please sign in to comment.