Skip to content

Commit

Permalink
Merge pull request #2 from isaacmaffeis/isaac
Browse files Browse the repository at this point in the history
migrate from evosuite 1.2.0 to 1.0.6
  • Loading branch information
isaacmaffeis authored Aug 23, 2024
2 parents dba8a16 + 3bf644b commit e861345
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 50 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Java CI with Maven

on:
push:
branches: [ "master" ]
branches: [ "*" ]
pull_request:
branches: [ "*" ]

Expand All @@ -27,8 +27,6 @@ jobs:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: install evosuite runtime
run: mvn --batch-mode install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"
- name: Test with Maven
run: mvn --batch-mode clean verify

Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM maven:3.8.4-openjdk-8-slim

# Install Python
RUN apt-get update && apt-get install -y libfreetype6 libfontconfig1

RUN apt-get update && \
apt-get install -y python3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y libfreetype6 libfontconfig1

RUN mkdir -p /app/input
RUN mkdir -p /app/target

COPY pom.xml /app
COPY src /app/src
COPY evosuite-1.2.0.jar app/evosuite-1.2.0.jar
COPY evosuite-standalone-runtime-1.2.0.jar app/evosuite-standalone-runtime-1.2.0.jar
COPY evosuite-1.0.6.jar app/evosuite-1.0.6.jar
COPY scripts /app/scripts

VOLUME ["/app/input"]
Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ To get started, please follow these steps:

4. Setup Maven and Evosuite:
- You can do it manually with the following steps:
- Install the Evosuite Runtime JAR:
```shell
mvn install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"
```
- Compile the Maven Project:
```shell
mvn compile
Expand All @@ -52,7 +48,7 @@ To get started, please follow these steps:
```
- Setup Evosuite:
```shell
java -jar evosuite-standalone-runtime-1.2.0.jar -setup target/classes target/dependency/commons-collections-3.2.2.jar
java -jar evosuite-standalone-runtime-1.0.6.jar -setup target/classes target/dependency/commons-collections-3.2.2.jar
```
- Or simply run the mvn_setup shell script:
```shell
Expand All @@ -62,7 +58,7 @@ To get started, please follow these steps:
5. Generate Test Cases:
- To generate test cases for a specific class, run the following command:
```shell
java -jar evosuite-standalone-runtime-1.2.0.jar -class <inputFile>' -<params>
java -jar evosuite-standalone-runtime-1.0.6.jar -class <inputFile>' -<params>
```
- Or run the python script gen_evosuite_sh.py to generate the shell
script with the desired command:
Expand All @@ -75,15 +71,11 @@ To get started, please follow these steps:
```
- run evosuite app help to see all the available options and params
```shell
java -jar evosuite-1.2.0.jar -help
java -jar evosuite-1.0.6.jar -help
```
6. Test the application
- Install the evosuite-standalone-runtime:
```shell
mvn install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"
```
Copy Generated Test Cases into the project:
- Copy Generated Test Cases into the project:
```shell
cp -r evosuite-tests/* src/test/java/
```
Expand Down
Binary file renamed evosuite-1.2.0.jar → evosuite-1.0.6.jar
Binary file not shown.
Binary file removed evosuite-standalone-runtime-1.2.0.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<!-- install locally -->
<dependency>
<groupId>org.evosuite</groupId>
<artifactId>evosuite-standalone-runtime</artifactId>
<version>1.2.0</version>
<version>1.0.6</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions scripts/gen_evosuite_sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def generate_script(root_path, script_path, extra_args):
class_name = f"{folder_name}.{file_name}"
logger.info(f"class_name: {class_name}")

command = f"java -jar evosuite-1.2.0.jar -class org.evoservice.{class_name}"
command = f"java -jar evosuite-1.0.6.jar -class org.evoservice.{class_name}"
logger.info(f"command without args: {command}")

if extra_args:
command += " " + " ".join(extra_args)

command += "\n"

script_file.write(f'echo "Running evosuite-1.2.0 on {class_name}..."\n')
script_file.write(f'echo "Running evosuite-1.0.6 on {class_name}..."\n')
script_file.write(command)
logger.info(f"script write: {command}")
script_file.write('\necho "gen_evosuite.sh process completed."\n')
Expand Down
16 changes: 7 additions & 9 deletions scripts/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,30 @@ def print_help():
4. Setup Maven and Evosuite:
- You can do it manually with the following steps:
- Install the Evosuite Runtime JAR:
'mvn install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"'
- Compile the Maven Project:
'mvn compile'
- Copy Maven Dependencies:
'mvn dependency:copy-dependencies -DincludeScope=runtime'
- Setup Evosuite:
'java -jar evosuite-standalone-runtime-1.2.0.jar -setup target/classes target/dependency/commons-collections-3.2.2.jar'
'java -jar evosuite-standalone-runtime-1.0.6.jar -setup target/classes target/dependency/commons-collections-3.2.2.jar'
- Or simply run the mvn_setup shell script:
'./scripts/mvn_setup.sh'
5. Generate Test Cases:
- To generate test cases for a specific class, run the following command:
'java -jar evosuite-standalone-runtime-1.2.0.jar -class <inputFile>' -<params>
'java -jar evosuite-standalone-runtime-1.0.6.jar -class <inputFile>' -<params>
- Or run the python script gen_evosuite_sh.py to generate the shell
script with the desired command:
'python3 gen_evosuite_sh.py -<params>'
and then proceed to execute it with:
'./scripts/gen_evosuite.sh'
- run evosuite app help to see all the available options and params
'java -jar evosuite-1.2.0.jar -help'
- run evosuite app help to see all the available options:
'java -jar evosuite-1.0.6.jar -help'
and to see all the evosuite params:
'java -jar evosuite-1.0.6.jar -listParameters '
6. Test the application
- Install the evosuite-standalone-runtime:
mvn install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"
Copy Generated Test Cases into the project:
- Copy Generated Test Cases into the project:
cp -r evosuite-tests/* src/test/java/
and then Run the Test suite:
'mvn test'
Expand Down
15 changes: 1 addition & 14 deletions scripts/mvn_setup.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
#!/bin/bash

JAR_EVOSUITE="evosuite-1.2.0.jar"
JAR_EVOSUITE_RUNTIME="evosuite-standalone-runtime-1.2.0.jar"
GROUP_ID="org.evosuite"
ARTIFACT_ID="evosuite-standalone-runtime"
VERSION="1.2.0"
PACKAGING="jar"
JAR_EVOSUITE="evosuite-1.0.6.jar"
DEPENDENCY_JAR="target/dependency/commons-collections-3.2.2.jar"
TARGET_CLASSES_PATH="target/classes"

echo "# mvn_setup.sh"
echo "## Maven and Evosuite setup"

echo "Installing evosuite-standalone-runtime-1.2.0.jar..."
mvn install:install-file \
-Dfile="$JAR_EVOSUITE_RUNTIME" \
-DgroupId="$GROUP_ID" \
-DartifactId="$ARTIFACT_ID" \
-Dversion="$VERSION" \
-Dpackaging="$PACKAGING"

echo "Running mvn compile..."
mvn compile

Expand Down
3 changes: 0 additions & 3 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
echo "# tests.sh"
echo "## Test the generated test suite"

echo "Installing evosuite-standalone-runtime-1.2.0.jar..."
mvn install:install-file -Dfile="evosuite-standalone-runtime-1.2.0.jar" -DgroupId="org.evosuite" -DartifactId="evosuite-standalone-runtime" -Dversion="1.2.0" -Dpackaging="jar"

echo "Copying Generated Test Cases into the project..."
cp -r evosuite-tests/* src/test/java/

Expand Down

0 comments on commit e861345

Please sign in to comment.