-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slightly refactor the code, add integration test
- Loading branch information
Showing
9 changed files
with
120 additions
and
32 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
38 changes: 38 additions & 0 deletions
38
src/functionalTest/kotlin/kotlinx/validation/test/NonPublicMarkersTest.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,38 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package kotlinx.validation.test | ||
|
||
import kotlinx.validation.api.* | ||
import org.junit.* | ||
|
||
class NonPublicMarkersTest : BaseKotlinGradleTest() { | ||
|
||
@Test | ||
fun testIgnoredMarkersOnProperties() { | ||
val runner = test { | ||
buildGradleKts { | ||
resolve("examples/gradle/base/withPlugin.gradle.kts") | ||
resolve("examples/gradle/configuration/nonPublicMarkers/markers.gradle.kts") | ||
} | ||
|
||
kotlin("Properties.kt") { | ||
resolve("examples/classes/Properties.kt") | ||
} | ||
|
||
apiFile(projectName = rootProjectDir.name) { | ||
resolve("examples/classes/Properties.dump") | ||
} | ||
|
||
runner { | ||
arguments.add(":apiCheck") | ||
} | ||
} | ||
|
||
runner.build().apply { | ||
assertTaskSuccess(":apiCheck") | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/functionalTest/resources/examples/classes/Properties.dump
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,10 @@ | ||
public final class foo/ClassWithProperties { | ||
public fun <init> ()V | ||
} | ||
|
||
public abstract interface annotation class foo/HiddenField : java/lang/annotation/Annotation { | ||
} | ||
|
||
public abstract interface annotation class foo/HiddenProperty : java/lang/annotation/Annotation { | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
src/functionalTest/resources/examples/classes/Properties.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,20 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
package foo | ||
|
||
@Target(AnnotationTarget.FIELD) | ||
annotation class HiddenField | ||
|
||
@Target(AnnotationTarget.PROPERTY) | ||
annotation class HiddenProperty | ||
|
||
public class ClassWithProperties { | ||
@HiddenField | ||
var bar1 = 42 | ||
|
||
@HiddenProperty | ||
var bar2 = 42 | ||
} | ||
|
9 changes: 9 additions & 0 deletions
9
...unctionalTest/resources/examples/gradle/configuration/nonPublicMarkers/markers.gradle.kts
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 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
configure<kotlinx.validation.ApiValidationExtension> { | ||
nonPublicMarkers.add("foo.HiddenField") | ||
nonPublicMarkers.add("foo.HiddenProperty") | ||
} |
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