Skip to content

Commit

Permalink
Update OrJanusPredicateTest.java
Browse files Browse the repository at this point in the history
Improves the readability of the test. The assertions are clearer and include descriptive messages, making it easier to identify which assertion fails. This enhances code maintainability, understanding and debugging efficiency.

Signed-off-by: Rian-Ismael <[email protected]>
  • Loading branch information
Rian-Ismael authored and porunov committed Feb 12, 2025
1 parent a71898b commit 5ee7151
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ ConnectiveJanusPredicate getNegatePredicate(List<JanusGraphPredicate> childPredi

@Test
public void testIsQNF() {
assertTrue(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)).isQNF());
assertTrue(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL, new OrJanusPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)))).isQNF());
assertFalse(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL, new AndJanusPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)))).isQNF());
assertTrue(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)).isQNF(), "Single PREFIX EQUAL should be QNF");
assertTrue(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL, new OrJanusPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)))).isQNF(),
"PREFIX EQUAL with OR(JANUS(PREFIX EQUAL)) should be QNF");
assertFalse(getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL, new AndJanusPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL)))).isQNF(),
"PREFIX EQUAL with AND(JANUS(PREFIX EQUAL)) should not be QNF");
}
}

1 comment on commit 5ee7151

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 5ee7151 Previous: 48dfb1a Ratio
org.janusgraph.JanusGraphSpeedBenchmark.basicAddAndDelete 13284.42589705559 ms/op 12759.792521990807 ms/op 1.04
org.janusgraph.GraphCentricQueryBenchmark.getVertices 1051.2449769643224 ms/op 948.8095656612085 ms/op 1.11
org.janusgraph.MgmtOlapJobBenchmark.runClearIndex 216.68716866340577 ms/op 216.080514307971 ms/op 1.00
org.janusgraph.MgmtOlapJobBenchmark.runReindex 334.4140674629762 ms/op 323.7289066753431 ms/op 1.03
org.janusgraph.JanusGraphSpeedBenchmark.basicCount 232.28279911985695 ms/op 221.93092013457917 ms/op 1.05
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesAllPropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 5393.336812454385 ms/op 4627.448288285934 ms/op 1.17
org.janusgraph.CQLMultiQueryBenchmark.getElementsWithUsingEmitRepeatSteps 18877.076684771284 ms/op 16307.944488646324 ms/op 1.16
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithSmallBatch 21808.39849150944 ms/op 18184.90738927801 ms/op 1.20
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.vertexCentricPropertiesFetching 58972.639237133335 ms/op 54607.369860633335 ms/op 1.08
org.janusgraph.CQLMultiQueryDropBenchmark.dropVertices 1684.0801571285072 ms/op 1523.4969077442136 ms/op 1.11
org.janusgraph.CQLMultiQueryBenchmark.getAllElementsTraversedFromOuterVertex 8735.688361772438 ms/op 7806.908203914538 ms/op 1.12
org.janusgraph.CQLMultiQueryBenchmark.getVerticesWithDoubleUnion 428.7100936904137 ms/op 384.88677249790953 ms/op 1.11
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesAllPropertiesWithUnlimitedBatch 4958.810090391482 ms/op 3963.150305704972 ms/op 1.25
org.janusgraph.CQLMultiQueryBenchmark.getNames 8569.105638106113 ms/op 8114.229699410469 ms/op 1.06
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesThreePropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 6378.543816211159 ms/op 5203.446504605631 ms/op 1.23
org.janusgraph.CQLMultiQueryBenchmark.getLabels 7636.46503996627 ms/op 6885.124388054026 ms/op 1.11
org.janusgraph.CQLMultiQueryBenchmark.getVerticesFilteredByAndStep 447.53712846271696 ms/op 432.53707435039644 ms/op 1.03
org.janusgraph.CQLMultiQueryBenchmark.getVerticesFromMultiNestedRepeatStepStartingFromSingleVertex 13258.139710125713 ms/op 12235.773550114183 ms/op 1.08
org.janusgraph.CQLMultiQueryBenchmark.getVerticesWithCoalesceUsage 389.01238459465384 ms/op 364.53113070250123 ms/op 1.07
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 16485.876962138092 ms/op 13784.313366630518 ms/op 1.20
org.janusgraph.CQLMultiQueryBenchmark.getIdToOutVerticesProjection 275.8549832313538 ms/op 257.3359629935243 ms/op 1.07
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithUnlimitedBatch 18055.312387917 ms/op 14074.48312986445 ms/op 1.28
org.janusgraph.CQLCompositeIndexInlinePropBenchmark.searchVertices 1616.520088792797 ms/op 1536.6531439073692 ms/op 1.05
org.janusgraph.CQLMultiQueryDropBenchmark.dropVerticesGremlinQuery 1684.398781795349 ms/op 1529.2964872498515 ms/op 1.10
org.janusgraph.CQLMultiQueryBenchmark.getNeighborNames 8744.85734836509 ms/op 7975.572658952245 ms/op 1.10
org.janusgraph.CQLMultiQueryBenchmark.getElementsWithUsingRepeatUntilSteps 10113.466019337406 ms/op 8872.58070850431 ms/op 1.14
org.janusgraph.CQLMultiQueryBenchmark.getAdjacentVerticesLocalCounts 9158.157862258906 ms/op 8354.800824982114 ms/op 1.10

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.