示例#1
0
        public virtual void TestUnJar()
        {
            FilePath unjarDir = new FilePath(TestRootDir, "unjar-all");

            NUnit.Framework.Assert.IsFalse("unjar dir shouldn't exist at test start", new FilePath
                                               (unjarDir, "foobar.txt").Exists());
            // Unjar everything
            RunJar.UnJar(new FilePath(TestRootDir, TestJarName), unjarDir);
            Assert.True("foobar unpacked", new FilePath(unjarDir, "foobar.txt"
                                                        ).Exists());
            Assert.True("foobaz unpacked", new FilePath(unjarDir, "foobaz.txt"
                                                        ).Exists());
        }
示例#2
0
        /// <summary>Test unjarring a specific regex</summary>
        /// <exception cref="System.Exception"/>
        public virtual void TestUnJarWithPattern()
        {
            FilePath unjarDir = new FilePath(TestRootDir, "unjar-pattern");

            NUnit.Framework.Assert.IsFalse("unjar dir shouldn't exist at test start", new FilePath
                                               (unjarDir, "foobar.txt").Exists());
            // Unjar only a regex
            RunJar.UnJar(new FilePath(TestRootDir, TestJarName), unjarDir, Pattern.Compile
                             (".*baz.*"));
            NUnit.Framework.Assert.IsFalse("foobar not unpacked", new FilePath(unjarDir, "foobar.txt"
                                                                               ).Exists());
            Assert.True("foobaz unpacked", new FilePath(unjarDir, "foobaz.txt"
                                                        ).Exists());
        }