History log of /external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c6428e1bcddf0c04ed9f58bf6c89a33d70f75a95 07-Jun-2017 Andreas Gampe <agampe@google.com> Vogar: Remove Android Sampling Profiler support

The sampling profiler has been unmaintained and untested, and will
be removed.

Bug: 37272346
Test: m
Test: Device boots
Test: art/tools/run-libcore-tests.sh
Test: java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar org.junit.runner.JUnitCore vogar.AllTests
Change-Id: I64d77244b5816ef1f605d19530b96be38f5c1bc6
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
654f21617c60f23069912900a1e1ef11e9e1c742 24-Mar-2016 Paul Duffin <paulduffin@google.com> Use JUnit classes for running JUnit4 tests

Removes the custom code for handling JUnit4 classes and switches
to use standard JUnit classes, albeit heavily customised.

A couple of changes to the tests:
* TestRunnerJUnit4Test#testRunner_SuiteTest
The order is different from previous version of Vogar as that
sorted a flattened list but JUnit has it organized as a
hierarchy and sorts each parent's children separately so tests
which have a different parent like SimpleTest2 and SimpleTest3
are not sorted relative to each other.
* TestRunnerJUnit4Test#testRunner_AnnotatedMethodsTest
Added test because Vogar can now handle the annotations
@BeforeClass/AfterClass. It could not do that previously
because it had a flat list rather than grouping tests by
class.
* MockitoFieldTest
Added @RunWith(MockitoJUnitRunner.class) to replace the
reflective call to MockitoAnnotations.initMocks(Object) that
was previously done for all JUnit 4 tests. Presumably, Vogar
did that because it only had a partial implementation of JUnit
4 test running infrastructure and so could not support the
@RunWith mechanism.

The removal of the implicit reflective call to
MockitoAnnotations.initMocks(Object) does change the behavior
but was removed anyway because:
* There do not appear to be any tests that depend on it, at
least not in aosp/master.
* There are not many JUnit 4 tests because Vogar does not
support it very well.
* Vogar is primarily for Android developers and most of the
tests that they run they write will also be part of CTS which
requires that they do something in the test to initialize the
@Mock annotated fields, e.g. use
@RunWith(MockitoJUnitRunner.class) or explicitly call
MockitoAnnotations.initMocks(this).
* Given that Vogar now supports standard JUnit 4 it is easy to
fix any broken tests.
* It's not particularly helpful.

Testing: Build vogar-tests and run them,
run art/tools/run-libcore-tests.sh

Bug: 27940141
Change-Id: I9fd993395b52620162176a4d4c5930ded746857c
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
32c7fa74f2fcf54546eb6b1165bda1ae548cad46 24-Mar-2016 Paul Duffin <paulduffin@google.com> Separate JUnit3 and JUnit4 processing in VogarTestRunnerBuilder

Allows the code for each of the different styles of tests to be
switched from custom to more standard JUnit independently of
each other.

Adds a VogarRunnerBuilder that has a list of RunnerBuilders to
which it delegates the work. Adds two instances of
VogarTestRunnerBuilder, one for handling JUnit3 based classes,
one for handling JUnit4 based classes.

Testing: Build vogar-tests and run them,
run art/tools/run-libcore-tests.sh

Bug: 27940141
Change-Id: I2fb15928679bb1868b2919b8b27851507749ae1b
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
0ac5f70e1c316fc5efbb4b2b8fff513cf764bbcf 24-Mar-2016 Paul Duffin <paulduffin@google.com> Build VogarTestRunner via RunnerBuilders rather than directly.

A step on the path to using standard JUnit (with customizations)
to run the tests.

Moves code for creating VogarTest instances from
JUnitRunnerFactory to VogarTestRunnerBuilder which is an
instance of JUnit's RunnerBuilder. That is the appropriate
place for code that creates Runner instances.

Also adds RunnerParams which encapsulates additional information
that needs to be passed to the Runner/RunnerBuilder instances.
This is similar in function to the AndroidRunnerParams used by
AndroidJUnitRunner (AJUR) and associated classes.

Testing: Build vogar-tests and run them,
run art/tools/run-libcore-tests.sh

Bug: 27940141
Change-Id: I13d8964baa70794e6dfdd02d457db02889e1a1c8
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
ee1c2863e09fa1466cf433c40d9bc9e3ca19a2f0 20-Mar-2016 Paul Duffin <paulduffin@google.com> Move calls to TestEnvironment into a separate RunListener

Splits functionality for resetting environment state out of
VogarTestRunner into a separate TestEnvironmentRunListener. An
instance of that is registered with JUnitCore. It relies on the
standard JUnit mechanisms for firing events to registered
RunListener instances.

Bug: 27940141
Change-Id: I0db00fe5ee8632a5f8bb16dc7b7b57bbf0138d6c
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
3ed10ee37a1124bae08ad232c0872066f53f1eb3 20-Mar-2016 Paul Duffin <paulduffin@google.com> Move calls to Profiler into separate RunListener

Splits functionality for starting and stopping the Profiler out
from VogarTestRunner into a separate ProfilerRunListener. An
instance of that is optionally registered with JUnitCore if
profiling is requested and supported. It relies on the standard
JUnit mechanisms for firing events to registered RunListener
instances.

Bug: 27940141
Change-Id: I8e4d02d2029ddcb6f209156bdf6e4409a12cb8bf
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
2ab855c05383a0672e86b9d32607ad2742f7968b 20-Mar-2016 Paul Duffin <paulduffin@google.com> Move calls to TargetMonitor into separate RunListener

The VogarTestRunner used to catch an exception thrown by a test and
print it to System.out which was redirected to send the response to the
host process, followed by notifying the TargetMonitor that the test
failed. This splits that functionality into a number of different parts.
1) VogarTestRunner throws the exception thrown by the test (run on a
separate Thread to support timeouts).
2) The standard ParentRunner.runLeaf(...) method (called from
VogarTestRunner) catches the exception that is thrown and fires a test
failure event.
3) The TargetMonitorRunListener prints the stack trace and notifies the
TargetMonitor in the event of a test failure/success.

While the functionality has been moved about it does not change the
behavior of Vogar as a whole.

Bug: 27940141
Change-Id: Ib704665afa86905aa6ce965c59019788699b5d1b
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
6ab5e4784b9a66792f2cad34afaf8752220315f0 20-Mar-2016 Paul Duffin <paulduffin@google.com> Use JUnitCore to run a list of VogarTest instances

Moved functionality for running tests with a timeout into
VogarTestRunner and added VmIsUnstableException which extends
StoppedByUserException and is used to abort the test run when a
test times out and so leaves the VM in an unstable state.

Bug: 27940141
Change-Id: I99f4c44eaf9c8e4303bdd4def5bd287bf7bdafdb
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
618a14cb2704b0f35c29a355a856c1eacb53311b 20-Mar-2016 Paul Duffin <paulduffin@google.com> Use JUnit Filter to support the skip past mechanism

Bug: 27940141
Change-Id: Id179826d041c908b462ea3e23311f0f96a29c93c
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java
e1dc67ee55248b80aed08bf592f246d0c0728bb1 19-Mar-2016 Paul Duffin <paulduffin@google.com> Rename Runner to TargetRunner

This is in preparation for switching over to using standard
junit. JUnit has its own Runner class that does something
reasonably similar but not the same so this should avoid
confusion while making the switch over. Eventually, the
TargetRunner classes will be replaced with ones based off JUnit.

Bug: 27940141
Change-Id: I3327ff2fb0947bf22038a8db1603daa8420b78ee
/external/vogar/src/vogar/target/junit/JUnitTargetRunner.java