andtesttools

Some basic test tools for android

License

License

GroupId

GroupId

com.fsryan.testtools.android
ArtifactId

ArtifactId

andtesttools
Last Version

Last Version

0.0.4
Release Date

Release Date

Type

Type

aar
Description

Description

andtesttools
Some basic test tools for android
Project URL

Project URL

https://github.com/ryansgot/android-testtools
Source Code Management

Source Code Management

https://github.com/ryansgot/android-testtools

Download andtesttools

How to add to project

<!-- https://jarcasting.com/artifacts/com.fsryan.testtools.android/andtesttools/ -->
<dependency>
    <groupId>com.fsryan.testtools.android</groupId>
    <artifactId>andtesttools</artifactId>
    <version>0.0.4</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.fsryan.testtools.android/andtesttools/
implementation 'com.fsryan.testtools.android:andtesttools:0.0.4'
// https://jarcasting.com/artifacts/com.fsryan.testtools.android/andtesttools/
implementation ("com.fsryan.testtools.android:andtesttools:0.0.4")
'com.fsryan.testtools.android:andtesttools:aar:0.0.4'
<dependency org="com.fsryan.testtools.android" name="andtesttools" rev="0.0.4">
  <artifact name="andtesttools" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.fsryan.testtools.android', module='andtesttools', version='0.0.4')
)
libraryDependencies += "com.fsryan.testtools.android" % "andtesttools" % "0.0.4"
[com.fsryan.testtools.android/andtesttools "0.0.4"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk7 jar 1.3.41
androidx.annotation » annotation jar 1.0.0
androidx.multidex » multidex jar 2.0.0
androidx.arch.core » core-testing jar 2.0.0
androidx.test » runner jar 1.2.0

Project Modules

There are no modules declared in this project.

android-testtools

Care has been taken to split code bound to the android platform and code that has no android dependency. Therefore, we have andtesttools and jvmtesttools, for example. When we test, we often test on the JVM, and if we were to add in android dependencies to the mix, we'd tie ourselves down to use of robolectric . . . a brilliant piece of crap that slows down your JVM tests and makes you not want to run them. Projects that use android are free to use the jvm test tools, but not vice-versa. Therefore, to make the tools most useful, you should take put all of the code you can inside of the jvm test tools projects without adding in any android dependency.

What if I want to use tooling from an internal library?

You should not use it here. Instead, that internal library should have a sibling module that exposes its own test tooling. That internal library's test tooling module is free to depend upon these more generic projects, but not vice versa.

What tooling goes here:

Lets start by project breakdown:

  • andtesttools
    • Test tooling that utilizes the android framework (such as getting assets, TelephonyManager, etc). The custom runner that we'll use for library projects is located there.
    • test tooling that utilizes support libraries/androidx/arch
  • espressotools
    • Test tooling that utilizes the android framework--specifically as it relates to espresso for performing verifications on views
  • junit4androidtools
    • Test tooling that utilizes JUnit4 and android framework
  • junit4jvmtools
    • Test tooling that utilizes JUnit4 but does not utilize the android framework. A good example of this is FSTestFilter. This has no android dependency, but it is extended in FSAndroidTestFilter for the version used in android.
  • jvmtesttools
    • Test tooling that only involves the JVM and no other libraries.

Feel free to add more projects as it appeals to you. Some suggestions are:

  1. A gradle plugin that will handle creation of the testing tasks that will filter the tests set, making use of the

How do I use this stuff?

I am building in some sample code in the testtoolsonlibdemo project. That project is an android library that is intended to demonstrate what you can do with the tools that we have. I'll also build out an android application project to show how to use the tools in an application project.

Versions

Version
0.0.4