jvmtesttools

Some basic Java reflection tools for testing

License

License

GroupId

GroupId

com.fsryan.testtools.jvm
ArtifactId

ArtifactId

jvmtesttools
Last Version

Last Version

0.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

jvmtesttools
Some basic Java reflection tools for testing
Project URL

Project URL

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

Source Code Management

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

Download jvmtesttools

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

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