1 18 21 package org.apache.roller.util; 22 23 import java.io.File ; 24 25 import org.apache.roller.business.FileManagerTest; 26 import org.apache.roller.config.RollerConfig; 27 28 import junit.framework.Test; 29 import junit.framework.TestCase; 30 import junit.framework.TestSuite; 31 32 35 public class BlacklistTest extends TestCase 36 { 37 private Blacklist blacklist; 38 39 42 public BlacklistTest() 43 { 44 super(); 45 } 46 47 50 public BlacklistTest(String arg0) 51 { 52 super(arg0); 53 } 54 55 58 protected void setUp() throws Exception 59 { 60 super.setUp(); 61 blacklist = Blacklist.getBlacklist(); 62 String FS = File.separator; 63 blacklist.loadBlacklistFromFile( 64 ".." + FS + "WEB-INF" + FS + "classes" + FS + "blacklist.txt"); 65 } 66 67 70 protected void tearDown() throws Exception 71 { 72 super.tearDown(); 73 } 75 76 public void testIsBlacklisted0() 77 { 78 assertFalse(blacklist.isBlacklisted("four score and seven years ago.com")); 79 } 80 81 public void testIsBlacklisted1() 83 { 84 assertTrue(blacklist.isBlacklisted("00000-online-casino.com")); 85 } 86 87 public void testIsBlacklisted2() 89 { 90 assertTrue(blacklist.isBlacklisted("www.lsotr.com")); 91 } 92 93 public void testIsBlacklisted3() 95 { 96 assertTrue(blacklist.isBlacklisted("www.lsotr.com")); 97 } 98 99 public void testIsBlacklisted4() 101 { 102 assertTrue(blacklist.isBlacklisted("blow-job.com")); 103 } 104 105 public void testIsBlacklisted5() 107 { 108 assertTrue(blacklist.isBlacklisted("buymoreonline.com")); 109 } 110 111 public void testIsBlacklisted6() 113 { 114 assertTrue(blacklist.isBlacklisted("diet-enlargement.com")); 115 } 116 117 public void testIsBlacklisted7() 119 { 120 assertTrue(blacklist.isBlacklisted("viagra.com")); 121 } 122 123 public void testIsBlacklisted8() 125 { 126 assertTrue(blacklist.isBlacklisted("ragazze-something.com")); 127 } 128 129 public static Test suite() 130 { 131 return new TestSuite(BlacklistTest.class); 132 } 133 } 134 | Popular Tags |