package de.hpi.bpt.chimera.database;

import de.hpi.bpt.chimera.AbstractDatabaseDependentTest;
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 *
 */
public class DbFragmentTest extends AbstractDatabaseDependentTest {
    @Ignore @Test
    public void testGetFragmentsForScenario(){
        DbFragment dbFragment = new DbFragment();
        assertEquals(1, (int)dbFragment.getFragmentsForScenario(1).get(0));
        assertEquals(2, (int)dbFragment.getFragmentsForScenario(1).get(1));
        assertEquals(3, (int)dbFragment.getFragmentsForScenario(1).get(2));
    }
}

@@ -99,278 +99,1197 @@
 ort 
-org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A *%0A */%0Apublic class DbFragmentTest extends AbstractDatabaseDependentTest %7B%0A    @Ignore @Test%0A    public void testGetFragmentsForScenario()%7B%0A        DbFragment dbFragment = new DbFragment();
+de.hpi.bpt.chimera.jcomparser.saving.Connector;%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.sql.SQLException;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A *%0A */%0Apublic class DbFragmentTest %7B%0A%0A    private static DbFragment dbFragment;%0A    private static Connector connector;%0A%0A    private static int fragment1;%0A    private static int fragment2;%0A%0A    @BeforeClass%0A    public static void clearAndInitialize() throws IOException, SQLException %7B%0A        dbFragment = new DbFragment();%0A        connector = new Connector();%0A        clearFragments();%0A        insertTestData();%0A    %7D%0A%0A    @AfterClass%0A    public static void clearFragments() throws IOException, SQLException %7B%0A        AbstractDatabaseDependentTest.resetDatabase();%0A    %7D%0A%0A    private static void insertTestData() %7B%0A        fragment1 = connector.insertFragmentIntoDatabase(%22fragment1%22, 1, 1);%0A        fragment2 = connector.insertFragmentIntoDatabase(%22fragment2%22, 1, 1);%0A        connector.insertXmlIntoDatabase(fragment1, %22%3Cxml 1%3E%22);%0A        connector.insertXmlIntoDatabase(fragment2, %22%3Cxml 2%3E%22);%0A    %7D%0A%0A    @Test%0A    public void testGetFragmentsForScenario()%7B
 %0A   
@@ -1310,16 +1310,24 @@
 als(
-1, (int)
+new Integer(1), 
 dbFr
@@ -1394,16 +1394,24 @@
 als(
-2, (int)
+new Integer(2), 
 dbFr
@@ -1449,24 +1449,90 @@
 1).get(1));%0A
+    %7D%0A%0A    @Test%0A    public void testGetXmlStringsForScenario() %7B%0A
         asse
@@ -1544,16 +1544,19 @@
 als(
-3, (int)
+%22%3Cxml 1%3E%22, 
 dbFr
@@ -1561,32 +1561,113 @@
 Fragment.get
-Fragment
+XmlStringsForScenario(1).get(0));%0A        assertEquals(%22%3Cxml 2%3E%22, dbFragment.getXmlString
 sForScenario
@@ -1674,17 +1674,17 @@
 (1).get(
-2
+1
 ));%0A    

Rework DbFragmentTest