@Override protected PropertyContainer lookupPropertyContainer( long id ) { return db.getRelationshipById( id ); }
Relationship relationship = db.getRelationshipById( 0 ); assertArrayEquals( propertyValue, (byte[]) relationship.getProperty( testPropertyKey ) ); tx.success(); Relationship relationship = db.getRelationshipById( 0 ); relationship.removeProperty( testPropertyKey ); tx.success(); Relationship relationship = db.getRelationshipById( 0 ); assertFalse( relationship.hasProperty( testPropertyKey ) ); tx.success();
Relationship relationship = db.getRelationshipById( 0 ); assertEquals( propertyValue, relationship.getProperty( testPropertyKey ) ); tx.success(); Relationship relationship = db.getRelationshipById( 0 ); relationship.removeProperty( testPropertyKey ); tx.success(); Relationship relationship = db.getRelationshipById( 0 ); assertFalse( relationship.hasProperty( testPropertyKey ) ); tx.success();
@Test public void shouldThrowIllegalArgumentChangingTypeOfFieldOnRelationshipIndex() { String indexName = "index"; createRelationshipExplicitIndexWithSingleRelationship( db, indexName ); long relId; try ( Transaction tx = db.beginTx() ) { Node node = db.createNode(); Relationship rel = node.createRelationshipTo( node, TYPE ); relId = rel.getId(); RelationshipIndex index = db.index().forRelationships( indexName ); index.add( rel, "key", "otherValue" ); tx.success(); } try ( Transaction tx = db.beginTx() ) { RelationshipIndex index = db.index().forRelationships( indexName ); index.remove( db.getRelationshipById( relId ), "key" ); tx.success(); } expectedException.expect( IllegalArgumentException.class ); try ( Transaction tx = db.beginTx() ) { RelationshipIndex index = db.index().forRelationships( indexName ); index.add( db.getRelationshipById( relId ), "key", ValueContext.numeric( 52 ) ); tx.success(); } }