-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable path for validation files
- Loading branch information
Showing
13 changed files
with
151 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group = 'de.cronn' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
compileJava.options.encoding = 'UTF-8' | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation project(':') | ||
|
||
testImplementation "org.junit.jupiter:junit-jupiter:latest.release" | ||
testImplementation "org.assertj:assertj-core:latest.release" | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencyLocking { | ||
lockAllConfigurations() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is a Gradle generated file for dependency locking. | ||
# Manual edits can break the build and are not advised. | ||
# This file is expected to be part of source control. | ||
com.googlecode.java-diff-utils:diffutils:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath | ||
net.bytebuddy:byte-buddy:1.12.21=testCompileClasspath,testRuntimeClasspath | ||
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath | ||
org.assertj:assertj-core:3.24.2=testCompileClasspath,testRuntimeClasspath | ||
org.junit.jupiter:junit-jupiter-api:5.10.0=testCompileClasspath,testRuntimeClasspath | ||
org.junit.jupiter:junit-jupiter-engine:5.10.0=testRuntimeClasspath | ||
org.junit.jupiter:junit-jupiter-params:5.10.0=testCompileClasspath,testRuntimeClasspath | ||
org.junit.jupiter:junit-jupiter:5.10.0=testCompileClasspath,testRuntimeClasspath | ||
org.junit.platform:junit-platform-commons:1.10.0=testCompileClasspath,testRuntimeClasspath | ||
org.junit.platform:junit-platform-engine:1.10.0=testRuntimeClasspath | ||
org.junit:junit-bom:5.10.0=testCompileClasspath,testRuntimeClasspath | ||
org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath | ||
empty=annotationProcessor,testAnnotationProcessor |
16 changes: 16 additions & 0 deletions
16
configuration-test/src/test/java/de/cronn/configurationtest/ConfigurablePathTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.cronn.configurationtest; | ||
|
||
import de.cronn.assertions.validationfile.TestData; | ||
|
||
import de.cronn.assertions.validationfile.junit5.JUnit5ValidationFileAssertions; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class ConfigurablePathTest implements JUnit5ValidationFileAssertions { | ||
|
||
@Test | ||
void testPath_withImplementedConfiguration() { | ||
assertWithFile(TestData.TEST_OUTPUT_DATA_DIR.toString()); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
configuration-test/src/test/java/de/cronn/configurationtest/config/TestConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.cronn.configurationtest.config; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import de.cronn.assertions.validationfile.config.Configuration; | ||
|
||
public class TestConfiguration implements Configuration { | ||
|
||
public static final Path PATH = Paths.get("src", "test", "resources", "data"); | ||
|
||
@Override | ||
public Path getDataDirectory() { | ||
return PATH; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
.../test/resources/META-INF/services/de.cronn.assertions.validationfile.config.Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
de.cronn.configurationtest.config.TestConfiguration |
1 change: 1 addition & 0 deletions
1
.../resources/data/validation/ConfigurablePathTest_testPath_withImplementedConfiguration.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/test/resources/data/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
rootProject.name = 'validation-file-assertions' | ||
include ':configuration-test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/de/cronn/assertions/validationfile/config/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package de.cronn.assertions.validationfile.config; | ||
|
||
import java.nio.file.Path; | ||
|
||
public interface Configuration { | ||
|
||
Path getDataDirectory(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./gradlew --refresh-dependencies dependencies --update-locks '*:*' | ||
./gradlew --refresh-dependencies dependencies configuration-test:dependencies --update-locks '*:*' |