summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2015-06-22 20:11:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-22 20:11:15 +0000
commite6f7d99dfc52518d5ec9b53f312c0fd62246de6c (patch)
treedebb7555a80be8657ee4142a6c4dfa3531645f2b /libs
parent297d1d6bb7143dc0f78e472a6939275270d5f38b (diff)
parentd16b864e9537e172436bfb8a5de76e9e49fcea35 (diff)
downloadplatform_cts-e6f7d99dfc52518d5ec9b53f312c0fd62246de6c.tar.gz
platform_cts-e6f7d99dfc52518d5ec9b53f312c0fd62246de6c.tar.bz2
platform_cts-e6f7d99dfc52518d5ec9b53f312c0fd62246de6c.zip
Merge "Add support for "large" tagged tests to have non-default timeout" into mnc-dev
Diffstat (limited to 'libs')
-rw-r--r--libs/vogar-expect/src/vogar/Expectation.java9
-rw-r--r--libs/vogar-expect/src/vogar/ExpectationStore.java17
2 files changed, 14 insertions, 12 deletions
diff --git a/libs/vogar-expect/src/vogar/Expectation.java b/libs/vogar-expect/src/vogar/Expectation.java
index f065f42167d..ddbc233f7f3 100644
--- a/libs/vogar-expect/src/vogar/Expectation.java
+++ b/libs/vogar-expect/src/vogar/Expectation.java
@@ -16,7 +16,6 @@
package vogar;
-import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.regex.Pattern;
@@ -37,14 +36,6 @@ import java.util.regex.Pattern;
*/
public final class Expectation {
- /** The pattern to use when no expected output is specified */
- public static final Pattern MATCH_ALL_PATTERN
- = Pattern.compile(".*", Pattern.MULTILINE | Pattern.DOTALL);
-
- /** The expectation of a general successful run. */
- public static final Expectation SUCCESS = new Expectation(Result.SUCCESS, MATCH_ALL_PATTERN,
- Collections.<String>emptySet(), "", -1);
-
/** Justification for this expectation */
private final String description;
diff --git a/libs/vogar-expect/src/vogar/ExpectationStore.java b/libs/vogar-expect/src/vogar/ExpectationStore.java
index cfa20e94cd6..18188892490 100644
--- a/libs/vogar-expect/src/vogar/ExpectationStore.java
+++ b/libs/vogar-expect/src/vogar/ExpectationStore.java
@@ -26,6 +26,7 @@ import com.google.common.collect.Iterables;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -50,7 +51,17 @@ import vogar.util.Log;
* expectation, the outcome expectation will be returned.
*/
public final class ExpectationStore {
+
+ /** The pattern to use when no expected output is specified */
+ private static final Pattern MATCH_ALL_PATTERN
+ = Pattern.compile(".*", Pattern.MULTILINE | Pattern.DOTALL);
+
+ /** The expectation of a general successful run. */
+ private static final Expectation SUCCESS = new Expectation(Result.SUCCESS, MATCH_ALL_PATTERN,
+ Collections.<String>emptySet(), "", -1);
+
private static final int PATTERN_FLAGS = Pattern.MULTILINE | Pattern.DOTALL;
+
private final Map<String, Expectation> outcomes = new LinkedHashMap<String, Expectation>();
private final Map<String, Expectation> failures = new LinkedHashMap<String, Expectation>();
@@ -62,7 +73,7 @@ public final class ExpectationStore {
*/
public Expectation get(String name) {
Expectation byName = getByNameOrPackage(name);
- return byName != null ? byName : Expectation.SUCCESS;
+ return byName != null ? byName : SUCCESS;
}
/**
@@ -87,7 +98,7 @@ public final class ExpectationStore {
}
Expectation byName = getByNameOrPackage(outcome.getName());
- return byName != null ? byName : Expectation.SUCCESS;
+ return byName != null ? byName : SUCCESS;
}
private Expectation getByNameOrPackage(String name) {
@@ -142,7 +153,7 @@ public final class ExpectationStore {
private void readExpectation(JsonReader reader, ModeId mode) throws IOException {
boolean isFailure = false;
Result result = Result.SUCCESS;
- Pattern pattern = Expectation.MATCH_ALL_PATTERN;
+ Pattern pattern = MATCH_ALL_PATTERN;
Set<String> names = new LinkedHashSet<String>();
Set<String> tags = new LinkedHashSet<String>();
Set<ModeId> modes = null;