Logo Search packages:      
Sourcecode: maven-repo-helper version File versions

void org::debian::maven::repo::RuleTest::testApply (  )  [inline]

Test of apply method, of class Rule.

Definition at line 53 of file RuleTest.java.

                            {
        Rule simple = new Rule("test");
        assertEquals("test", simple.apply("test"));

        Rule simpleReplace = new Rule("s/test/foo/");
        assertEquals("foo", simpleReplace.apply("test"));

        Rule complexReplace = new Rule("s/test(.*)/foo$1/");
        assertEquals("foo", complexReplace.apply("test"));
        assertEquals("foo2", complexReplace.apply("test2"));

        Rule complexReplace2 = new Rule("s/.*/debian/");
        assertEquals("debian", complexReplace2.apply("xxx"));
        assertEquals("debian", complexReplace2.apply("test"));
        assertEquals("debian", complexReplace2.apply("test2"));

        Rule generic = new Rule("*");
        assertEquals("xxx", generic.apply("xxx"));
        assertEquals("test", generic.apply("test"));
        assertEquals("test2", generic.apply("test2"));

        Rule generic2 = new Rule("test*");
        assertEquals("test", generic2.apply("test"));
        assertEquals("test2", generic2.apply("test2"));

    }


Generated by  Doxygen 1.6.0   Back to index