// Path: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationException.java
// public class MigrationException extends RuntimeException {
//     private final String scriptName;
//     private final String statement;
// 
//     public MigrationException(String message, String scriptName) {
//         this(message, null, scriptName);
//     }
// 
//     public MigrationException(String message, Throwable cause) {
//         this(message, cause, null, null);
//     }
// 
//     public MigrationException(String message, Throwable cause, String scriptName) {
//         this(message, cause, scriptName, null);
//     }
// 
//     public MigrationException(String message, Throwable cause, String scriptName, String statement) {
//         super(message, cause);
//         this.scriptName = scriptName;
//         this.statement = statement;
//     }
// 
//     /**
//      * The name of the script that was involved in the error. Usually
//      * the script that contains a faulty statement. If the process did
//      * not arrive yet at script execution this will be null.
//      *
//      * @return the name of the failing script or null if there was a different kind of error
//      */
//     public String getScriptName() {
//         return scriptName;
//     }
// 
//     /**
//      * The statement that caused the migration to fail. This
//      * is helpful in case there is more than one statement inside a script.
//      *
//      * @return the failing statement or null if the exception was not thrown
//      *          during statement execution
//      */
//     public String getStatement() {
//         return statement;
//     }
// }


import org.cognitor.cassandra.migration.MigrationException;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.MatcherAssert.assertThat;
package org.cognitor.cassandra.migration.collector;



/**
 * @author Patrick Kranz
 */
public class FailOnDuplicatesCollectorTest {
    private ScriptCollector scriptCollector;

    @Before
    public void before() {
        this.scriptCollector = new FailOnDuplicatesCollector();
    }

    @Test
    public void shouldReturnAllScriptsWhenNoDuplicateScriptFileGiven() {
        scriptCollector.collect(new ScriptFile(0, "/0_init.cql", "init.cql"));
        scriptCollector.collect(new ScriptFile(1, "/1_add-table.cql", "add_table.cql"));

        assertThat(scriptCollector.getScriptFiles().size(), is(equalTo(2)));
    }

// Path: cassandra-migration/src/main/java/org/cognitor/cassandra/migration/MigrationException.java
// public class MigrationException extends RuntimeException {
//     private final String scriptName;
//     private final String statement;
// 
//     public MigrationException(String message, String scriptName) {
//         this(message, null, scriptName);
//     }
// 
//     public MigrationException(String message, Throwable cause) {
//         this(message, cause, null, null);
//     }
// 
//     public MigrationException(String message, Throwable cause, String scriptName) {
//         this(message, cause, scriptName, null);
//     }
// 
//     public MigrationException(String message, Throwable cause, String scriptName, String statement) {
//         super(message, cause);
//         this.scriptName = scriptName;
//         this.statement = statement;
//     }
// 
//     /**
//      * The name of the script that was involved in the error. Usually
//      * the script that contains a faulty statement. If the process did
//      * not arrive yet at script execution this will be null.
//      *
//      * @return the name of the failing script or null if there was a different kind of error
//      */
//     public String getScriptName() {
//         return scriptName;
//     }
// 
//     /**
//      * The statement that caused the migration to fail. This
//      * is helpful in case there is more than one statement inside a script.
//      *
//      * @return the failing statement or null if the exception was not thrown
//      *          during statement execution
//      */
//     public String getStatement() {
//         return statement;
//     }
// }


// Path: cassandra-migration/src/test/java/org/cognitor/cassandra/migration/collector/FailOnDuplicatesCollectorTest.java
import org.cognitor.cassandra.migration.MigrationException;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.MatcherAssert.assertThat;

package org.cognitor.cassandra.migration.collector;



/**
 * @author Patrick Kranz
 */
public class FailOnDuplicatesCollectorTest {
    private ScriptCollector scriptCollector;

    @Before
    public void before() {
        this.scriptCollector = new FailOnDuplicatesCollector();
    }

    @Test
    public void shouldReturnAllScriptsWhenNoDuplicateScriptFileGiven() {
        scriptCollector.collect(new ScriptFile(0, "/0_init.cql", "init.cql"));
        scriptCollector.collect(new ScriptFile(1, "/1_add-table.cql", "add_table.cql"));

        assertThat(scriptCollector.getScriptFiles().size(), is(equalTo(2)));
    }

    @Test(expected = MigrationException.class)