Beispiel #1
0
 @Test
 public void testSimplePackagesMatcher() throws Exception {
   Assert.assertTrue(
       PatternHelper.matchWithClass("cx.ath.mancel01.project.package1.sub1.Truc", "cx.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass("cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.project.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.project.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.project.package1.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.project.package1.sub1.*"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.project.package1.sub1.Truc"));
 }
Beispiel #2
0
 @Test
 public void testComplexPackagesMatcher() throws Exception {
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.*.package1.sub1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.****.*.sub1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.mancel01.*.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.project.pack*.sub1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.m*.project.*.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.*.mancel01.proj*t.pac*age1.s*b1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "*.project.*.sub1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.*.*.*.sub1.Truc"));
   Assert.assertTrue(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.project.package1.sub1.Tr*"));
 }
Beispiel #3
0
 @Test
 public void testFalsePackagesMatcher() throws Exception {
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.project.package1.sub1.Tr*k"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.*.*.*.*.*.*k"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.*.*.*.*.*.*.Truc"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "*.*.*.*.*.*.*.Truc"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc", "cx.ath.*2.project.package1.*.Truc"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "cx.ath.mancel01.projet.package1.sub1.Truc"));
   Assert.assertFalse(
       PatternHelper.matchWithClass(
           "cx.ath.mancel01.project.package1.sub1.Truc",
           "*.*.ath.mancel01.project.package1.sub1.Truc"));
 }