// Let it run for a while and then kill it, and wait for it to die
Thread.sleep( 6000 );
process.destroy();
process.waitFor();
GraphDatabaseService db = new EmbeddedGraphDatabase( path );
assertTrue( db.index().existsForNodes( "myIndex" ) );
Index<Node> index = db.index().forNodes( "myIndex" );
for ( Node node : db.getAllNodes() )
{
for ( String key : node.getPropertyKeys() )
{
String value = (String) node.getProperty( key );
boolean found = false;
for ( Node indexedNode : index.get( key, value ) )
{
if ( indexedNode.equals( node ) )
{
found = true;
break;
}
}
if ( !found )
{
throw new IllegalStateException( node + " has property '" + key + "'='" +
value + "', but not in index" );
}
}
}
db.shutdown();
}