// Path: src/main/java/org/neo4j/neode/logging/Log.java
// public interface Log
// {
//     void write( String value );
// }
// 
// Path: src/test/java/org/neo4j/neode/test/Db.java
// public final class Db
// {
//     private Db()
//     {
//     }
// 
//     public static GraphDatabaseService impermanentDb()
//     {
//         Map<String, String> params = new HashMap<String, String>();
//         params.put( "online_backup_enabled", "false" );
// 
//         return new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig( params ).newGraphDatabase();
//     }
// 
//     public static GraphDatabaseService tempDb()
//     {
//         return new GraphDatabaseFactory().newEmbeddedDatabase( createTempDatabaseDir().getAbsolutePath() );
//     }
// 
//     private static File createTempDatabaseDir()
//     {
// 
//         File d;
//         try
//         {
//             d = File.createTempFile( "datasetbuilder-", "dir" );
//             System.out.println( String.format( "Created a new Neo4j database at [%s]", d.getAbsolutePath() ) );
//         }
//         catch ( IOException e )
//         {
//             throw new RuntimeException( e );
//         }
//         if ( !d.delete() )
//         {
//             throw new RuntimeException( "temp config directory pre-delete failed" );
//         }
//         if ( !d.mkdirs() )
//         {
//             throw new RuntimeException( "temp config directory not created" );
//         }
//         d.deleteOnExit();
//         return d;
//     }
// 
//     public static void usingSampleDataset( WithSampleDataset f )
//     {
//         GraphDatabaseService db = Db.impermanentDb();
//         Node firstNode, secondNode, thirdNode;
//         try ( Transaction tx = db.beginTx() )
//         {
//             firstNode = db.createNode();
//             secondNode = db.createNode();
//             thirdNode = db.createNode();
//             tx.success();
//         }
// 
//         try ( Transaction tx = db.beginTx() )
//         {
//             f.execute( db, firstNode, secondNode, thirdNode );
//             tx.success();
//         }
//         db.shutdown();
//     }
// 
//     public interface WithSampleDataset
//     {
//         public void execute( GraphDatabaseService db, Node firstNode, Node secondNode, Node thirdNode );
//     }
// 
// 
// }
// 
// Path: src/main/java/org/neo4j/neode/ChoiceOfTargetNodesStrategy.java
// public static ChoiceOfTargetNodesStrategy all( TargetNodesStrategy... targetNodeStrategies )
// {
//     return new ChooseAllTargetNodesStrategies( asList( targetNodeStrategies ) );
// }
// 
// Path: src/main/java/org/neo4j/neode/Range.java
// public static Range exactly( int count )
// {
//     return new Range( count, count );
// }
// 
// Path: src/main/java/org/neo4j/neode/TargetNodesStrategy.java
// public static SetNumberOfNodes create( NodeSpecification nodeSpecification )
// {
//     CreateUniqueNodes targetNodesSource = new CreateUniqueNodes( nodeSpecification );
//     return new TargetNodesStrategyBuilder( targetNodesSource );
// }


import java.util.Iterator;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.Transaction;
import org.neo4j.neode.logging.Log;
import org.neo4j.neode.test.Db;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.neo4j.graphdb.DynamicRelationshipType.withName;
import static org.neo4j.neode.ChoiceOfTargetNodesStrategy.all;
import static org.neo4j.neode.Range.exactly;
import static org.neo4j.neode.TargetNodesStrategy.create;
package org.neo4j.neode;






public class ChooseAllTargetNodesStrategiesTest
{
    @Test
    public void shouldExecuteAllCommandsForEachNode() throws Exception
    {
        GraphDatabaseService db = Db.impermanentDb();
        Log log = new Log()
        {
            @Override
            public void write( String value )
            {
                // Do nothing
            }
        };
        DatasetManager dsm = new DatasetManager( db, log );
        Dataset dataset = dsm.newDataset( "Execute All Test" );

        NodeSpecification user = dsm.nodeSpecification( "user" );
        NodeSpecification workAddress = dsm.nodeSpecification( "work address" );
        NodeSpecification homeAddress = dsm.nodeSpecification( "home address" );
        RelationshipSpecification work_address = dsm.relationshipSpecification( "WORK_ADDRESS" );
        RelationshipSpecification home_address = dsm.relationshipSpecification( "HOME_ADDRESS" );

// Path: src/main/java/org/neo4j/neode/logging/Log.java
// public interface Log
// {
//     void write( String value );
// }
// 
// Path: src/test/java/org/neo4j/neode/test/Db.java
// public final class Db
// {
//     private Db()
//     {
//     }
// 
//     public static GraphDatabaseService impermanentDb()
//     {
//         Map<String, String> params = new HashMap<String, String>();
//         params.put( "online_backup_enabled", "false" );
// 
//         return new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig( params ).newGraphDatabase();
//     }
// 
//     public static GraphDatabaseService tempDb()
//     {
//         return new GraphDatabaseFactory().newEmbeddedDatabase( createTempDatabaseDir().getAbsolutePath() );
//     }
// 
//     private static File createTempDatabaseDir()
//     {
// 
//         File d;
//         try
//         {
//             d = File.createTempFile( "datasetbuilder-", "dir" );
//             System.out.println( String.format( "Created a new Neo4j database at [%s]", d.getAbsolutePath() ) );
//         }
//         catch ( IOException e )
//         {
//             throw new RuntimeException( e );
//         }
//         if ( !d.delete() )
//         {
//             throw new RuntimeException( "temp config directory pre-delete failed" );
//         }
//         if ( !d.mkdirs() )
//         {
//             throw new RuntimeException( "temp config directory not created" );
//         }
//         d.deleteOnExit();
//         return d;
//     }
// 
//     public static void usingSampleDataset( WithSampleDataset f )
//     {
//         GraphDatabaseService db = Db.impermanentDb();
//         Node firstNode, secondNode, thirdNode;
//         try ( Transaction tx = db.beginTx() )
//         {
//             firstNode = db.createNode();
//             secondNode = db.createNode();
//             thirdNode = db.createNode();
//             tx.success();
//         }
// 
//         try ( Transaction tx = db.beginTx() )
//         {
//             f.execute( db, firstNode, secondNode, thirdNode );
//             tx.success();
//         }
//         db.shutdown();
//     }
// 
//     public interface WithSampleDataset
//     {
//         public void execute( GraphDatabaseService db, Node firstNode, Node secondNode, Node thirdNode );
//     }
// 
// 
// }
// 
// Path: src/main/java/org/neo4j/neode/ChoiceOfTargetNodesStrategy.java
// public static ChoiceOfTargetNodesStrategy all( TargetNodesStrategy... targetNodeStrategies )
// {
//     return new ChooseAllTargetNodesStrategies( asList( targetNodeStrategies ) );
// }
// 
// Path: src/main/java/org/neo4j/neode/Range.java
// public static Range exactly( int count )
// {
//     return new Range( count, count );
// }
// 
// Path: src/main/java/org/neo4j/neode/TargetNodesStrategy.java
// public static SetNumberOfNodes create( NodeSpecification nodeSpecification )
// {
//     CreateUniqueNodes targetNodesSource = new CreateUniqueNodes( nodeSpecification );
//     return new TargetNodesStrategyBuilder( targetNodesSource );
// }


// Path: src/test/java/org/neo4j/neode/ChooseAllTargetNodesStrategiesTest.java
import java.util.Iterator;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.Transaction;
import org.neo4j.neode.logging.Log;
import org.neo4j.neode.test.Db;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.neo4j.graphdb.DynamicRelationshipType.withName;
import static org.neo4j.neode.ChoiceOfTargetNodesStrategy.all;
import static org.neo4j.neode.Range.exactly;
import static org.neo4j.neode.TargetNodesStrategy.create;

package org.neo4j.neode;






public class ChooseAllTargetNodesStrategiesTest
{
    @Test
    public void shouldExecuteAllCommandsForEachNode() throws Exception
    {
        GraphDatabaseService db = Db.impermanentDb();
        Log log = new Log()
        {
            @Override
            public void write( String value )
            {
                // Do nothing
            }
        };
        DatasetManager dsm = new DatasetManager( db, log );
        Dataset dataset = dsm.newDataset( "Execute All Test" );

        NodeSpecification user = dsm.nodeSpecification( "user" );
        NodeSpecification workAddress = dsm.nodeSpecification( "work address" );
        NodeSpecification homeAddress = dsm.nodeSpecification( "home address" );
        RelationshipSpecification work_address = dsm.relationshipSpecification( "WORK_ADDRESS" );
        RelationshipSpecification home_address = dsm.relationshipSpecification( "HOME_ADDRESS" );

        NodeCollection users = user.create( 2 ).update( dataset );