Search in sources :

Example 1 with FileInputSplit

use of com.baidu.hugegraph.computer.core.input.loader.FileInputSplit in project hugegraph-computer by hugegraph.

the class FileInputSplitTest method testConstructor.

@Test
public void testConstructor() {
    InputStruct inputStruct = Mockito.mock(InputStruct.class);
    FileInputSplit split = new FileInputSplit(ElemType.VERTEX, inputStruct, "/tmp/test");
    Assert.assertEquals("/tmp/test", split.path());
    Assert.assertEquals(inputStruct, split.struct());
    Assert.assertSame(ElemType.VERTEX, split.type());
}
Also used : FileInputSplit(com.baidu.hugegraph.computer.core.input.loader.FileInputSplit) InputStruct(com.baidu.hugegraph.loader.mapping.InputStruct) Test(org.junit.Test)

Example 2 with FileInputSplit

use of com.baidu.hugegraph.computer.core.input.loader.FileInputSplit in project hugegraph-computer by hugegraph.

the class FileInputSplitTest method testHashCode.

@Test
public void testHashCode() {
    InputStruct inputStruct = Mockito.mock(InputStruct.class);
    FileInputSplit split1 = new FileInputSplit(ElemType.VERTEX, inputStruct, "/tmp/test");
    FileInputSplit split2 = new FileInputSplit(ElemType.VERTEX, inputStruct, "/tmp/test");
    Assert.assertEquals(split1.hashCode(), split2.hashCode());
}
Also used : FileInputSplit(com.baidu.hugegraph.computer.core.input.loader.FileInputSplit) InputStruct(com.baidu.hugegraph.loader.mapping.InputStruct) Test(org.junit.Test)

Example 3 with FileInputSplit

use of com.baidu.hugegraph.computer.core.input.loader.FileInputSplit in project hugegraph-computer by hugegraph.

the class FileInputSplitTest method testEquals.

@Test
public void testEquals() {
    InputStruct inputStruct = Mockito.mock(InputStruct.class);
    FileInputSplit split1 = new FileInputSplit(ElemType.VERTEX, inputStruct, "/tmp/test");
    FileInputSplit split2 = new FileInputSplit(ElemType.VERTEX, inputStruct, "/tmp/test");
    Assert.assertEquals(split1, split1);
    Assert.assertEquals(split1, split2);
    Assert.assertNotEquals(split1, null);
    Assert.assertNotEquals(split1, new Object());
    Assert.assertEquals(InputSplit.END_SPLIT, InputSplit.END_SPLIT);
    Assert.assertNotEquals(InputSplit.END_SPLIT, split1);
}
Also used : FileInputSplit(com.baidu.hugegraph.computer.core.input.loader.FileInputSplit) InputStruct(com.baidu.hugegraph.loader.mapping.InputStruct) Test(org.junit.Test)

Aggregations

FileInputSplit (com.baidu.hugegraph.computer.core.input.loader.FileInputSplit)3 InputStruct (com.baidu.hugegraph.loader.mapping.InputStruct)3 Test (org.junit.Test)3