-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60e2d1c
commit cb725ce
Showing
1 changed file
with
23 additions
and
6 deletions.
There are no files selected for viewing
29 changes: 23 additions & 6 deletions
29
examples/simple/src/test/java/com/example/simple/AppTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
package com.example.simple; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
|
||
import com.example.adblock.AdvtBlocker; | ||
|
||
/** | ||
* Unit test for simple App. | ||
* Simple test of using library | ||
*/ | ||
public class AppTest | ||
{ | ||
public class AppTest { | ||
/** | ||
* Rigorous Test :-) | ||
*/ | ||
@Test | ||
public void shouldAnswerWithTrue() | ||
{ | ||
assertTrue( true ); | ||
public void mainTest() { | ||
List<String> rules = new ArrayList<>(List.of( | ||
"-advertisement-icon.", | ||
"-advertisement-management/", | ||
"-advertisement.", | ||
"-advertisement/script." | ||
)); | ||
|
||
AdvtBlocker blocker = AdvtBlocker.createInstance(rules); | ||
boolean result = blocker.checkUrls( | ||
"http://example.com/-advertisement-icon.", | ||
"http://example.com/helloworld", | ||
"image" | ||
); | ||
|
||
assertTrue(result); | ||
} | ||
} |