Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency bump #22

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true

[*.kt]
[*.{kt,kts}]
continuation_indent_size = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true

[*.{java,gradle}]
continuation_indent_size = 8
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ jacoco {
toolVersion = jacocoVersion
}

kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(project.ext.javaVersion.majorVersion)
}
java {
sourceCompatibility = project.ext.javaVersion
targetCompatibility = project.ext.javaVersion
}

tasks.withType(KotlinCompile).all {
Expand Down
54 changes: 26 additions & 28 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
ext {
javaVersion = JavaVersion.VERSION_1_8
gradleVersion = '7.5.1'
gradleVersion = '8.3'
squitVersion = '5.1.0'

gradlePublishVersion = '1.1.0'
gradlePublishVersion = '1.2.1'

kotlinVersion = '1.7.21'
dokkaVersion = '1.7.20'
kotlinVersion = '1.9.10'
dokkaVersion = '1.8.20'

jacocoVersion = '0.8.8'
gradleVersionsVersion = '0.44.0'
gradleTestIdeaFixVersion = '0.1.0'
jacocoVersion = '0.8.10'
gradleVersionsVersion = '0.47.0'

jaxenVersion = '1.2.0'
dom4jVersion = '2.1.3'
jaxenVersion = '2.0.0'
dom4jVersion = '2.1.4'
pullParserVersion = '2.1.10'
gsonVersion = '2.10'
xmlSecVersion = '3.0.1'
xmlUnitVersion = '2.9.0'
jsonUnitVersion = '2.36.0'
gsonVersion = '2.10.1'
xmlSecVersion = '3.0.2'
xmlUnitVersion = '2.9.1'
jsonUnitVersion = '2.38.0'
typesafeConfigVersion = '1.4.2'
okhttpVersion = '4.10.0'
kotlinHtmlVersion = '0.8.0'
okhttpVersion = '4.11.0'
kotlinHtmlVersion = '0.9.1'
diffUtilsVersion = '3.0'
alphanumericComparatorVersion = "1.4.1"

bootstrapVersion = '4.6.0'
jqueryVersion = '3.6.0'
bootstrapVersion = '5.3.1'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to upgrade this we also need to update the frontend since this version is not backwards compatible.

jqueryVersion = '3.7.0'
popperVersion = '1.16.1'
fontAwesomeVersion = '5.15.4'
diff2htmlVersion = '3.1.7'
markedVersion = '2.0.6'
fontAwesomeVersion = '6.4.2'
diff2htmlVersion = '3.4.29'
markedVersion = '7.0.3'
Comment on lines +28 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also manually test the other frontend dependencies.


detektVersion = '1.21.0'
ktlintPluginVersion = '11.0.0'
detektVersion = '1.23.1'
ktlintPluginVersion = '11.5.1'

junitVersion = '5.9.1'
junitPlatformVersion = '1.7.2'
kluentVersion = '1.72'
h2Version = '2.1.214'
mockkVersion = '1.13.2'
byteBuddyVersion = '1.12.19'
junitVersion = '5.10.0'
kluentVersion = '1.73'
h2Version = '2.2.220'
mockkVersion = '1.13.7'
byteBuddyVersion = '1.14.7'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions src/main/kotlin/de/smartsquare/squit/SquitPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SquitPlugin : Plugin<Project> {
override fun apply(project: Project) {
if (GradleVersion.current() < GradleVersion.version("6.8")) {
throw GradleException(
"Minimum supported Gradle version is 6.8. Current version is ${GradleVersion.current().version}."
"Minimum supported Gradle version is 6.8. Current version is ${GradleVersion.current().version}.",
)
}

Expand Down Expand Up @@ -51,7 +51,7 @@ class SquitPlugin : Plugin<Project> {
extension.xml.strict,
extension.xml.canonicalize,
extension.xml.resolveInvalidNamespaces,
extension.json.canonicalize
extension.json.canonicalize,
)

it.dependsOn("squitPostProcess")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ val Config.databaseConfigurations
it.getString(DATABASE_CONFIGURATION_NAME),
it.getString(DATABASE_CONFIGURATION_JDBC_ADDRESS),
it.getString(DATABASE_CONFIGURATION_USERNAME),
it.getString(DATABASE_CONFIGURATION_PASSWORD)
it.getString(DATABASE_CONFIGURATION_PASSWORD),
)
}

Expand Down Expand Up @@ -166,7 +166,7 @@ fun Config.mergeTag(tag: String): Config = withValue(TAGS, ConfigValueFactory.fr
*/
fun Config.withTestDir(testDir: Path): Config = withValue(
TEST_DIRECTORY,
ConfigValueFactory.fromAnyRef(testDir.toString())
ConfigValueFactory.fromAnyRef(testDir.toString()),
)

/**
Expand Down Expand Up @@ -204,7 +204,7 @@ fun Config.writeTo(
options: ConfigRenderOptions = ConfigRenderOptions.defaults()
.setComments(false)
.setOriginComments(false)
.setJson(false)
.setJson(false),
): Path = Files.write(path, root().render(options).toByteArray())

private fun Config.getSafeBoolean(path: String, fallback: Boolean = false) = when (hasPath(path)) {
Expand All @@ -219,7 +219,7 @@ private fun Config.getSafeString(path: String, fallback: String = "") = when (ha

private fun Config.getSafeStringList(
path: String,
fallback: List<String> = emptyList()
fallback: List<String> = emptyList(),
): List<String> = when (hasPath(path)) {
true -> getStringList(path)
false -> fallback
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/de/smartsquare/squit/config/TestIndexer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class TestIndexer(private val projectConfig: Config) {
private fun indexConfigs(
leafDirectories: Sequence<Path>,
sourceDir: Path,
filter: (Pair<Path, Config>) -> Boolean
filter: (Pair<Path, Config>) -> Boolean,
): List<Pair<Path, Config>> {
return leafDirectories
.onEach { path ->
if (path.cut(sourceDir).toList().size < 2) {
throw GradleException(
"Invalid project structure. Please add a project directory to the src/squit directory."
"Invalid project structure. Please add a project directory to the src/squit directory.",
)
}
}
Expand All @@ -72,7 +72,7 @@ class TestIndexer(private val projectConfig: Config) {
|Invalid test.conf or local.conf file on path of test:
| ${leafDirectory.cut(sourceDir)} ($innerMessage)
""".trimMargin().replace("\n", ""),
error
error,
)
}
}
Expand All @@ -81,7 +81,7 @@ class TestIndexer(private val projectConfig: Config) {

private fun indexTests(
leafDirectoriesWithConfig: List<Pair<Path, Config>>,
sourceDir: Path
sourceDir: Path,
): List<SquitTest> {
return leafDirectoriesWithConfig
.filterNot { (path, _) -> FilesUtils.isDirectoryEmpty(path) }
Expand Down Expand Up @@ -169,15 +169,15 @@ class TestIndexer(private val projectConfig: Config) {

private fun resolveResponse(path: Path, config: Config): Path {
return FilesUtils.validateExistence(
path.resolve(MediaTypeFactory.sourceResponse(config.mediaType))
path.resolve(MediaTypeFactory.sourceResponse(config.mediaType)),
)
}

private fun resolveSqlScripts(
path: Path,
config: Config,
leafs: List<Path>,
leafPath: Path
leafPath: Path,
): Map<String, SqlScripts> {
return config.databaseConfigurations.associate { databaseConfig ->
val pre = FilesUtils.ifExists(path.resolve("${databaseConfig.name}_pre.sql"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ data class SquitDatabaseConfiguration(
val name: String,
val jdbcAddress: String,
val username: String,
val password: String
val password: String,
)
6 changes: 3 additions & 3 deletions src/main/kotlin/de/smartsquare/squit/entity/SquitMetaInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class SquitMetaInfo(val date: LocalDateTime, val duration: Long) {

return SquitMetaInfo(
LocalDateTime.parse(config.getString(DATE)),
config.getLong(DURATION)
config.getLong(DURATION),
)
}
}
Expand All @@ -36,7 +36,7 @@ data class SquitMetaInfo(val date: LocalDateTime, val duration: Long) {
fun toJson(): String = Gson().toJson(
mapOf(
DATE to date.toString(),
DURATION to duration
)
DURATION to duration,
),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ data class SquitResponseInfo(val responseCode: Int = 0) {
*/
fun toJson(): String = GsonBuilder().setPrettyPrinting().create().toJson(
mapOf(
RESPONSE_CODE to responseCode
)
RESPONSE_CODE to responseCode,
),
)

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/de/smartsquare/squit/entity/SquitResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data class SquitResult(
private val contextPath: Path,
private val suitePath: Path,
private val testDirectoryPath: Path,
private val squitBuildDirectoryPath: Path
private val squitBuildDirectoryPath: Path,
) {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data class SquitResultTree(
val name: String,
val successfulTests: Int,
val failedTests: Int,
val ignoredTests: Int
val ignoredTests: Int,
) {

companion object {
Expand All @@ -41,7 +41,7 @@ data class SquitResultTree(
group.first().combinedName,
successfulTests,
failedTests,
ignoredTests
ignoredTests,
)
} else {
SquitResultTree(
Expand All @@ -50,7 +50,7 @@ data class SquitResultTree(
path.first().fileName.toString(),
successfulTests,
failedTests,
ignoredTests
ignoredTests,
)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/de/smartsquare/squit/entity/SquitTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data class SquitTest(
val response: Path,
val preSqlScripts: Map<String, List<Path>>,
val postSqlScripts: Map<String, List<Path>>,
val descriptions: List<Path>
val descriptions: List<Path>,
) : Serializable {

private companion object {
Expand Down Expand Up @@ -58,7 +58,7 @@ data class SquitTest(
response.toString(),
preSqlScripts.mapValues { (_, scripts) -> scripts.map { it.toString() } },
postSqlScripts.mapValues { (_, scripts) -> scripts.map { it.toString() } },
descriptions.map { it.toString() }
descriptions.map { it.toString() },
)
}

Expand All @@ -69,7 +69,7 @@ data class SquitTest(
val response: String,
val preSqlScripts: Map<String, List<String>>,
val postSqlScripts: Map<String, List<String>>,
val descriptions: List<String>
val descriptions: List<String>,
) : Serializable {

private companion object {
Expand All @@ -84,7 +84,7 @@ data class SquitTest(
Paths.get(response),
preSqlScripts.mapValues { (_, scripts) -> scripts.map { Paths.get(it) } },
postSqlScripts.mapValues { (_, scripts) -> scripts.map { Paths.get(it) } },
descriptions.map { Paths.get(it) }
descriptions.map { Paths.get(it) },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface BodyProcessor {
responsePath: Path,
resultRequestPath: Path,
resultResponsePath: Path,
config: Config
config: Config,
)

/**
Expand All @@ -28,6 +28,6 @@ interface BodyProcessor {
actualResponsePath: Path,
expectedResponsePath: Path,
resultActualResponseFilePath: Path,
config: Config
config: Config,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ data class MediaTypeConfig(
@get:Input val xmlStrict: Boolean = true,
@get:Input val xmlCanonicalize: Boolean = true,
@get:Input val resolveInvalidNamespaces: Boolean = false,
@get:Input val jsonCanonicalize: Boolean = true
@get:Input val jsonCanonicalize: Boolean = true,
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GenericBodyProcessor : BodyProcessor {
responsePath: Path,
resultRequestPath: Path,
resultResponsePath: Path,
config: Config
config: Config,
) {
if (requestPath != null) Files.copy(requestPath, resultRequestPath)
Files.copy(responsePath, resultResponsePath)
Expand All @@ -25,7 +25,7 @@ class GenericBodyProcessor : BodyProcessor {
actualResponsePath: Path,
expectedResponsePath: Path,
resultActualResponseFilePath: Path,
config: Config
config: Config,
) {
Files.copy(actualResponsePath, resultActualResponseFilePath)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GenericDiffer : Differ {
val diff = DiffUtils.diff(
expectedResponse.toString(Charset.defaultCharset()),
actualResponse.toString(Charset.defaultCharset()),
null
null,
)

return diff.deltas.joinToString("\n") {
Expand Down
Loading