public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); //set current location currentLocation = AppContext.BaseTestDirectory; //create config definition using createwrapper method of the ComponentMetadataDefinition class var configDef = ComponentScannerHelper_Accessor.CreateConfigWrapperDefinition(typeof(MockConfig)); testConfig = new ConfigWrapper(configDef); //set the values of MockConfig mockFileAbsolutePath = Path.Combine(currentLocation, mockFile); Stream file = File.Create(mockFileAbsolutePath); file.Close(); //close file so that it is not being used by this process anymore configFilePath = new FilePath(); configFilePath.Init(mockFileAbsolutePath, currentLocation); //the key matches property name in the MockConfig testConfig.ConfigValues["MockFile"].Value = configFilePath; mockDirAbsolutePath = Path.Combine(currentLocation, mockDir); Directory.CreateDirectory(mockDirAbsolutePath); Assert.IsTrue(Directory.Exists(mockDirAbsolutePath)); configDirPath = new DirectoryPath(); configDirPath.Init(mockDirAbsolutePath, currentLocation); //the key matches property name in the MockConfig testConfig.ConfigValues["MockDirectory"].Value = configDirPath; }
public void TestTearDown() { File.Delete(mockFileAbsolutePath); Directory.Delete(mockDirAbsolutePath); AppContext.Components.Clear(); AppContext = null; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); TmpDataDir = Path.Combine(AppContext.BaseTestDirectory, "workspace"); TmpCacheDir = Path.Combine(AppContext.BaseTestDirectory, "cache"); TmpTypeDir = Path.Combine(AppContext.BaseTestDirectory, "s_metricTypes"); ResetWorkspaceWrapper(); }
public void SetUp() { AppContext = new TraceLabTestApplication(TestContext, false); //setPath this.TmpCachePath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Foo.cache"); this.TmpDataPath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "DataFoo.xml"); TestCacheSerializer = new CachingSerializer(AppContext.StreamManager, TmpDataPath, TmpCachePath, SupportedTypes, true, true); }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext, false); m_tempfilename = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Foo.xml"); if (System.IO.File.Exists(TemporaryFile)) { System.IO.File.Delete(TemporaryFile); } }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); TmpDataDir = Path.Combine(AppContext.BaseTestDirectory, "workspace"); TmpCacheDir = Path.Combine(AppContext.BaseTestDirectory, "cache"); TmpTypeDir = Path.Combine(AppContext.BaseTestDirectory, "s_metricTypes"); //assure that workspace is empty AppContext.WorkspaceInstance.Clear(); }
public void TestTearDown() { if (File.Exists(exportFile)) { File.Delete(exportFile); } AppContext.Components.Clear(); AppContext = null; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); AppContext.Components.Clear(); //clear library before loading var libraryAccessor = new ComponentsLibrary_Accessor(new PrivateObject(AppContext.Components)); libraryAccessor.LoadComponentsDefinitions(AppContext.WorkspaceInstance.TypeDirectories); string componentsDir = (string)AppContext.Settings.ComponentPaths[0]; exportFile = System.IO.Path.Combine(componentsDir, "testCompositeComponent.tcml"); }
public void TestTeardown() { //clear directories if (Directory.Exists(TmpDataDir)) { Directory.Delete(TmpDataDir, true); } if (Directory.Exists(TmpCacheDir)) { Directory.Delete(TmpCacheDir, true); } AppContext.Dispose(); AppContext = null; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); AppContext.Components.Clear(); //clear library before loading var libraryAccessor = new ComponentsLibrary_Accessor(new PrivateObject(AppContext.Components)); libraryAccessor.LoadComponentsDefinitions(AppContext.WorkspaceInstance.TypeDirectories); string filename = System.IO.Path.Combine(AppContext.BaseTestDirectory, "tracingGraphNew.teml"); ExperimentFile = filename; System.IO.FileInfo fInfo = new System.IO.FileInfo(ExperimentFile); fInfo.IsReadOnly = false; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); MetadataDefinition definition; if (AppContext.Components.TryGetComponentDefinition(TraceLabTestApplication.TestEmptyComponentGUID, out definition)) { m_emptyComponentMetaDefinition = definition as ComponentMetadataDefinition; } else { Assert.Fail("Failed to locate component metadatadefinition!"); } if (AppContext.Components.TryGetComponentDefinition(TraceLabTestApplication.TestReaderComponentGUID, out definition)) { m_componentReaderMetaDefinition = definition as ComponentMetadataDefinition; } else { Assert.Fail("Failed to locate component metadatadefinition!"); } if (AppContext.Components.TryGetComponentDefinition(TraceLabTestApplication.TestWriterComponentGUID, out definition)) { m_componentWriterMetaDefinition = definition as ComponentMetadataDefinition; } else { Assert.Fail("Failed to locate component metadatadefinition!"); } if (AppContext.Components.TryGetComponentDefinition(TraceLabTestApplication.IncrementerComponentGUID, out definition)) { m_incrementerComponentMetaDefinition = definition as ComponentMetadataDefinition; } else { Assert.Fail("Failed to locate component metadatadefinition!"); } }
public void TestLoadCompositeComponents() { Library.Clear(); Assert.AreEqual(0, Library.Components.Count()); //set library components to new directory string testComponentsPath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "TestLoadCompositeComponents"); AppContext.Settings.ComponentPaths.Clear(); AppContext.Settings.ComponentPaths.Add(new SettingsPath(true, testComponentsPath)); string outputAssemblyPath = System.IO.Path.Combine(testComponentsPath, "MockComponents.dll"); //compile Mock Components to the test directory TraceLabTestApplication.CompileMockComponents(outputAssemblyPath); //try to load var libraryAccessor = new ComponentsLibrary_Accessor(new PrivateObject(Library)); libraryAccessor.LoadComponentsDefinitions(AppContext.WorkspaceInstance.TypeDirectories); //if successful there should be two composite components loaded in the library int counter = 0; foreach (MetadataDefinition definition in Library.Components) { CompositeComponentMetadataDefinition compositeCompDefinition = definition as CompositeComponentMetadataDefinition; if (compositeCompDefinition != null) { //assert its graph is not empty Assert.IsNotNull(compositeCompDefinition.ComponentGraph); counter++; } } Assert.AreEqual(10, counter); Assert.AreEqual(15, Library.Components.Count()); //10 composite components + 5 primitive components from MockComponents.dll Library.Clear(); }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); }
public void TestTearDown() { AppContext.Components.Clear(); AppContext = null; }
public void TestTearDown() { AppContext.Dispose(); AppContext = null; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); this.Library = AppContext.Components; }
public void TestSetup() { AppContext = new TraceLabTestApplication(TestContext); BenchmarkDirectory = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Benchmarks"); }
public void Setup() { AppContext = new TraceLabTestApplication(TestContext, false); AppContext.StreamManager.Clear(); TmpPath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Foo.xml"); }