diff options
author | David Srbecky <dsrbecky@google.com> | 2021-02-24 21:20:54 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-24 21:20:54 +0000 |
commit | 138b64feb682b90292d36002f3aff9869d6a9e4b (patch) | |
tree | fb060599e56a1ce3ccfa4cacd193406f14ba84db /src/main/java/org/junit/runner/Result.java | |
parent | 99022df227f5503b68838d97e0a6b3fa5f558f1b (diff) | |
parent | 91c5e5ff9d71ebc00818b310c09b175016c36dc2 (diff) | |
download | junit-138b64feb682b90292d36002f3aff9869d6a9e4b.tar.gz |
Merge changes from topic "revert-1601635-AIQYZOHWTP" am: 565f36d281 am: 23e304a839 am: 91c5e5ff9d
Original change: https://android-review.googlesource.com/c/platform/external/junit/+/1605377
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Iaa51f5a85f96ec87a01eff9bc98e2274fc5a97dd
Diffstat (limited to 'src/main/java/org/junit/runner/Result.java')
-rw-r--r-- | src/main/java/org/junit/runner/Result.java | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/main/java/org/junit/runner/Result.java b/src/main/java/org/junit/runner/Result.java index 4b5f4a4..73ad059 100644 --- a/src/main/java/org/junit/runner/Result.java +++ b/src/main/java/org/junit/runner/Result.java @@ -28,7 +28,6 @@ public class Result implements Serializable { ObjectStreamClass.lookup(SerializedForm.class).getFields(); private final AtomicInteger count; private final AtomicInteger ignoreCount; - private final AtomicInteger assumptionFailureCount; private final CopyOnWriteArrayList<Failure> failures; private final AtomicLong runTime; private final AtomicLong startTime; @@ -39,7 +38,6 @@ public class Result implements Serializable { public Result() { count = new AtomicInteger(); ignoreCount = new AtomicInteger(); - assumptionFailureCount = new AtomicInteger(); failures = new CopyOnWriteArrayList<Failure>(); runTime = new AtomicLong(); startTime = new AtomicLong(); @@ -48,35 +46,34 @@ public class Result implements Serializable { private Result(SerializedForm serializedForm) { count = serializedForm.fCount; ignoreCount = serializedForm.fIgnoreCount; - assumptionFailureCount = serializedForm.assumptionFailureCount; failures = new CopyOnWriteArrayList<Failure>(serializedForm.fFailures); runTime = new AtomicLong(serializedForm.fRunTime); startTime = new AtomicLong(serializedForm.fStartTime); } /** - * Returns the number of tests run + * @return the number of tests run */ public int getRunCount() { return count.get(); } /** - * Returns the number of tests that failed during the run + * @return the number of tests that failed during the run */ public int getFailureCount() { return failures.size(); } /** - * Returns the number of milliseconds it took to run the entire suite to run + * @return the number of milliseconds it took to run the entire suite to run */ public long getRunTime() { return runTime.get(); } /** - * Returns the {@link Failure}s describing tests that failed and the problems they encountered + * @return the {@link Failure}s describing tests that failed and the problems they encountered */ public List<Failure> getFailures() { return failures; @@ -90,20 +87,6 @@ public class Result implements Serializable { } /** - * Returns the number of tests skipped because of an assumption failure - * - * @throws UnsupportedOperationException if the result was serialized in a version before JUnit 4.13 - * @since 4.13 - */ - public int getAssumptionFailureCount() { - if (assumptionFailureCount == null) { - throw new UnsupportedOperationException( - "Result was serialized from a version of JUnit that doesn't support this method"); - } - return assumptionFailureCount.get(); - } - - /** * @return <code>true</code> if all tests succeeded */ public boolean wasSuccessful() { @@ -154,7 +137,7 @@ public class Result implements Serializable { @Override public void testAssumptionFailure(Failure failure) { - assumptionFailureCount.getAndIncrement(); + // do nothing: same as passing (for 4.5; may change in 4.6) } } @@ -173,7 +156,6 @@ public class Result implements Serializable { private static final long serialVersionUID = 1L; private final AtomicInteger fCount; private final AtomicInteger fIgnoreCount; - private final AtomicInteger assumptionFailureCount; private final List<Failure> fFailures; private final long fRunTime; private final long fStartTime; @@ -181,7 +163,6 @@ public class Result implements Serializable { public SerializedForm(Result result) { fCount = result.count; fIgnoreCount = result.ignoreCount; - assumptionFailureCount = result.assumptionFailureCount; fFailures = Collections.synchronizedList(new ArrayList<Failure>(result.failures)); fRunTime = result.runTime.longValue(); fStartTime = result.startTime.longValue(); @@ -191,7 +172,6 @@ public class Result implements Serializable { private SerializedForm(ObjectInputStream.GetField fields) throws IOException { fCount = (AtomicInteger) fields.get("fCount", null); fIgnoreCount = (AtomicInteger) fields.get("fIgnoreCount", null); - assumptionFailureCount = (AtomicInteger) fields.get("assumptionFailureCount", null); fFailures = (List<Failure>) fields.get("fFailures", null); fRunTime = fields.get("fRunTime", 0L); fStartTime = fields.get("fStartTime", 0L); @@ -204,7 +184,6 @@ public class Result implements Serializable { fields.put("fFailures", fFailures); fields.put("fRunTime", fRunTime); fields.put("fStartTime", fStartTime); - fields.put("assumptionFailureCount", assumptionFailureCount); s.writeFields(); } |