public virtual void Test() { File4.Delete(TempFile()); Assert.IsFalse(Exists(TempFile())); IObjectContainer oc = Db4oEmbedded.OpenFile(NewConfiguration(), TempFile()); oc.Close(); File4.Delete(TempFile()); Assert.IsFalse(Exists(TempFile())); }
/// <exception cref="System.Exception"></exception> public virtual void TearDown() { var tempTestFilePath = DbFilePath(); if (File.Exists(tempTestFilePath)) { File4.Delete(tempTestFilePath); } }
private string SaveOldAs(string oldFileName) { string newPath; newPath = Path.GetTempFileName(); File4.Delete(newPath); _storage.SaveAs(oldFileName, newPath); return(newPath); }
/// <exception cref="System.Exception"></exception> public override void SetUp() { File4.Delete(TempFile()); IoAdapter adapter = new RandomAccessFileAdapter(); adapter = adapter.Open(TempFile(), false, 0, false); adapter.Write(new byte[] { 1, 2, 3 }, 3); adapter.Close(); }
/// <exception cref="System.Exception"></exception> public virtual void TearDown() { string tempTestFilePath = DbFilePath(); if (System.IO.File.Exists(tempTestFilePath)) { File4.Delete(tempTestFilePath); } }
/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { string absolutePath = new Sharpen.IO.File(dir).GetCanonicalPath(); Sharpen.IO.File fDir = new Sharpen.IO.File(dir); if (fDir.IsDirectory()) { string[] files = fDir.List(); for (int i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }
/// <summary>Deletes the directory</summary> /// <exception cref="System.IO.IOException"></exception> public static void DeleteDir(string dir) { var absolutePath = new File(dir).GetCanonicalPath(); var fDir = new File(dir); if (fDir.IsDirectory()) { var files = fDir.List(); for (var i = 0; i < files.Length; i++) { DeleteDir(Path.Combine(absolutePath, files[i])); } } File4.Delete(dir); }
public virtual void Test() { IEmbeddedConfiguration configuration = NewConfiguration(); ConfigurationItemTestCase.ConfigurationItemStub item = new ConfigurationItemTestCase.ConfigurationItemStub (); configuration.Common.Add(item); Assert.AreSame(LegacyConfigFor(configuration), item.PreparedConfiguration()); Assert.IsNull(item.AppliedContainer()); File4.Delete(TempFile()); IObjectContainer container = Db4oEmbedded.OpenFile(configuration, TempFile()); container.Close(); Assert.AreSame(container, item.AppliedContainer()); }
public virtual void TestExistingFileWillNotBeOverWritten() { Db().Store(new Item(1)); var oldFileName = FileSession().FileName(); var newPath = new ByRef(); try { newPath.value = Path.GetTempFileName(); Assert.IsTrue(File.Exists(((string) newPath.value))); Assert.Expect(typeof (InvalidOperationException), new _ICodeBlock_34(this, oldFileName , newPath)); AssertItems(Db(), 1); } finally { File4.Delete(((string) newPath.value)); } }
/// <exception cref="System.Exception"></exception> public virtual void Test() { string fileName = DatabaseFile(); File4.Delete(fileName); IObjectServer server = Db4oClientServer.OpenServer(CreateServerConfiguration(), fileName , -1); _port = server.Ext().Port(); try { server.GrantAccess("db4o", "db4o"); RunTest(); } finally { server.Close(); File4.Delete(fileName); } }
public virtual void Run() { Sharpen.Runtime.Out.WriteLine("MonitoringDemo will run forever to allow you to see JMX/Perfmon statistics." ); Sharpen.Runtime.Out.WriteLine("Cancel running with CTRL + C"); File4.Delete(DatabaseFileName); IObjectContainer objectContainer = OpenContainer(); StorePermanentObjects(objectContainer); try { while (true) { StoreTemporaryObjects(objectContainer); ExecuteQueries(objectContainer); DeleteTemporaryObjects(objectContainer); } } finally { Close(objectContainer); } }
private void CreateDatabase(string file) { if (!IsApplicableForDb4oVersion()) { return; } System.IO.Directory.CreateDirectory(DatabasePath); if (System.IO.File.Exists(file)) { File4.Delete(file); } IExtObjectContainer objectContainer = Db4oFactory.OpenFile(file).Ext(); IObjectContainerAdapter adapter = ObjectContainerAdapterFactory.ForVersion(Db4oMajorVersion (), Db4oMinorVersion()).ForContainer(objectContainer); try { Store(adapter); } finally { objectContainer.Close(); } }
/// <exception cref="System.Exception"></exception> public override void TearDown() { File4.Delete(Defgared); base.TearDown(); }
private void DeleteLogFile() { File4.Delete(LogFileName(_fileName)); }
/// <exception cref="System.Exception"></exception> protected override void Db4oTearDownBeforeClean() { File4.Delete(DatabaseFile); }
public virtual void Purge(string url) { File4.Delete(url); File4.Delete(MetadataFile(url)); }
/// <exception cref="System.Exception"></exception> protected override void Db4oTearDownBeforeClean() { base.Db4oTearDownBeforeClean(); File4.Delete(BackupFile); }
/// <exception cref="System.Exception"></exception> protected override void Db4oSetupBeforeStore() { base.Db4oSetupBeforeStore(); File4.Delete(BackupFile); }
private void DeleteAllFiles() { File4.Delete(SourceFile()); File4.Delete(BackupFile()); }
private void DeleteFile(string fname) { File4.Delete(fname); }
/// <exception cref="System.IO.IOException"></exception> public virtual void Delete(string uri) { File4.Delete(uri); }
internal static void DeleteFiles() { File4.Delete(MainfileName); File4.Delete(FilenameA); File4.Delete(FilenameB); }
private static void DeleteDataFile() { File4.Delete(DataFile); }
private void TearDownClientServer(string testFileName) { File4.Delete(ClientServerFileName(testFileName)); }
/// <exception cref="System.Exception"></exception> public virtual void TearDown() { File4.Delete(TempFile()); }