Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ scripts/dockerize/dockerfiles
/jdk_21_maven/cs/rest/joinus/target/
/jdk_21_maven/em/external/rest/joinus/target/
/jdk_21_maven/em/embedded/rest/joinus/target/
/jdk_21_maven/cs/rest/lovemining/target/
/jdk_21_maven/em/external/rest/lovemining/target/
/jdk_21_maven/em/embedded/rest/lovemining/target/
/jdk_11_maven/em/embedded/rest/tracking-system/target/
/jdk_11_maven/em/external/rest/tracking-system/target/
/jdk_17_maven/em/embedded/rest/tiltaksgjennomforing/target/
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ How to setup authentication information, based on the current content of the ini
Auth configuration files can found in the [auth](auth) folder.


### REST: Java/Kotlin (41)
### REST: Java/Kotlin (42)

* **Arimaa** (not-known license), [jdk_21_maven/cs/rest/arimaa](jdk_21_maven/cs/rest/arimaa), from [https://github.com/KEAArimaaProject/arimaa-backend](https://github.com/KEAArimaaProject/arimaa-backend)

Expand Down Expand Up @@ -117,6 +117,8 @@ Auth configuration files can found in the [auth](auth) folder.

* **Languagetool** (LGPL), [jdk_8_maven/cs/rest/original/languagetool](jdk_8_maven/cs/rest/original/languagetool), from [https://github.com/languagetool-org/languagetool](https://github.com/languagetool-org/languagetool)

* **LoveMining** (not-known license), [jdk_21_maven/cs/rest/lovemining](jdk_21_maven/cs/rest/lovemining), from [https://github.com/Andryd22/LoveMining](https://github.com/Andryd22/LoveMining)

* **Market** (MIT), [jdk_11_maven/cs/rest-gui/market](jdk_11_maven/cs/rest-gui/market), from [https://github.com/aleksey-lukyanets/market](https://github.com/aleksey-lukyanets/market)

* **Microcks** (Apache), [jdk_21_maven/cs/rest-gui/microcks](jdk_21_maven/cs/rest-gui/microcks), from [https://github.com/microcks/microcks](https://github.com/microcks/microcks)
Expand Down
17 changes: 17 additions & 0 deletions auth/lovemining-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
auth:
- name: wfd_admin1
fixedHeaders:
- name: Authorization
value: Basic d2ZkX2FkbWluMUB3ZmQuaW52YWxpZDpXZmQtQWRtaW4tUGFzczE=
- name: wfd_admin2
fixedHeaders:
- name: Authorization
value: Basic d2ZkX2FkbWluMkB3ZmQuaW52YWxpZDpXZmQtQWRtaW4tUGFzczI=
- name: wfd_user1
fixedHeaders:
- name: Authorization
value: Basic d2ZkX3VzZXIxQHdmZC5pbnZhbGlkOldmZC1Vc2VyLVBhc3Mx
- name: wfd_user2
fixedHeaders:
- name: Authorization
value: Basic d2ZkX3VzZXIyQHdmZC5pbnZhbGlkOldmZC1Vc2VyLVBhc3My
38 changes: 38 additions & 0 deletions dockerfiles/additional_files/lovemining/lovemining-mongo-seed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// MODIFIED (WFD-added, not part of the original SUT): the same minimal seed the drivers create -
// only what the API can never produce itself, i.e. ADMIN accounts (/register always writes
// is_admin=false) and reviews older than the glow-up cutoff. Profiles, likes, matches and recent
// reviews are left for the search to create.
// No "_class" field: MongoConfig installs DefaultMongoTypeMapper(null), which strips it.
db = db.getSiblingDB('LoveMining');

const mo = function (m) { return new Date(Date.now() - m * 30 * 24 * 60 * 60 * 1000); };

const ADMIN1_HASH = '$2a$10$Q5Uui.PMfXK0RjKqJek4Cusq5tKmTeUXwm6tdD.HA6LrLew7JK0me'; // Wfd-Admin-Pass1
const ADMIN2_HASH = '$2a$10$Zbu3QxMgPmo1ZunqPxn2SeWuEGJP9RHsBeoCOoKdlfuF8BNn0AnFy'; // Wfd-Admin-Pass2
const USER1_HASH = '$2a$10$3gCReephTyeV2WcmQklcJuEjALyr.sTkTyUKuVmCX7fFyPSAYPFp6'; // Wfd-User-Pass1
const USER2_HASH = '$2a$10$t1QO4YBNJaM5gQk6v9I9EeiBjHO.1EWmKcURu8/NfMaaNrpvRIC3e'; // Wfd-User-Pass2

db.getCollection('users').insertMany([
{ "_id": "wfd_admin1", "Email": "wfd_admin1@wfd.invalid", "Password": ADMIN1_HASH, "is_admin": true },
{ "_id": "wfd_admin2", "Email": "wfd_admin2@wfd.invalid", "Password": ADMIN2_HASH, "is_admin": true },
{
"_id": "wfd_user1", "Email": "wfd_user1@wfd.invalid", "Password": USER1_HASH, "is_admin": false,
"age": 28, "sex": "m", "orientation": "straight", "status": "single",
"city": "pisa", "state": "tuscany",
"essay0": "I love music and travel.", "interests": ["music", "travel"]
},
{
"_id": "wfd_user2", "Email": "wfd_user2@wfd.invalid", "Password": USER2_HASH, "is_admin": false,
"age": 27, "sex": "f", "orientation": "straight", "status": "single",
"city": "pisa", "state": "tuscany",
"essay0": "Music and art are my life.", "interests": ["music", "art"]
}
]);

// Reviews record no author: ReviewDocument has no such field, the link lives in reviews_made.
// Three on one target, spanning the cutoff, is the glow-up minimum. Dates must stay relative.
db.getCollection('reviews').insertMany([
{ "_id": "wfd_rv1", "target_id": "wfd_user1", "rating": 2, "comment": "Conversation was hard work.", "review_date": mo(9) },
{ "_id": "wfd_rv2", "target_id": "wfd_user1", "rating": 1, "comment": "Not my type at all.", "review_date": mo(8) },
{ "_id": "wfd_rv3", "target_id": "wfd_user1", "rating": 5, "comment": "Much better than I expected.", "review_date": mo(1) }
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// MODIFIED (WFD-added, not part of the original SUT): the graph half of the seed the drivers
// create. Admins have no profile, so they get no :User node. No relationship between users is
// seeded - likes, dislikes and matches are left for the search to create.
MERGE (s:State {name: 'tuscany'})
WITH s
UNWIND [
{id: 'wfd_user1', age: 28, sex: 'm', orientation: 'straight', city: 'pisa', interests: ['music', 'travel']},
{id: 'wfd_user2', age: 27, sex: 'f', orientation: 'straight', city: 'pisa', interests: ['music', 'art']}
] AS row
MERGE (c:City {name: row.city})
MERGE (c)-[:LOCATED_IN]->(s)
CREATE (u:User {_id: row.id, age: row.age, sex: row.sex, orientation: row.orientation})
CREATE (u)-[:LIVES_IN]->(c)
WITH u, row
UNWIND row.interests AS name
MERGE (i:Interest {name: name})
CREATE (u)-[:HAS_INTEREST]->(i);
13 changes: 13 additions & 0 deletions dockerfiles/lovemining.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM amazoncorretto:21-alpine-jdk

COPY ./dist/lovemining-sut.jar .
COPY ./dist/jacocoagent.jar .




ENTRYPOINT \
java \
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
-jar lovemining-sut.jar \
--server.port=8080 --spring.data.mongodb.uri=mongodb://db:27017/LoveMining --spring.neo4j.uri=bolt://neo4j:7687 --spring.neo4j.authentication.username=neo4j --spring.neo4j.authentication.password=wfdNeo4jPass123
56 changes: 56 additions & 0 deletions dockerfiles/lovemining.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
services:
mitmproxy:
image: mitmproxy/mitmproxy:10.2.4
user: "0:0"
environment:
MITM_LOG_DIR: /custom-logs
MITM_LOG_FILE: ${MITM_LOG_FILE:-minlog.csv}
command: >
mitmdump
--mode reverse:http://sut-lovemining:8080
--listen-host 0.0.0.0
--listen-port 8080
--set keep_host_header=true
-s /addons/minlog.py
volumes:
- ${HOST_LOG_DIR:-./mitm-logs}:/custom-logs
- ./addons:/addons:ro
ports:
- "${HOST_PORT:-8080}:8080"
depends_on:
- sut-lovemining
sut-lovemining:
image: webfuzzing/wfd-lovemining:FINAL
# build:
# dockerfile: ./dockerfiles/lovemining.dockerfile
# context: ..
environment:
AUTH_PORT: ${AUTH_PORT:-8081}
ports:
- "${JACOCO_PORT:-6300}:6300"
depends_on:
db:
condition: service_healthy
neo4j:
condition: service_healthy
db:
image: mongo:7
volumes:
- ./additional_files/lovemining/lovemining-mongo-seed.js:/docker-entrypoint-initdb.d/lovemining-mongo-seed.js
healthcheck:
test: mongosh --quiet --eval "db.adminCommand('ping')"
interval: 30s
timeout: 30s
retries: 3
neo4j:
image: neo4j:5.26
environment:
NEO4J_AUTH: neo4j/wfdNeo4jPass123
volumes:
- ./additional_files/lovemining/lovemining-neo4j-seed.cypher:/seed.cypher
healthcheck:
test: cypher-shell -u neo4j -p wfdNeo4jPass123 "MATCH (:WfdSeedComplete) RETURN 1"
interval: 30s
timeout: 30s
retries: 3
command: ["bash", "-c", '/startup/docker-entrypoint.sh neo4j & pid=$!; until cypher-shell -u neo4j -p wfdNeo4jPass123 "RETURN 1" >/dev/null 2>&1; do sleep 2; done; cypher-shell -u neo4j -p wfdNeo4jPass123 -f /seed.cypher; cypher-shell -u neo4j -p wfdNeo4jPass123 "CREATE (:WfdSeedComplete)"; wait $pid']
1 change: 1 addition & 0 deletions experiments/bb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __init__(self, name, auth, sleep, schemaformat, classfiles):
"jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/uk/target/classes",
"jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/zh/target/classes",
"jdk_8_maven/cs/rest/original/languagetool/languagetool-server/target/classes"]),
Sut("lovemining",True,SLEEP,JSON,["jdk_21_maven/cs/rest/lovemining/target/classes"]),
Sut("market",True,SLEEP,JSON,["jdk_11_maven/cs/rest-gui/market/market-core/target/classes",
"jdk_11_maven/cs/rest-gui/market/market-rest/target/classes",
"jdk_11_maven/cs/rest-gui/market/market-web/target/classes"]),
Expand Down
1 change: 1 addition & 0 deletions experiments/wb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def __init__(self, name, platform):
Sut("jasper", JDK_25),
Sut("joinus", JDK_21),
Sut("languagetool", JDK_8),
Sut("lovemining", JDK_21),
Sut("market", JDK_11),
Sut("microcks", JDK_21),
Sut("ocvn", JDK_8),
Expand Down
1 change: 1 addition & 0 deletions jacoco.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ COPY jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/tl/
COPY jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/uk/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/uk/target/classes
COPY jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/zh/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/zh/target/classes
COPY jdk_8_maven/cs/rest/original/languagetool/languagetool-server/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/languagetool/languagetool-server/target/classes
COPY jdk_21_maven/cs/rest/lovemining/target/classes ${CLASS_FILES}/jdk_21_maven/cs/rest/lovemining/target/classes
COPY jdk_11_maven/cs/rest-gui/market/market-core/target/classes ${CLASS_FILES}/jdk_11_maven/cs/rest-gui/market/market-core/target/classes
COPY jdk_11_maven/cs/rest-gui/market/market-rest/target/classes ${CLASS_FILES}/jdk_11_maven/cs/rest-gui/market/market-rest/target/classes
COPY jdk_11_maven/cs/rest-gui/market/market-web/target/classes ${CLASS_FILES}/jdk_11_maven/cs/rest-gui/market/market-web/target/classes
Expand Down
6 changes: 6 additions & 0 deletions jdk_21_maven/cs/rest/lovemining/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- MODIFIED-->
<!-- WFD expects a single self-contained "lovemining-sut.jar". The classifier keeps
the plain jar as the main artifact, which the embedded driver depends on. -->
<finalName>lovemining</finalName>
<classifier>sut</classifier>
<!-- MODIFIED-->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ public class MongoConfig extends AbstractMongoClientConfiguration {
@Override
protected String getDatabaseName() { return "LoveMining"; }

// MODIFIED
// The URI was hardcoded to the original deployment VMs, and AbstractMongoClientConfiguration
// makes Spring Boot back off, so no property could override it. Default keeps the old value.
@org.springframework.beans.factory.annotation.Value(
"${spring.data.mongodb.uri:mongodb://10.1.1.14:27017,10.1.1.15:27017,10.1.1.16:27017/?replicaSet=lsmdb}")
private String mongoUri;
// MODIFIED

@Override
@Bean
public MongoClient mongoClient() {
String uri = "mongodb://10.1.1.14:27017,10.1.1.15:27017,10.1.1.16:27017/?replicaSet=lsmdb";
String uri = mongoUri; // MODIFIED

// Write and Read preferences
MongoClientSettings settings = MongoClientSettings.builder().applyConnectionString(new ConnectionString(uri))
Expand Down
1 change: 1 addition & 0 deletions jdk_21_maven/cs/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<module>person-controller</module>
<module>redis-sample</module>
<module>arimaa</module>
<module>lovemining</module>
</modules>


Expand Down
52 changes: 52 additions & 0 deletions jdk_21_maven/em/embedded/rest/lovemining/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>evomaster-benchmark-jdk21-em-embedded-rest-lovemining</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-benchmark-jdk21-em-embedded-rest</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.4.11</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- The SUT as a library -->
<dependency>
<groupId>it.unipi</groupId>
<artifactId>LoveMining</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
</dependency>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
</dependency>
</dependencies>

</project>
Loading
Loading