Remove Unnecessary Prints in Tests
Change-Id: I4def109c0a8b40343d59d5689f8a791249174478
Reviewed-on: https://asterix-gerrit.ics.uci.edu/655
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterix-common/src/test/java/org/apache/asterix/test/server/TestServerProvider.java b/asterix-common/src/test/java/org/apache/asterix/test/server/TestServerProvider.java
index 0be6800..60c1c11 100644
--- a/asterix-common/src/test/java/org/apache/asterix/test/server/TestServerProvider.java
+++ b/asterix-common/src/test/java/org/apache/asterix/test/server/TestServerProvider.java
@@ -30,4 +30,4 @@
throw new Exception("Unknown test server");
}
}
-}
\ No newline at end of file
+}
diff --git a/asterix-external-data/src/main/java/org/apache/asterix/external/api/IRecordReader.java b/asterix-external-data/src/main/java/org/apache/asterix/external/api/IRecordReader.java
index 1462e9b..769db19 100644
--- a/asterix-external-data/src/main/java/org/apache/asterix/external/api/IRecordReader.java
+++ b/asterix-external-data/src/main/java/org/apache/asterix/external/api/IRecordReader.java
@@ -72,4 +72,4 @@
* progress and errors
*/
public void setFeedLogManager(FeedLogManager feedLogManager);
-}
\ No newline at end of file
+}
diff --git a/asterix-external-data/src/main/java/org/apache/asterix/external/util/TweetGenerator.java b/asterix-external-data/src/main/java/org/apache/asterix/external/util/TweetGenerator.java
index d4e63ad..3670368 100644
--- a/asterix-external-data/src/main/java/org/apache/asterix/external/util/TweetGenerator.java
+++ b/asterix-external-data/src/main/java/org/apache/asterix/external/util/TweetGenerator.java
@@ -68,7 +68,6 @@
private void writeTweetString(TweetMessage tweetMessage) throws IOException {
String tweet = tweetMessage.getAdmEquivalent(fields) + "\n";
- System.out.println(tweet);
tweetCount++;
byte[] b = tweet.getBytes();
if (outputBuffer.position() + b.length > outputBuffer.limit()) {
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Common.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Common.java
index b3c027b..da05e46 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Common.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/Common.java
@@ -63,4 +63,4 @@
return h;
}
};
-}
\ No newline at end of file
+}
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/ExprList.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/ExprList.java
index 13ef3c1..e9376e2 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/ExprList.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/ExprList.java
@@ -277,4 +277,4 @@
public void reset() {
exprList.clear();
}
-}
\ No newline at end of file
+}
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/object/pool/ValuePool.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/object/pool/ValuePool.java
index 5034dbe..698e947 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/object/pool/ValuePool.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/object/pool/ValuePool.java
@@ -30,4 +30,4 @@
protected void reset(Value obj) {
obj.clear();
}
-}
\ No newline at end of file
+}
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdToADMTest.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdToADMTest.java
index 92c6ba1..926c40e 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdToADMTest.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdToADMTest.java
@@ -80,22 +80,14 @@
int i = 0;
while (recordReader.hasNext()) {
i++;
- System.out.print("{ ");
val.clear();
IRawRecord<char[]> record = recordReader.next();
lexerSource.setNewSource(record.get());
parser.setLexerSource(lexerSource);
parser.parseNext(pAd);
- //System.out.println(pAd);
Map<CaseInsensitiveString, ExprTree> attrs = pAd.getAttrList();
- boolean notFirst = false;
for (Entry<CaseInsensitiveString, ExprTree> entry : attrs.entrySet()) {
- CaseInsensitiveString name = entry.getKey();
ExprTree tree = entry.getValue();
- if (notFirst) {
- System.out.print(", ");
- }
- notFirst = true;
switch (tree.getKind()) {
case ATTRREF_NODE:
case CLASSAD_NODE:
@@ -103,25 +95,15 @@
case EXPR_LIST_NODE:
case FN_CALL_NODE:
case OP_NODE:
- if (pAd.evaluateAttr(name.get(), val)) {
- System.out.print("\"" + name + "Expr\":" + "\"expr=" + tree + "\"");
- System.out.print(", \"" + name + "\":" + val);
- } else {
- System.out.print("\"" + name + "\":" + tree);
- }
break;
case LITERAL_NODE:
- // No need to do anything
- System.out.print("\"" + name + "\":" + tree);
break;
default:
System.out.println("Something is wrong");
break;
}
}
- System.out.println(" }");
}
- System.out.println(i + " number of records found");
recordReader.close();
}
} catch (Exception e) {
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTest.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTest.java
index c74fd03..f972f45 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTest.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTest.java
@@ -53,7 +53,6 @@
try {
ClassAdUnitTester.test(args.length, args);
} catch (IOException e) {
- e.printStackTrace();
assertTrue(false);
}
assertTrue(true);
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTester.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTester.java
index 561b541..5b1e0b5 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTester.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/ClassAdUnitTester.java
@@ -232,7 +232,7 @@
if (parameters.checkAll || parameters.checkOperator) {
}
if (parameters.checkAll || parameters.checkCollection) {
- //test_collection(parameters, results);
+ // test_collection(parameters, results);
}
if (parameters.checkAll || parameters.checkUtils) {
testUtils(parameters, results);
@@ -329,7 +329,7 @@
AMutableDouble r = new AMutableDouble(0);
AMutableCharArrayString s = new AMutableCharArrayString();
ClassAd c = new ClassAd();
- //ExprList *l;
+ // ExprList *l;
basic = parser.parseClassAd(input_basic);
@@ -395,7 +395,6 @@
haveSeconds = false;
haveOther = false;
for (String entry : refs) {
- System.out.println(entry);
if (entry.compareTo("other.Environment") == 0) {
haveEnvironment = true;
} else if (entry.compareTo("other.Time") == 0) {
@@ -439,7 +438,7 @@
results);
/* ----- Test chained ClassAds ----- */
- //classad1 and classad2 from above test are used.
+ // classad1 and classad2 from above test are used.
ClassAd classad3 = new ClassAd();
classad1.chainToAd(classad2);
@@ -688,41 +687,6 @@
}
/*********************************************************************
- * This test suite was deleted since I don't think we need it
- * Function: test_collection
- * Purpose: Test the ClassAdCollection class. Note that we test the
- * local Collections only: we don't test the server/client
- * versions available in ClassAdCollectionServer and
- * ClassAdCollectionClient.
- *********************************************************************/
-
- /*
- * This one is deleted too since I don't think we need it
- public static boolean check_in_view(ClassAdCollection collection, String view_name, String classad_name) {
- boolean have_view;
- boolean in_view;
-
- in_view = false;
-
- LocalCollectionQuery query;
-
- query.Bind(collection);
-
- have_view = query.Query(view_name, null);
- if (have_view) {
- String classad_key;
- for (query.ToFirst(), query.Current(classad_key); !query.IsAfterLast(); query.Next(classad_key)) {
- if (!classad_key.compare(classad_name)) {
- in_view = true;
- break;
- }
- }
- }
- return in_view;
- }
- */
-
- /*********************************************************************
* Function: test_utils
* Purpose: Test utils
*********************************************************************/
diff --git a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/FunctionalTester.java b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/FunctionalTester.java
index 88b7a32..f4cf9db 100644
--- a/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/FunctionalTester.java
+++ b/asterix-external-data/src/test/java/org/apache/asterix/external/classad/test/FunctionalTester.java
@@ -145,7 +145,7 @@
// Then we parse to see what the user wants.
for (int argIndex = 1; argIndex < argc; argIndex++) {
if (argv[argIndex].equalsIgnoreCase("-d") || argv[argIndex].equalsIgnoreCase("-debug")) {
- debug = true;
+ debug = false;
} else if (argv[argIndex].equalsIgnoreCase("-v") || argv[argIndex].equalsIgnoreCase("-verbose")) {
verbose = true;
} else {
@@ -558,9 +558,6 @@
} else {
variable = new Variable(variable_name.getStringValue(), value);
variables.put(variable_name.getStringValue(), variable);
- if (true) {
- System.out.println(variable_name.getStringValue() + " = " + value);
- }
}
}
}
@@ -751,84 +748,9 @@
}
/*********************************************************************
- * Function: handle_writexml
+ * Function: handle_echo
* Purpose:
- *
- * @throws IOException
*********************************************************************/
- /*
- public static void handle_writexml(AMutableString line, State state, Parameters parameters) throws IOException {
- AMutableString filename = new AMutableString("");
- ExprTree expr;
- BufferedWriter xml_file;
-
- if (get_file_name(line, filename, state, parameters)) {
- if ((expr = get_expr(line, state, parameters)) != null) {
- if (expr_okay_for_xml_file(expr, state, parameters)) {
- xml_file = Files.newBufferedWriter(Paths.get(filename.getStringValue()));
- ClassAdXMLUnParser unparser = new ClassAdXMLUnParser();
- AMutableCharArrayString classad_text = new AMutableCharArrayString();
- xml_file.write("<classads>\n");
- if (expr.getKind() == NodeKind.CLASSAD_NODE) {
- unparser.Unparse(classad_text, expr);
- xml_file.write(classad_text.toString());
- } else {
- ExprList list = (ExprList) expr;
- for (ExprTree classad : list.getExprList()) {
- classad_text.setValue("");
- unparser.Unparse(classad_text, classad);
- xml_file.write(classad_text.toString());
- xml_file.newLine();
- }
- }
- xml_file.write("</classads>\n");
- xml_file.close();
- }
- }
- }
- return;
- }
-
- *//*********************************************************************
- * Function: handle_readxml
- * Purpose:
- *
- * @throws IOException
- *********************************************************************/
-
- /*
- public static void handle_readxml(AMutableString line, State state, Parameters parameters) throws IOException {
- AMutableString variable_name = new AMutableString(null);
- AMutableString file_name = new AMutableString(null);
-
- if (get_variable_name(line, false, variable_name, state, parameters)) {
- if (get_file_name(line, file_name, state, parameters)) {
- InputStream xml_file = Files.newInputStream(Paths.get(file_name.getStringValue()));
- ExprList list;
- ClassAd classad;
- ClassAdXMLParser parser = new ClassAdXMLParser();
- Variable variable;
-
- list = new ExprList();
- do {
- classad = parser.ParseClassAd(new InputStreamLexerSource(xml_file));
- if (classad != null) {
- list.add(classad);
- }
- } while (classad != null);
- variable = new Variable(variable_name.getStringValue(), list);
- variables.put(variable_name.getStringValue(), variable);
- if (parameters.interactive) {
- print_expr(list, state, parameters);
- }
- }
- }
- }
-
- *//*********************************************************************
- * Function: handle_echo
- * Purpose:
- *********************************************************************/
public static void handle_echo(String line, State state, Parameters parameters) {
AMutableCharArrayString new_line = new AMutableCharArrayString();
int index;
@@ -1066,13 +988,17 @@
PrettyPrint unparser = new PrettyPrint();
unparser.unparse(output, tree);
} else if (state.format == PrintFormat.print_XML) {/*
- ClassAdXMLUnParser unparser = new ClassAdXMLUnParser();
- unparser.SetCompactSpacing(true);
- unparser.Unparse(output, tree);
- } else if (state.format == PrintFormat.print_XMLPretty) {
- ClassAdXMLUnParser unparser = new ClassAdXMLUnParser();
- unparser.SetCompactSpacing(false);
- unparser.Unparse(output, tree);*/
+ * ClassAdXMLUnParser unparser = new
+ * ClassAdXMLUnParser();
+ * unparser.SetCompactSpacing(true);
+ * unparser.Unparse(output, tree);
+ * } else if (state.format ==
+ * PrintFormat.print_XMLPretty) {
+ * ClassAdXMLUnParser unparser = new
+ * ClassAdXMLUnParser();
+ * unparser.SetCompactSpacing(false);
+ * unparser.Unparse(output, tree);
+ */
}
System.out.println(output);
}