-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TS-38628 POM cleanup and kotlin tests
- Loading branch information
1 parent
5aa4400
commit 31f7877
Showing
6 changed files
with
88 additions
and
97 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
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
40 changes: 0 additions & 40 deletions
40
teamscale-maven-plugin/src/test/java/com/teamscale/maven/tia/ArgLineTest.java
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
teamscale-maven-plugin/src/test/kotlin/com/teamscale/maven/tia/ArgLineTest.kt
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,41 @@ | ||
package com.teamscale.maven.tia | ||
|
||
import com.teamscale.maven.tia.ArgLine.Companion.removePreviousTiaAgent | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Test | ||
import java.nio.file.Paths | ||
|
||
internal class ArgLineTest { | ||
@Test | ||
fun isIdempotent() { | ||
val argLine = ArgLine( | ||
null, "info", Paths.get("agent.jar"), Paths.get("agent.properties"), | ||
Paths.get("agent.log") | ||
) | ||
val firstArgLine = argLine.prependTo("") | ||
val secondArgLine = argLine.prependTo(removePreviousTiaAgent(firstArgLine)) | ||
|
||
assertEquals(firstArgLine, secondArgLine) | ||
} | ||
|
||
@Test | ||
fun testNullOriginalArgLine() { | ||
val argLine = ArgLine( | ||
null, "info", Paths.get("agent.jar"), Paths.get("agent.properties"), | ||
Paths.get("agent.log") | ||
) | ||
val newArgLine = argLine.prependTo(null) | ||
|
||
assertTrue(newArgLine.startsWith("-Dteamscale.markstart")) | ||
assertTrue(newArgLine.endsWith("-Dteamscale.markend")) | ||
} | ||
|
||
@Test | ||
fun preservesUnrelatedAgents() { | ||
val argLine = "-javaagent:someother.jar" | ||
val newArgLine = removePreviousTiaAgent(argLine) | ||
|
||
assertEquals(argLine, newArgLine) | ||
} | ||
} |