mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fixed test issue causing build to fail
This commit is contained in:
parent
b02df0f03a
commit
b3c51f11ed
@ -17,13 +17,23 @@
|
||||
|
||||
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_vector;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import static com.datastax.oss.protocol.internal.ProtocolConstants.ErrorCode.READ_TIMEOUT;
|
||||
import static org.apache.logging.log4j.core.impl.ThrowableFormatOptions.FILE_NAME;
|
||||
|
||||
public class HdfFileToVectorTest {
|
||||
private static final int CONNECT_TIMEOUT = 100;
|
||||
|
||||
@Test
|
||||
public void testHdfFileToVector() {
|
||||
public void testHdfFileToVector() throws IOException {
|
||||
final float[][] results = new float[][]{
|
||||
{0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,6.0f},
|
||||
{2.0f,1.6666666f,2.4f,3.2857144f,4.2222223f,5.181818f,6.1538463f},
|
||||
@ -31,8 +41,15 @@ public class HdfFileToVectorTest {
|
||||
{6.0f,3.0f,3.2f,3.857143f,4.6666665f,5.5454545f,6.4615383f}
|
||||
};
|
||||
|
||||
FileUtils.copyURLToFile(
|
||||
new URL("https://support.hdfgroup.org/ftp/HDF5/examples/files/exbyapi/h5ex_t_float.h5"),
|
||||
new File("h5ex_t_float.h5"),
|
||||
CONNECT_TIMEOUT,
|
||||
READ_TIMEOUT);
|
||||
|
||||
HdfFileToVector hdfFileToVector = new HdfFileToVector(
|
||||
"src/test/resources/data/h5ex_t_float.h5", "/DS1");
|
||||
"h5ex_t_float.h5",
|
||||
"/DS1");
|
||||
|
||||
List<Float> read;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@ -41,5 +58,7 @@ public class HdfFileToVectorTest {
|
||||
assert (read.get(j) == results[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
new File("h5ex_t_float.h5").delete();
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user