aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/runner/Result.java
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-02-24 18:09:21 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-24 18:09:21 +0000
commit23e304a839c5924c7ac7399076318adc511e9985 (patch)
tree81124de095a6b4a53b223d0f70cadde9744ee44a /src/main/java/org/junit/runner/Result.java
parentd8911c6e959a1bda9b2b77d9aa0d35eea7a401f9 (diff)
parent565f36d28118dce0c0a08fe71924dcd25e039022 (diff)
downloadjunit-23e304a839c5924c7ac7399076318adc511e9985.tar.gz
Merge changes from topic "revert-1601635-AIQYZOHWTP" am: 565f36d281
Original change: https://android-review.googlesource.com/c/platform/external/junit/+/1605377 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1b6b1c8147b46e6c2a0ebd81a22edbb370082ded
Diffstat (limited to 'src/main/java/org/junit/runner/Result.java')
-rw-r--r--src/main/java/org/junit/runner/Result.java31
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();
}