aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Jones <bjones@galois.com>2012-12-07 16:13:26 -0800
committerGravatar Benjamin Jones <bjones@galois.com>2012-12-07 16:13:26 -0800
commit27a3535dc5e6c15bdcdbead2954ce4b2655e842e (patch)
tree4640dc6228b27b73c75e1820c4defb4fdf7fbb7d
parentf6e2a45110f0435d9c41ad84477aa03736b24fe8 (diff)
comments, licesnse headers
-rw-r--r--headless/src/main/java/com/galois/fiveui/BatchRunner.java21
-rw-r--r--headless/src/main/java/com/galois/fiveui/HeadlessRunner.java8
-rw-r--r--headless/src/test/java/com/galois/fiveui/ReporterTest.java19
3 files changed, 34 insertions, 14 deletions
diff --git a/headless/src/main/java/com/galois/fiveui/BatchRunner.java b/headless/src/main/java/com/galois/fiveui/BatchRunner.java
index d70c078..61c7984 100644
--- a/headless/src/main/java/com/galois/fiveui/BatchRunner.java
+++ b/headless/src/main/java/com/galois/fiveui/BatchRunner.java
@@ -1,5 +1,5 @@
/**
- * Module : BatchRunner.java Copyright : (c) 2011-2012, Galois, Inc.
+ * Module : BatchRunner.java Copyright : (c) 2012, Galois, Inc.
*
* Maintainer : Stability : Provisional Portability: Portable
*
@@ -213,7 +213,8 @@ public class BatchRunner {
if (res.getClass() == String.class) {
// we received an error via the expected mechanisms:
logger.error("exception running rule: " + res);
- builder.add(Result.exception(_driver, (String) res + ", state: " + state));
+ builder.add(Result.exception(_driver,
+ (String) res + ", state: " + state));
return builder.build();
} else {
try {
@@ -221,15 +222,21 @@ public class BatchRunner {
List<Map<String, Map<String, String>>> results = (List) res;
if (0 == results.size()) {
- builder.add(Result.pass(_driver, "passed " + ruleSet.getRules().size() + " tests", _driver.getCurrentUrl(), ruleSet.getName()));
+ builder.add(Result.pass(_driver,
+ "passed " + ruleSet.getRules().size() + " tests",
+ _driver.getCurrentUrl(), ruleSet.getName()));
}
for (Map<String, Map<String, String>> r : results) {
Map<String, String> problem = r.get("payload");
-
- builder.add(Result.error(_driver, "problem: " +
- problem.toString(),
- _driver.getCurrentUrl(), ruleSet.getName()));
+ // TODO decide what to extract from problem object and what
+ // to do with it.
+ //
+ // Probably we should just pass along the Map<String, String>
+ // and let the reporter deal with it.
+ builder.add(Result.error(_driver, problem.toString(),
+ _driver.getCurrentUrl(),
+ ruleSet.getName()));
}
} catch (ClassCastException e) {
diff --git a/headless/src/main/java/com/galois/fiveui/HeadlessRunner.java b/headless/src/main/java/com/galois/fiveui/HeadlessRunner.java
index e6d8e45..302dd6d 100644
--- a/headless/src/main/java/com/galois/fiveui/HeadlessRunner.java
+++ b/headless/src/main/java/com/galois/fiveui/HeadlessRunner.java
@@ -1,5 +1,5 @@
/**
- * Module : HeadlessRunner.java Copyright : (c) 2011-2012, Galois, Inc.
+ * Module : HeadlessRunner.java Copyright : (c) 2012, Galois, Inc.
*
* Maintainer : Stability : Provisional Portability: Portable
*
@@ -23,12 +23,6 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
import com.galois.fiveui.Result;
import com.google.common.collect.ImmutableList;
diff --git a/headless/src/test/java/com/galois/fiveui/ReporterTest.java b/headless/src/test/java/com/galois/fiveui/ReporterTest.java
index 8509c5b..3896a75 100644
--- a/headless/src/test/java/com/galois/fiveui/ReporterTest.java
+++ b/headless/src/test/java/com/galois/fiveui/ReporterTest.java
@@ -1,3 +1,22 @@
+/**
+ * Module : Reporter.java Copyright : (c) 2012, Galois, Inc.
+ *
+ * Maintainer : Stability : Provisional Portability: Portable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ *
+ * @author Benjamin Jones <bjones@galois.com>
+ */
package com.galois.fiveui;
import static org.junit.Assert.*;