示例#1
0
 /// <exception cref="System.Exception"/>
 internal virtual void TestScanInfoObject(long blockId, FilePath blockFile, FilePath
                                          metaFile)
 {
     DirectoryScanner.ScanInfo scanInfo = new DirectoryScanner.ScanInfo(blockId, blockFile
                                                                        , metaFile, TestVolume);
     NUnit.Framework.Assert.AreEqual(blockId, scanInfo.GetBlockId());
     if (blockFile != null)
     {
         NUnit.Framework.Assert.AreEqual(blockFile.GetAbsolutePath(), scanInfo.GetBlockFile
                                             ().GetAbsolutePath());
     }
     else
     {
         NUnit.Framework.Assert.IsNull(scanInfo.GetBlockFile());
     }
     if (metaFile != null)
     {
         NUnit.Framework.Assert.AreEqual(metaFile.GetAbsolutePath(), scanInfo.GetMetaFile(
                                             ).GetAbsolutePath());
     }
     else
     {
         NUnit.Framework.Assert.IsNull(scanInfo.GetMetaFile());
     }
     NUnit.Framework.Assert.AreEqual(TestVolume, scanInfo.GetVolume());
 }
示例#2
0
 //end for
 //end synchronized
 /// <summary>Block is found on the disk.</summary>
 /// <remarks>
 /// Block is found on the disk. In-memory block is missing or does not match
 /// the block on the disk
 /// </remarks>
 private void AddDifference(List <DirectoryScanner.ScanInfo> diffRecord, DirectoryScanner.Stats
                            statsRecord, DirectoryScanner.ScanInfo info)
 {
     statsRecord.missingMetaFile  += info.GetMetaFile() == null ? 1 : 0;
     statsRecord.missingBlockFile += info.GetBlockFile() == null ? 1 : 0;
     diffRecord.AddItem(info);
 }
示例#3
0
 /// <exception cref="System.Exception"/>
 internal virtual void TestScanInfoObject(long blockId)
 {
     DirectoryScanner.ScanInfo scanInfo = new DirectoryScanner.ScanInfo(blockId, null,
                                                                        null, null);
     NUnit.Framework.Assert.AreEqual(blockId, scanInfo.GetBlockId());
     NUnit.Framework.Assert.IsNull(scanInfo.GetBlockFile());
     NUnit.Framework.Assert.IsNull(scanInfo.GetMetaFile());
 }