long node2 = nextId( Node.class ); transaction.nodeDoCreate( node2 ); StorageProperty n1prop1 = nodeAddProperty( node1, index( "prop1" ), "string1" ); StorageProperty n1prop2 = nodeAddProperty( node1, index( "prop2" ), 1 ); StorageProperty n1prop3 = nodeAddProperty( node1, index( "prop3" ), true ); StorageProperty n2prop1 = nodeAddProperty( node2, index( "prop1" ), "string2" ); StorageProperty n2prop2 = nodeAddProperty( node2, index( "prop2" ), 2 ); StorageProperty n2prop3 = nodeAddProperty( node2, index( "prop3" ), false ); transaction.relationshipDoCreate( rel2, relType2, node2, node1 ); StorageProperty r1prop1 = relAddProperty( rel1, index( "prop1" ), "string1" ); StorageProperty r1prop2 = relAddProperty( rel1, index( "prop2" ), 1 ); StorageProperty r1prop3 = relAddProperty( rel1, index( "prop3" ), true ); StorageProperty r2prop1 = relAddProperty( rel2, index( "prop1" ), "string2" ); StorageProperty r2prop2 = relAddProperty( rel2, index( "prop2" ), 2 ); StorageProperty r2prop3 = relAddProperty( rel2, index( "prop3" ), false ); commitTx(); ds.stop(); nodeAddProperty( nodeIds[i], index( "nisse" ), 10 - i );
@Test public void testProps1() throws Exception { initializeStores( databaseLayout, stringMap() ); startTx(); long nodeId = nextId( Node.class ); transaction.nodeDoCreate( nodeId ); pStore.nextId(); StorageProperty prop = nodeAddProperty( nodeId, index( "nisse" ), 10 ); commitTx(); ds.stop(); initializeStores( databaseLayout, stringMap() ); startTx(); StorageProperty prop2 = nodeAddProperty( nodeId, prop.propertyKeyId(), 5 ); transaction.nodeDoRemoveProperty( nodeId, prop2.propertyKeyId() ); transaction.nodeDoDelete( nodeId ); commitTx(); ds.stop(); }
@Test public void testRels1() throws Exception { initializeStores( databaseLayout, stringMap() ); startTx(); int relType1 = (int) nextId( RelationshipType.class ); String typeName = "relationshiptype1"; transaction.relationshipTypeDoCreateForName( typeName, relType1 ); long[] nodeIds = new long[3]; for ( int i = 0; i < 3; i++ ) { nodeIds[i] = nextId( Node.class ); transaction.nodeDoCreate( nodeIds[i] ); nodeAddProperty( nodeIds[i], index( "nisse" ), 10 - i ); } for ( int i = 0; i < 2; i++ ) { transaction.relationshipDoCreate( nextId( Relationship.class ), relType1, nodeIds[i], nodeIds[i + 1] ); } commitTx(); startTx(); for ( int i = 0; i < 3; i += 2 ) { deleteRelationships( nodeIds[i] ); transaction.nodeDoDelete( nodeIds[i] ); } commitTx(); ds.stop(); }
nodeAddProperty( nodeIds[i], index( "nisse" ), 10 - i );