1
1
/*
2
2
* This file is part of mammoth, licensed under the MIT License.
3
3
*
4
- * Copyright (c) 2021-2022 KyoriPowered
4
+ * Copyright (c) 2021-2024 KyoriPowered
5
5
*
6
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
* of this software and associated documentation files (the "Software"), to deal
37
37
import java .util .regex .Pattern ;
38
38
import org .gradle .testkit .runner .BuildResult ;
39
39
import org .gradle .testkit .runner .GradleRunner ;
40
- import org .jetbrains .annotations .NotNull ;
41
40
import org .junit .jupiter .api .Assertions ;
42
41
43
42
import static java .util .Objects .requireNonNull ;
@@ -78,11 +77,11 @@ public final class TestContext {
78
77
* @return the output directory
79
78
* @since 1.1.0
80
79
*/
81
- public @ NotNull Path outputDirectory () {
80
+ public Path outputDirectory () {
82
81
return this .outputDirectory ;
83
82
}
84
83
85
- @ NotNull String gradleVersion () {
84
+ String gradleVersion () {
86
85
return this .gradleVersion ;
87
86
}
88
87
@@ -93,7 +92,7 @@ public final class TestContext {
93
92
* @throws IOException if an error occurs writing the input file to disk
94
93
* @since 1.1.0
95
94
*/
96
- public void copyInput (final @ NotNull String name ) throws IOException {
95
+ public void copyInput (final String name ) throws IOException {
97
96
this .copyInput (name , name );
98
97
}
99
98
@@ -105,7 +104,7 @@ public void copyInput(final @NotNull String name) throws IOException {
105
104
* @throws IOException if an error occurs writing the input file to disk
106
105
* @since 1.1.0
107
106
*/
108
- public void copyInput (final @ NotNull String fromName , final @ NotNull String toName ) throws IOException {
107
+ public void copyInput (final String fromName , final String toName ) throws IOException {
109
108
requireNonNull (fromName , "fromName" );
110
109
requireNonNull (toName , "toName" );
111
110
try (final InputStream is = this .resourceBase .getResourceAsStream (this .testName + "/in/" + fromName )) {
@@ -130,7 +129,7 @@ public void copyInput(final @NotNull String fromName, final @NotNull String toNa
130
129
* @throws IOException if an error occurs writing the text
131
130
* @since 1.2.0
132
131
*/
133
- public void writeText (final @ NotNull String destination , final @ NotNull String text ) throws IOException {
132
+ public void writeText (final String destination , final String text ) throws IOException {
134
133
requireNonNull (destination , "destination" );
135
134
requireNonNull (text , "text" );
136
135
@@ -149,7 +148,7 @@ public void writeText(final @NotNull String destination, final @NotNull String t
149
148
* @throws IOException if thrown while attempting to read the output file
150
149
* @since 1.1.0
151
150
*/
152
- public @ NotNull String readOutput (final @ NotNull String fileName ) throws IOException {
151
+ public String readOutput (final String fileName ) throws IOException {
153
152
final StringBuilder builder = new StringBuilder ();
154
153
try (final BufferedReader reader = Files .newBufferedReader (this .outputDirectory .resolve (fileName ), StandardCharsets .UTF_8 )) {
155
154
final char [] buffer = new char [8192 ];
@@ -169,7 +168,7 @@ public void writeText(final @NotNull String destination, final @NotNull String t
169
168
* @throws IOException if an error occurs reading the text
170
169
* @since 1.2.0
171
170
*/
172
- public void assertOutputEqualsLiteral (final @ NotNull String destination , final @ NotNull String text ) throws IOException {
171
+ public void assertOutputEqualsLiteral (final String destination , final String text ) throws IOException {
173
172
requireNonNull (destination , "destination" );
174
173
requireNonNull (text , "text" );
175
174
@@ -188,7 +187,7 @@ public void assertOutputEqualsLiteral(final @NotNull String destination, final @
188
187
* @throws IOException if failed to read one of the files
189
188
* @since 1.1.0
190
189
*/
191
- public void assertOutputEquals (final @ NotNull String resourceName , final @ NotNull String fileName ) throws IOException {
190
+ public void assertOutputEquals (final String resourceName , final String fileName ) throws IOException {
192
191
final String actualOutput = this .readOutput (fileName );
193
192
194
193
final StringBuilder builder = new StringBuilder ();
@@ -215,7 +214,7 @@ public void assertOutputEquals(final @NotNull String resourceName, final @NotNul
215
214
* @return the new runner
216
215
* @since 1.1.0
217
216
*/
218
- public @ NotNull GradleRunner runner (final @ NotNull String @ NotNull ... extraArgs ) {
217
+ public GradleRunner runner (final String ... extraArgs ) {
219
218
final List <String > args = new ArrayList <>(this .commonArguments .size () + extraArgs .length );
220
219
args .addAll (this .commonArguments );
221
220
Collections .addAll (args , extraArgs );
@@ -234,7 +233,7 @@ public void assertOutputEquals(final @NotNull String resourceName, final @NotNul
234
233
* @return the result of an executed build
235
234
* @since 1.1.0
236
235
*/
237
- public @ NotNull BuildResult build (final @ NotNull String @ NotNull ... extraArgs ) {
236
+ public BuildResult build (final String ... extraArgs ) {
238
237
return this .runner (extraArgs ).build ();
239
238
}
240
239
0 commit comments