Skip to content

Commit

Permalink
Update README info, bump dependencies, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jan 23, 2024
1 parent cbc837e commit 77b168f
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 44 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified database/belisarius.db
Binary file not shown.
19 changes: 14 additions & 5 deletions docs/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 19 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.7.1</version>

<properties>
<project.java.version>1.8</project.java.version>
<project.java.version>11</project.java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand All @@ -27,13 +27,18 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.32</version>
<artifactId>slf4j-api</artifactId>
<version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.42.0.0</version>
<version>3.45.0.0</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
Expand All @@ -44,22 +49,22 @@
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>1.5.2</version>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
<version>1.17.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.1</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -86,7 +91,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
Expand All @@ -100,12 +105,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<version>3.3.1</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>9.1</version>
<version>10.12.7</version>
</dependency>
</dependencies>
<executions>
Expand All @@ -119,15 +124,15 @@
</executions>
<configuration>
<configLocation>${project.basedir}/checkstyle_checks.xml</configLocation>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -157,7 +162,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -74,25 +72,25 @@ public void getVandalisedPostTest() {
assertNull(deletedPost);

Map<String, List<VandalisedPost>> vandalisedPosts = new HashMap<>();
List<VandalisedPost> 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<VandalisedPost> 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<VandalisedPost> mediumSeverityPosts = new ArrayList<>();
List<VandalisedPost> 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<VandalisedPost> highSeverityPosts = new ArrayList<>();
highSeverityPosts.add(PostUtils.getVandalisedPost(belisarius.getPost("62812593"))); // offensive word
List<VandalisedPost> 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<String, List<VandalisedPost>> post : vandalisedPosts.entrySet()) {
for (VandalisedPost vandalisedPost : post.getValue()) {
Expand All @@ -103,5 +101,4 @@ public void getVandalisedPostTest() {
exception.printStackTrace();
}
}
*/
}

0 comments on commit 77b168f

Please sign in to comment.