Skip to content
Snippets Groups Projects
Commit de5991b3 authored by felmer's avatar felmer
Browse files

LMS-1219 add .MARKER_IS_FINISHED file

SVN: 12879
parent 3d2afee4
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import ch.systemsx.cisd.common.Constants;
import ch.systemsx.cisd.common.TimingParameters;
import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException;
......@@ -82,7 +83,8 @@ class FlowLineFeeder implements IPostRegistrationDatasetHandler
{
String flowLine = extractFlowLine(file);
File dropBox = createDropBoxFile(flowLine);
File flowLineDataSet = new File(dropBox, flowcellID + "_" + flowLine);
String fileName = flowcellID + "_" + flowLine;
File flowLineDataSet = new File(dropBox, fileName);
if (flowLineDataSet.exists())
{
throw new EnvironmentFailureException("There is already a data set for flow line "
......@@ -103,6 +105,9 @@ class FlowLineFeeder implements IPostRegistrationDatasetHandler
+ file.getAbsolutePath() + "' in folder '"
+ flowLineDataSet.getAbsolutePath() + "'.");
}
File markerFile = new File(dropBox, Constants.IS_FINISHED_PREFIX + fileName);
flowLineDataSets.add(markerFile);
FileUtilities.writeToFile(markerFile, "");
}
}
......@@ -198,7 +203,10 @@ class FlowLineFeeder implements IPostRegistrationDatasetHandler
{
for (File file : flowLineDataSets)
{
fileOperations.deleteRecursively(file);
if (file.exists())
{
fileOperations.deleteRecursively(file);
}
}
}
......
......@@ -31,6 +31,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase;
import ch.systemsx.cisd.common.Constants;
import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
import ch.systemsx.cisd.common.filesystem.FileUtilities;
import ch.systemsx.cisd.common.test.AssertionUtil;
......@@ -186,8 +187,8 @@ public class FlowLineFeederTest extends AbstractFileSystemTestCase
public void testUndoLastOperation()
{
testHappyCase();
assertEquals(1, new File(workingDirectory, DROP_BOX_PREFIX + "1").list().length);
assertEquals(1, new File(workingDirectory, DROP_BOX_PREFIX + "2").list().length);
assertEquals(2, new File(workingDirectory, DROP_BOX_PREFIX + "1").list().length);
assertEquals(2, new File(workingDirectory, DROP_BOX_PREFIX + "2").list().length);
flowLineFeeder.undoLastOperation();
......@@ -245,7 +246,8 @@ public class FlowLineFeederTest extends AbstractFileSystemTestCase
private void checkFlowLineDataSet(File originalFlowLine, String flowLineNumber)
{
File dropBox = new File(workingDirectory, DROP_BOX_PREFIX + flowLineNumber);
File ds = new File(dropBox, "abc_" + flowLineNumber);
String fileName = "abc_" + flowLineNumber;
File ds = new File(dropBox, fileName);
assertEquals(true, ds.isDirectory());
File flowLine = new File(ds, originalFlowLine.getName());
......@@ -257,6 +259,7 @@ public class FlowLineFeederTest extends AbstractFileSystemTestCase
originalFlowLine.setLastModified(4711000);
assertEquals(4711000, flowLine.lastModified());
assertEquals(true, new File(ds, FlowLineFeeder.META_DATA_FILE_NAME).exists());
assertEquals(true, new File(dropBox, Constants.IS_FINISHED_PREFIX + fileName).exists());
}
private Sample createFlowLineSample(int flowLineNumber)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment