Skip to content

Commit

Permalink
Migration task testdata
Browse files Browse the repository at this point in the history
Part of #375
  • Loading branch information
ruiAzevedo19 committed Dec 20, 2024
1 parent 68ed8c0 commit 558af0a
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 0 deletions.
56 changes: 56 additions & 0 deletions testdata/java/migrate/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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>

<groupId>eval.dev.quality</groupId>
<artifactId>plain</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>4.5.2</version>
<configuration>
<generateHtml>false</generateHtml>
<generateJson>false</generateJson>
<generatePdf>false</generatePdf>
<generateXml>true</generateXml>
<includeFailedTestCoverage>true</includeFailedTestCoverage>
<showInnerFunctions>true</showInnerFunctions>
<showLambdaFunctions>true</showLambdaFunctions>
<singleCloverDatabase>true</singleCloverDatabase>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
</plugins>
</build>
</project>
5 changes: 5 additions & 0 deletions testdata/java/migrate/repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tasks": [
"migrate"
]
}
7 changes: 7 additions & 0 deletions testdata/java/migrate/src/main/java/com/eval/Decrement.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.eval;

public class Decrement {
public static int decrement(int i) {
return i - 1;
}
}
7 changes: 7 additions & 0 deletions testdata/java/migrate/src/main/java/com/eval/Increment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.eval;

public class Increment {
public static int increment(int i) {
return i + 1;
}
}
15 changes: 15 additions & 0 deletions testdata/java/migrate/src/test/java/com/eval/DecrementTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.eval;

import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class DecrementTest {
@Test
public void decrement() {
int i = 1;
int expected = 0;
int actual = Decrement.decrement(i);

assertEquals(expected, actual);
}
}
15 changes: 15 additions & 0 deletions testdata/java/migrate/src/test/java/com/eval/IncrementTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.eval;

import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class IncrementTest {
@Test
public void increment() {
int i = 1;
int expected = 2;
int actual = Increment.increment(i);

assertEquals(expected, actual);
}
}

0 comments on commit 558af0a

Please sign in to comment.