use of org.neo4j.graphdb.Node in project neo4j by neo4j.
the class TestNeo4jCacheAndPersistence method deleteTestingGraph.
@After
public void deleteTestingGraph() {
Node node1 = getGraphDb().getNodeById(node1Id);
Node node2 = getGraphDb().getNodeById(node2Id);
node1.getSingleRelationship(MyRelTypes.TEST, Direction.BOTH).delete();
node1.delete();
node2.delete();
}
use of org.neo4j.graphdb.Node in project neo4j by neo4j.
the class TestProperties method charRange.
@Test
public void charRange() throws Exception {
Node node = getGraphDb().createNode();
char stride = Character.MAX_VALUE / VALUE_RANGE_SPLIT;
for (char i = Character.MIN_VALUE; i < Character.MAX_VALUE; ) {
setPropertyAndAssertIt(node, i);
i = i > 0 && Character.MAX_VALUE - i < stride ? Character.MAX_VALUE : (char) (i + stride);
}
}
use of org.neo4j.graphdb.Node in project neo4j by neo4j.
the class TestProperties method removeSomeAndSetSome.
@Test
public void removeSomeAndSetSome() throws Exception {
Node node = getGraphDb().createNode();
node.setProperty("remove me", "trash");
newTransaction();
node.removeProperty("remove me");
node.setProperty("foo", "bar");
node.setProperty("baz", 17);
newTransaction();
assertEquals("bar", node.getProperty("foo"));
assertEquals(17, node.getProperty("baz"));
assertNull(node.getProperty("remove me", null));
}
use of org.neo4j.graphdb.Node in project neo4j by neo4j.
the class TestProperties method removeOneOfThree.
@Test
public void removeOneOfThree() throws Exception {
Node node = getGraphDb().createNode();
node.setProperty("1", 1);
node.setProperty("2", 2);
node.setProperty("3", 3);
newTransaction();
node.removeProperty("2");
newTransaction();
assertNull(node.getProperty("2", null));
}
use of org.neo4j.graphdb.Node in project neo4j by neo4j.
the class TestProperties method floatRange.
@Test
public void floatRange() throws Exception {
Node node = getGraphDb().createNode();
float stride = 16f;
for (float i = Float.MIN_VALUE; i < Float.MAX_VALUE; ) {
setPropertyAndAssertIt(node, i);
setPropertyAndAssertIt(node, -i);
i *= stride;
}
}
Aggregations