Esempio n. 1
0
        public void RunBuildScriptTestTool()
        {
            BuildFile bf = new BuildFile();
            bf.LoadXmlFile(@"..\..\Scenario\TestTool.xml");

            if (Directory.Exists(TestUtility.TempDir + @"TestTool"))
                Directory.Delete(TestUtility.TempDir + @"TestTool", true);

            List<IBuildFileElement> elements = (List<IBuildFileElement>)bf.RootElements;
            new BuildFileElementExecutor().ExecuteElements(elements);

            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\TestApplication.exe"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\TestLibrary.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\Manual\Manual.doc"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\JavaApp.class"));

            Directory.Delete(TestUtility.TempDir + @"TestTool", true);
        }
Esempio n. 2
0
        public void Test()
        {
            BuildFile bf = new BuildFile();
            bf.LoadXmlFile(@"..\..\Scenario\Spitfire.xml");

            if (Directory.Exists(TestUtility.TempDir + @"Spitfire"))
                Directory.Delete(TestUtility.TempDir + @"Spitfire", true);

            List<IBuildFileElement> elements = (List<IBuildFileElement>)bf.RootElements;
            new BuildFileElementExecutor().ExecuteElements(elements);

            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\Storage.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\CommandCore.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\NetworkModel.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\ClientCache.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\MSSQLProvider.dll"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\Server.exe"));
            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"Spitfire\ScmClient.exe"));

            Directory.Delete(TestUtility.TempDir + @"Spitfire", true);
        }
Esempio n. 3
0
        public void RunBuildScriptTestToolSpecificComponent()
        {
            BuildFile bf = new BuildFile();
            bf.LoadXmlFile(@"..\..\Scenario\TestTool.xml");

            if (Directory.Exists(TestUtility.TempDir + @"TestTool"))
                Directory.Delete(TestUtility.TempDir + @"TestTool", true);

            List<IBuildFileElement> elements = (List<IBuildFileElement>)bf.GetBuildComponentWithRootActions("TestLibrary");

            new BuildFileElementExecutor().ExecuteElements(elements);

            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\TestLibrary.dll"));
            Assert.IsTrue(!File.Exists(TestUtility.TempDir + @"TestTool\TestApplication.exe"));

            elements.Clear();
            elements.Add(bf.GetBuildComponent("JavaApp"));

            new BuildFileElementExecutor().ExecuteElements(elements);

            Assert.IsTrue(File.Exists(TestUtility.TempDir + @"TestTool\JavaApp.class"));

            Directory.Delete(TestUtility.TempDir + @"TestTool", true);
        }
Esempio n. 4
0
        private BuildFile GetBuildFile()
        {
            BuildFile bf = new BuildFile();

            try
            {
                bf.LoadXmlFile(txtBuildFile.Text);
            }
            catch (BuildFileParseException)
            {
                MessageBox.Show("Error parsing specified build file", "CamBuild");
                return null;
            }

            return bf;
        }
Esempio n. 5
0
        private bool IsValidBuildFile(string filePath)
        {
            if (!File.Exists(filePath))
                return false;

            try
            {
                BuildFile bf = new BuildFile();
                bf.LoadXmlFile(filePath);
            }
            catch (XmlException)
            {
                return false;
            }
            catch (BuildFileParseException)
            {
                return false;
            }

            return true;
        }
Esempio n. 6
0
        private void InitializeOptions()
        {
            cListBC.Items.Clear();
            dtProperties.Rows.Clear();
            cListLogging.Items.Clear();

            BuildFile bf = new BuildFile();
            bf.LoadXmlFile(txtBuildFile.Text);

            this.FillListBc(bf);
            this.FillListProperties(bf);
            this.FillLoggers();
        }
Esempio n. 7
0
        private BuildFile GetBuildFile(string arg)
        {
            if (arg == null)
                throw new CamBuildConsoleException("Argument '-bf' is required.");

            if (arg.Length == 0)
                throw new CamBuildConsoleException("Argument '-bf' must be followed by a value (path to build file).");

            if (!File.Exists(arg))
                throw new CamBuildConsoleException("Argument '-bf' specifies an invalid path or non-existing file.");

            BuildFile bf = new BuildFile();
            bf.LoadXmlFile(arg);

            return bf;
        }