Skip to content
Snippets Groups Projects
Commit 06629c9f authored by cramakri's avatar cramakri
Browse files

BIS-38 SP-204 : Changes to make the...

BIS-38 SP-204 : Changes to make the DataSetAndPathInfoDBConsistencyCheckProcessingPlugin more easily testable

SVN: 26236
parent ca242b4e
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription; ...@@ -55,7 +55,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription;
public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IProcessingPluginTask public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IProcessingPluginTask
{ {
private static final Logger log = LogFactory.getLogger(LogCategory.OPERATION, private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
DataSetAndPathInfoDBConsistencyCheckProcessingPlugin.class); DataSetAndPathInfoDBConsistencyCheckProcessingPlugin.class);
private transient IHierarchicalContentProvider fileProvider; private transient IHierarchicalContentProvider fileProvider;
...@@ -69,6 +69,21 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr ...@@ -69,6 +69,21 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr
{ {
} }
/**
* A package visible constructor for testing purposes.
*
* @param properties The configuration properties.
* @param storeRoot The root of the dss store.
* @param fileProvider The hierarchical content provider that references the file system.
* @param pathInfoProvider The hierarchical content provider that references the path-info db.
*/
DataSetAndPathInfoDBConsistencyCheckProcessingPlugin(Properties properties, File storeRoot,
IHierarchicalContentProvider fileProvider, IHierarchicalContentProvider pathInfoProvider)
{
this.fileProvider = fileProvider;
this.pathInfoProvider = pathInfoProvider;
}
@Override @Override
public ProcessingStatus process(List<DatasetDescription> datasets, public ProcessingStatus process(List<DatasetDescription> datasets,
DataSetProcessingContext context) DataSetProcessingContext context)
...@@ -105,7 +120,7 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr ...@@ -105,7 +120,7 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr
} catch (Exception e) } catch (Exception e)
{ {
log.error( operationLog.error(
"Couldn't check consistency of the file system and the path info database for a data set: " "Couldn't check consistency of the file system and the path info database for a data set: "
+ dataset.getDataSetCode(), e); + dataset.getDataSetCode(), e);
status.addDatasetStatus( status.addDatasetStatus(
...@@ -418,8 +433,8 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr ...@@ -418,8 +433,8 @@ public class DataSetAndPathInfoDBConsistencyCheckProcessingPlugin implements IPr
public String getDescription() public String getDescription()
{ {
return "'" + getPath() + "' CRC32 checksum in the file system = " return "'" + getPath() + "' CRC32 checksum in the file system = "
+ IOUtilities.crc32ToString(checksumInFS) + IOUtilities.crc32ToString(checksumInFS) + " but in the path info database = "
+ " but in the path info database = " + IOUtilities.crc32ToString(checksumInDB); + IOUtilities.crc32ToString(checksumInDB);
} }
} }
......
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