Skip to content

Commit

Permalink
fix(example): Fixed example after all changes
Browse files Browse the repository at this point in the history
  • Loading branch information
breadrock1 committed Jul 11, 2024
1 parent fbd8c9f commit f0efb3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/simple/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<argLine>-Djava.library.path=${project.build.outputDirectory}/lib</argLine>
<argLine>-Djava.library.path=${project.build.outputDirectory}/lib/lib</argLine>
</configuration>
</plugin>
<plugin>
Expand Down
31 changes: 14 additions & 17 deletions examples/simple/src/main/java/com/example/simple/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
import java.util.ArrayList;
import java.util.List;

//import com.example.adblock.AdvtBlocker;
import com.example.adblock.AdvtBlocker;

/**
* Simple example!
*/
public class App {
static {
try {
System.loadLibrary("adblock_coffee");
System.out.println("dfgdfg");
} catch (UnsatisfiedLinkError ex) {
System.err.println(ex.getMessage());
}
}

public static void main(String[] args) {
List<String> rules = new ArrayList<>(List.of(
Expand All @@ -26,13 +18,18 @@ public static void main(String[] args) {
"-advertisement/script."
));

// AdvtBlocker blocker = AdvtBlocker.createInstance(rules);
// boolean result = blocker.checkUrls(
// "http://example.com/-advertisement-icon.",
// "http://example.com/helloworld",
// "image"
// );
//
// System.out.println(result);
AdvtBlocker blocker = AdvtBlocker.createInstance(rules);

for (int i = 0; i < 3000; i++) {
boolean result = blocker.checkUrls(
"http://example.com/-advertisement-icon.",
"http://example.com/helloworld",
"image"
);

if (result == false) {
System.out.println(result);
}
}
}
}

0 comments on commit f0efb3a

Please sign in to comment.