diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 21e12ba..1de5cbc 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -13,8 +13,9 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false + max-parallel: 2 matrix: - java: [ 8, 9.0.x, 10, 11.0.x, 12, 13 ] + java: [ 11.0.x, 12, 13, 14, 15, 16 ] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 5828807..35e7d77 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,27 @@ A sample image of a report is: #### Minimum requirements - Maven 3.6 -- Java 8 +- Java 11 - SQLite for reading the database - instructions to install for [Windows](https://www.sqlitetutorial.net/download-install-sqlite), [Linux](https://linoxide.com/linux-how-to/install-use-sqlite-linux) and [MacOS](https://flaviocopes.com/sqlite-how-to-install) #### Run -Clone the repository and build it with Maven: +- Clone the repository and build it with Maven: - git clone https://github.com/SOBotics/Belisarius - cd Belisarius - mvn clean install + git clone https://github.com/SOBotics/Belisarius + cd Belisarius -- Edit the `properties/login.properties` file with some correct information. +- Install the swagger-java-client jar, which is used to communicate with Higgs, and build: + + mvn -B install:install-file -Dfile="./lib/swagger-java-client-1.0.0.jar" \ + -DgroupId="io.swagger" \ + -DartifactId="swagger-java-client" \ + -Dversion="1.0.0" \ + -Dpackaging="jar" \ + -DgeneratePom="true" + mvn clean install + +- Edit the `properties/login.properties` file with the information you like. - Run the bot with the following command: java -cp target/belisarius-1.7.1.jar:./lib/* bugs.stackoverflow.belisarius.Application diff --git a/database/belisarius.db b/database/belisarius.db index cbdad1c..d0f3e02 100644 Binary files a/database/belisarius.db and b/database/belisarius.db differ diff --git a/docs/run.md b/docs/run.md index 67d0ba8..3eeaca5 100644 --- a/docs/run.md +++ b/docs/run.md @@ -3,16 +3,25 @@ #### Minimum requirements - Maven 3.6 -- Java 8 +- Java 11 - SQLite for reading the database - instructions to install for [Windows](https://www.sqlitetutorial.net/download-install-sqlite), [Linux](https://linoxide.com/linux-how-to/install-use-sqlite-linux) and [MacOS](https://flaviocopes.com/sqlite-how-to-install) #### Compile and run -Clone the repository and build it with Maven: +- Clone the repository and build it with Maven: - git clone https://github.com/SOBotics/Belisarius - cd Belisarius - mvn clean install + git clone https://github.com/SOBotics/Belisarius + cd Belisarius + +- Install the swagger-java-client jar, which is used to communicate with Higgs, and build: + + mvn -B install:install-file -Dfile="./lib/swagger-java-client-1.0.0.jar" \ + -DgroupId="io.swagger" \ + -DartifactId="swagger-java-client" \ + -Dversion="1.0.0" \ + -Dpackaging="jar" \ + -DgeneratePom="true" + mvn clean install - Edit the `properties/login.properties` file with the information you like. - Run the bot with the following command: diff --git a/pom.xml b/pom.xml index 979a3a0..46b64c3 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 1.7.1 - 1.8 + 11 UTF-8 UTF-8 @@ -27,13 +27,18 @@ org.slf4j - slf4j-log4j12 - 1.7.32 + slf4j-api + 2.0.10 + + + org.slf4j + slf4j-reload4j + 2.0.10 org.xerial sqlite-jdbc - 3.42.0.0 + 3.45.0.0 io.swagger @@ -44,22 +49,22 @@ org.threeten threetenbp - 1.5.2 + 1.6.8 com.google.code.gson gson - 2.8.9 + 2.10.1 org.jsoup jsoup - 1.15.3 + 1.17.2 org.junit.jupiter junit-jupiter-engine - 5.8.1 + 5.10.1 test @@ -86,7 +91,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -100,12 +105,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.2 + 3.3.1 com.puppycrawl.tools checkstyle - 9.1 + 10.12.7 @@ -119,7 +124,7 @@ ${project.basedir}/checkstyle_checks.xml - UTF-8 + UTF-8 true true @@ -127,7 +132,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.4 + 3.5.1 package @@ -157,7 +162,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.2.5 diff --git a/src/test/java/bugs/stackoverflow/belisarius/utils/PostUtilsTest.java b/src/test/java/bugs/stackoverflow/belisarius/utils/PostUtilsTest.java index db3e36e..7ecde5a 100644 --- a/src/test/java/bugs/stackoverflow/belisarius/utils/PostUtilsTest.java +++ b/src/test/java/bugs/stackoverflow/belisarius/utils/PostUtilsTest.java @@ -63,8 +63,6 @@ public void getPostObjectTest() { } } - /** - * These test are may become not valid over time since posts changes (new edits/post deleted), for now I'm (@Petter) removing them. Static content would be needed. @Test public void getVandalisedPostTest() { try { @@ -74,25 +72,25 @@ public void getVandalisedPostTest() { assertNull(deletedPost); Map> vandalisedPosts = new HashMap<>(); - List lowSeverityPosts = new ArrayList<>(); - lowSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("66373993"))); // removed code Q - lowSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("63575223"))); // text removed Q - lowSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("64296039"))); // text removed A - lowSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("63769100"))); // both of the above + List low = new ArrayList<>(); + low.add(PostUtils.getVandalisedPost(belisarius.getPost("66373993"))); // removed code Q + low.add(PostUtils.getVandalisedPost(belisarius.getPost("63575223"))); // text removed Q + low.add(PostUtils.getVandalisedPost(belisarius.getPost("64296039"))); // text removed A + low.add(PostUtils.getVandalisedPost(belisarius.getPost("63769100"))); // both of the above - List mediumSeverityPosts = new ArrayList<>(); + List medium = new ArrayList<>(); // blacklisted word(s) - mediumSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("27421094"))); - mediumSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("31883097"))); - mediumSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("64643310"))); - mediumSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("64123548"))); // very long word + medium.add(PostUtils.getVandalisedPost(belisarius.getPost("63193055"))); + medium.add(PostUtils.getVandalisedPost(belisarius.getPost("31883097"))); + medium.add(PostUtils.getVandalisedPost(belisarius.getPost("64643310"))); + medium.add(PostUtils.getVandalisedPost(belisarius.getPost("64123548"))); // very long word - List highSeverityPosts = new ArrayList<>(); - highSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("62812593"))); // offensive word + List high = new ArrayList<>(); + high.add(PostUtils.getVandalisedPost(belisarius.getPost("62812593"))); // offensive word - vandalisedPosts.put("low", lowSeverityPosts); - vandalisedPosts.put("medium", mediumSeverityPosts); - vandalisedPosts.put("high", highSeverityPosts); + vandalisedPosts.put("low", low); + vandalisedPosts.put("medium", medium); + vandalisedPosts.put("high", high); for (Map.Entry> post : vandalisedPosts.entrySet()) { for (VandalisedPost vandalisedPost : post.getValue()) { @@ -103,5 +101,4 @@ public void getVandalisedPostTest() { exception.printStackTrace(); } } - */ }