Skip to content

Commit 2e7d1d8

Browse files
committed
update operand javadocs, tidy test imports and helper placement
1 parent 80490a7 commit 2e7d1d8

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package org.evomaster.client.java.controller.neo4j.conditions;
22

33
/**
4-
* One side of a comparison in a WHERE clause: a {@link PropertyOperand} resolved from the
5-
* matched element, a {@link LiteralOperand} constant, or a {@link RawOperand} kept unchanged.
6-
* Modelling each side explicitly lets {@code n.age > m.age} be told apart from {@code n.age > "m.age"}.
4+
* One operand of a condition: a side of a WHERE comparison or an inline property value. Concrete
5+
* kinds are {@link PropertyOperand} (a {@code variable.key} resolved from the matched element),
6+
* {@link LiteralOperand} (a constant), {@link ArithmeticOperand} (an arithmetic expression),
7+
* {@link ListOperand} (an {@code IN} list), and {@link RawOperand} (kept verbatim when not
8+
* decomposed). Modelling each explicitly lets {@code n.age > m.age} be told apart from
9+
* {@code n.age > "m.age"}.
710
*/
811
public interface Operand {
912
}

client-java/controller/src/main/java/org/evomaster/client/java/controller/neo4j/conditions/RawOperand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.Objects;
44

55
/**
6-
* An operand kept unchanged because the model does not decompose it: arithmetic such as
7-
* 25 + 5, a function call, or a list. Carries the original text so nothing is dropped.
6+
* An operand kept unchanged because the model does not decompose it: a function call, a parameter,
7+
* or string concatenation. Carries the original text so nothing is dropped.
88
*/
99
public final class RawOperand implements Operand {
1010

client-java/controller/src/test/java/org/evomaster/client/java/controller/neo4j/parser/Cypher25AntlrParserTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import org.evomaster.client.java.controller.neo4j.operations.MatchOperation;
55
import org.evomaster.client.java.controller.neo4j.operations.PatternEdge;
66
import org.evomaster.client.java.controller.neo4j.operations.QuantifiedPathPattern;
7-
import org.junit.jupiter.api.Test;
87
import org.evomaster.client.java.controller.neo4j.parser.cypher25.Cypher25AntlrParser;
8+
import org.junit.jupiter.api.Test;
99

1010
import static org.junit.jupiter.api.Assertions.*;
1111

@@ -36,6 +36,13 @@ private <T extends CypherCondition> long countOf(MatchOperation op, Class<T> typ
3636
return op.getConditions().stream().filter(type::isInstance).count();
3737
}
3838

39+
private ComparisonCondition comparison(MatchOperation op) {
40+
return (ComparisonCondition) op.getConditions().stream()
41+
.filter(ComparisonCondition.class::isInstance)
42+
.findFirst()
43+
.orElseThrow(() -> new AssertionError("no ComparisonCondition found"));
44+
}
45+
3946
@Test
4047
void testAllNodes() {
4148
MatchOperation op = parse("MATCH (n) RETURN n");
@@ -799,10 +806,4 @@ void testSyntaxErrorFails() {
799806
assertFails("MATCH (n:Person RETURN n"); // missing closing paren
800807
}
801808

802-
private ComparisonCondition comparison(MatchOperation op) {
803-
return (ComparisonCondition) op.getConditions().stream()
804-
.filter(ComparisonCondition.class::isInstance)
805-
.findFirst()
806-
.orElseThrow(() -> new AssertionError("no ComparisonCondition found"));
807-
}
808809
}

0 commit comments

Comments
 (0)