Skip to content

Commit

Permalink
Use load_test_file to find test file
Browse files Browse the repository at this point in the history
python tests run in different directory; abs path fails.
Also fix some ideaj warnings
  • Loading branch information
cliffclick committed Aug 7, 2014
1 parent 1ae715b commit cc753ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion prj.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(jde-set-variables
'(jde-javadoc-gen-destination-directory "./doc")
'(jde-run-working-directory "$DESK/h2o")
'(jde-run-option-classpath (quote ("./target/classes" "./lib/javassist.jar" "./lib/hadoop/cdh4/hadoop-common.jar" "./lib/hadoop/cdh4/hadoop-auth.jar" "./lib/hadoop/cdh4/slf4j-api-1.6.1.jar" "./lib/hadoop/cdh4/slf4j-nop-1.6.1.jar" "./lib/hadoop/cdh4/hadoop-hdfs.jar" "./lib/hadoop/cdh4/protobuf-java-2.4.0a.jar" "./lib/apache/commons-codec-1.4.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar" "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/poi/dom4j-1.6.1.jar" "./lib/Jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar" "./lib/log4j/log4j-1.2.15.jar" "./lib/joda/joda-time-2.3.jar" "./lib/tachyon/tachyon-0.4.1-thrift.jar")))
'(jde-run-option-classpath (quote ("./target/classes" "./lib/javassist.jar" "./lib/hadoop/cdh4/hadoop-common.jar" "./lib/hadoop/cdh4/hadoop-auth.jar" "./lib/hadoop/cdh4/slf4j-api-1.6.1.jar" "./lib/hadoop/cdh4/slf4j-nop-1.6.1.jar" "./lib/hadoop/cdh4/hadoop-hdfs.jar" "./lib/hadoop/cdh4/protobuf-java-2.4.0a.jar" "./lib/apache/commons-codec-1.4.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar" "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/poi/dom4j-1.6.1.jar" "./lib/Jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar" "./lib/jets3t/commons-httpclient-3.1.jar" "./lib/log4j/log4j-1.2.15.jar" "./lib/joda/joda-time-2.3.jar" "./lib/tachyon/tachyon-0.4.1-thrift.jar")))
'(jde-run-executable-args nil)
'(jde-run-option-debug nil)
'(jde-run-option-vm-args (quote ("-XX:+PrintGC")))
Expand Down
6 changes: 3 additions & 3 deletions py/test_junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class TestJUnit(unittest.TestCase):

def test_A_all_junit(self):
try:
h2o.build_cloud(node_count=2, java_heap_GB=3)
h2o.build_cloud(node_count=2, java_heap_GB=2)

# we don't have the port or ip configuration here
# that util/h2o.py does? Keep this in synch with spawn_h2o there.
# also don't have --nosigar here?
(ps, stdout, stderr) = h2o.spawn_cmd('junit', [
'java',
'-Xms3G',
'-Xmx3G',
'-Xms2G',
'-Xmx2G',
'-Dh2o.arg.ice_root='+h2o.tmp_dir('ice.'),
'-Dh2o.arg.name='+h2o.cloud_name(),
'-Dh2o.arg.ip='+h2o.get_ip_address(),
Expand Down
16 changes: 7 additions & 9 deletions src/test/java/water/parser/DatasetCornerCasesTest.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package water.parser;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;

import java.io.File;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.BeforeClass;
import water.*;
import water.api.Constants.Extensions;
import water.fvec.*;
import water.parser.CustomParser;
import water.parser.GuessSetup;

public class DatasetCornerCasesTest extends TestUtil {
@BeforeClass public static void stall() { stall_till_cloudsize(1); }

/* The following tests deal with one line dataset ended by different number of newlines. */

Expand All @@ -33,9 +31,9 @@ public class DatasetCornerCasesTest extends TestUtil {
final String test_dir = "smalldata/test/";
final String test_prefix = "HTWO-87-one-line-dataset-";

for (int i = 0; i < tests.length; i++) {
String datasetFilename = test_dir + test_prefix + tests[i] + ".csv";
String keyname = test_prefix + tests[i] + Extensions.HEX;
for( String s : tests ) {
String datasetFilename = test_dir + test_prefix + s + ".csv";
String keyname = test_prefix + s + Extensions.HEX;
testOneLineDataset(datasetFilename, keyname);
}
}
Expand All @@ -55,8 +53,8 @@ private void testOneLineDataset(String filename, String keyname) {
// Tests handling of extra columns showing up late in the parse
@Test public void testExtraCols() {
Key okey = Key.make("extra.hex");
Key nfs = NFSFileVec.make(new File("smalldata/test/test_parse_extra_cols.csv"));
ArrayList al = new ArrayList();
Key nfs = load_test_file("smalldata/test/test_parse_extra_cols.csv");
ArrayList<Key> al = new ArrayList<Key>();
al.add(nfs);
//CustomParser.ParserSetup setup = new CustomParser.ParserSetup(CustomParser.ParserType.CSV, (byte)',', 8, true, null, false);
CustomParser.ParserSetup setup0 = new CustomParser.ParserSetup();
Expand Down

0 comments on commit cc753ae

Please sign in to comment.