Skip to content

Commit 4a66a10

Browse files
committed
tmp
1 parent cab0eda commit 4a66a10

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/test/java/org/apache/sysds/test/functions/jmlc/JMLConnectionTest.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.apache.sysds.runtime.frame.data.FrameBlock;
3131
import org.apache.sysds.runtime.io.IOUtilFunctions;
3232
import org.apache.sysds.runtime.matrix.data.MatrixBlock;
33+
import org.apache.sysds.runtime.util.HDFSTool;
3334
import org.apache.sysds.test.AutomatedTestBase;
3435
import org.junit.Assert;
3536
import org.junit.Test;
@@ -386,4 +387,44 @@ public void testConvertToFrame() {
386387
throw new AssertionError(e);
387388
}
388389
}
390+
391+
@Test
392+
public void testTransformMetaData1() {
393+
try (Connection conn = new Connection()) {
394+
FrameBlock frame = conn.readTransformMetaDataFromFile(SCRIPT_DIR + TEST_DIR + "tfmtd_example2/");
395+
Assert.assertEquals("Hello", frame.get(0,0));
396+
} catch (IOException e) {
397+
Assert.assertEquals("Missing transform specification.", e.getMessage());
398+
}
399+
}
400+
401+
@Test
402+
public void testTransformMetaData2() {
403+
try (Connection conn = new Connection()) {
404+
String spec = HDFSTool.readStringFromHDFSFile(SCRIPT_DIR + TEST_DIR+"tfmtd_example2/spec.json");
405+
FrameBlock frame = conn.readTransformMetaDataFromFile(spec, SCRIPT_DIR + TEST_DIR + "tfmtd_example2/");
406+
Assert.assertEquals("91312·1", frame.get(0,0));
407+
} catch (IOException e) {
408+
throw new AssertionError(e);
409+
}
410+
}
411+
412+
@Test
413+
public void testTransformMetaData3() {
414+
try (Connection conn = new Connection()) {
415+
conn.readTransformMetaDataFromPath(SCRIPT_DIR + TEST_DIR + "tfmtd_example2");
416+
} catch (Exception e) {
417+
Assert.assertEquals("NullPointerException", e.getClass().getSimpleName());
418+
}
419+
}
420+
421+
@Test
422+
public void testTransformMetaData4() {
423+
try (Connection conn = new Connection()) {
424+
String spec = HDFSTool.readStringFromHDFSFile(SCRIPT_DIR + TEST_DIR+"tfmtd_example2/spec.json");
425+
conn.readTransformMetaDataFromPath(spec,SCRIPT_DIR + TEST_DIR + "tfmtd_example2");
426+
} catch (Exception e) {
427+
Assert.assertEquals("NullPointerException", e.getClass().getSimpleName());
428+
}
429+
}
389430
}

0 commit comments

Comments
 (0)