Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Adjust Gradle to JUnit 5
Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10
  • Loading branch information
manticore-projects committed Nov 28, 2021
commit 6dfa05f7315de800b5dd6033dee6f6f9329698e2
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
gradlePluginPortal()
mavenLocal()
mavenCentral()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
Expand All @@ -36,6 +40,12 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'

// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testImplementation 'org.mockito:mockito-junit-jupiter:4.1.0'

// enforce latest version of JavaCC
javacc 'net.java.dev.javacc:javacc:7.0.10'

}

compileJavacc {
Expand All @@ -56,6 +66,18 @@ jacoco {
}

test {
useJUnitPlatform()

// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "1G"

jvmArgs << [
'-Djunit.jupiter.execution.parallel.enabled=true',
'-Djunit.jupiter.execution.parallel.config.strategy=dynamic',
'-Djunit.jupiter.execution.parallel.mode.default=concurrent'
]

finalizedBy jacocoTestReport // report is always generated after tests run
finalizedBy jacocoTestCoverageVerification
}
Expand Down Expand Up @@ -93,7 +115,7 @@ jacocoTestCoverageVerification {
limit {
counter = 'LINE'
value = 'MISSEDCOUNT'
maximum = 5458
maximum = 5500
}
excludes = [
'net.sf.jsqlparser.util.validation.*',
Expand Down
12 changes: 12 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1G -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError

org.gradle.caching=true

# Modularise your project and enable parallel build
org.gradle.parallel=true

# Enable configure on demand.
org.gradle.configureondemand=true

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.CONCURRENT)
public class SelectTest {

private final CCJSqlParserManager parserManager = new CCJSqlParserManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import net.sf.jsqlparser.test.TestException;
import net.sf.jsqlparser.util.TablesNamesFinder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.CONCURRENT)
public class SpeedTest {

private final static int NUM_REPS_500 = 500;
Expand Down