Skip to content
Permalink
Browse files
test: adapt kout/kneighbor get method with server (#123)
  • Loading branch information
imbajin committed Jun 3, 2021
1 parent d9b72be commit 9d1ab597c3014a2e2f16809a226a6fd7e847f1ed
Showing 6 changed files with 9 additions and 11 deletions.
@@ -27,4 +27,4 @@ after_success:
env:
global:
- TRAVIS_DIR=assembly/travis
- COMMIT_ID=9ef6796dc9c60679ffbe49e60fe31c7d23818f55
- COMMIT_ID=461948ee262cc696853a8c8ba1306e6b371e3e89
@@ -67,14 +67,14 @@ public static void checkSkipDegree(long skipDegree, long degree,
skipDegree);
if (capacity != NO_LIMIT) {
E.checkArgument(degree != NO_LIMIT && degree < capacity,
"The degree must be < capacity");
"The max degree must be < capacity");
E.checkArgument(skipDegree < capacity,
"The skipped degree must be < capacity");
}
if (skipDegree > 0L) {
E.checkArgument(degree != NO_LIMIT && skipDegree >= degree,
"The skipped degree must be >= degree, " +
"but got skipped degree '%s' and degree '%s'",
"The skipped degree must be >= max degree, " +
"but got skipped degree '%s' and max degree '%s'",
skipDegree, degree);
}
}
@@ -217,7 +217,7 @@ public Builder degree(long degree) {

public Builder sample(int sample) {
E.checkArgument(sample == NO_LIMIT || sample > 0,
"The sample must be > 0, but got: %s",
"The sample must be > 0 or == -1, but got: %s",
sample);
this.step.sample = sample;
return this;
@@ -227,7 +227,7 @@ private Step build() {
TraversersAPI.checkDegree(this.step.degree);
E.checkArgument(this.step.sample > 0 ||
this.step.sample == NO_LIMIT,
"The sample must be > 0, but got: %s",
"The sample must be > 0 or == -1, but got: %s",
this.step.sample);
E.checkArgument(this.step.degree == NO_LIMIT ||
this.step.degree >= this.step.sample,
@@ -450,7 +450,7 @@ public void testCountWithIllegalArgument() {
Assert.assertThrows(IllegalArgumentException.class, () -> {
builder.steps().degree(5).skipDegree(3);
}, e -> {
Assert.assertContains("The skipped degree must be >= degree, ",
Assert.assertContains("The skipped degree must be >= max degree",
e.getMessage());
});

@@ -56,12 +56,11 @@ public void testKneighborGet() {

List<Object> vertices = kneighborAPI.get(markoId, Direction.OUT,
null, 2, -1L, -1L);
Assert.assertEquals(5, vertices.size());
Assert.assertEquals(4, vertices.size());
Assert.assertTrue(vertices.contains(softwareId + ":lop"));
Assert.assertTrue(vertices.contains(softwareId + ":ripple"));
Assert.assertTrue(vertices.contains(personId + ":vadas"));
Assert.assertTrue(vertices.contains(personId + ":josh"));
Assert.assertTrue(vertices.contains(personId + ":marko"));
}

@Test
@@ -96,8 +96,7 @@ public void testKoutGetBothAll() {

List<Object> vertices = koutAPI.get(markoId, Direction.BOTH, null,
2, false, -1L, -1L, -1L);
Assert.assertEquals(5, vertices.size());
Assert.assertTrue(vertices.contains(personId + ":marko"));
Assert.assertEquals(4, vertices.size());
Assert.assertTrue(vertices.contains(personId + ":josh"));
Assert.assertTrue(vertices.contains(personId + ":peter"));
Assert.assertTrue(vertices.contains(softwareId + ":lop"));

0 comments on commit 9d1ab59

Please sign in to comment.