|
11 | 11 | class OtelInternalJavadocTest {
|
12 | 12 |
|
13 | 13 | @Test
|
14 |
| - void test() { |
15 |
| - doTest("internal/InternalJavadocPositiveCases.java"); |
16 |
| - doTest("internal/InternalJavadocNegativeCases.java"); |
| 14 | + void positiveCases() { |
| 15 | + CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class) |
| 16 | + .addSourceLines( |
| 17 | + "internal/InternalJavadocPositiveCases.java", |
| 18 | + "/*", |
| 19 | + " * Copyright The OpenTelemetry Authors", |
| 20 | + " * SPDX-License-Identifier: Apache-2.0", |
| 21 | + " */", |
| 22 | + "package io.opentelemetry.gradle.customchecks.internal;", |
| 23 | + "// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers", |
| 24 | + "public class InternalJavadocPositiveCases {", |
| 25 | + " // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers", |
| 26 | + " public static class One {}", |
| 27 | + " /** Doesn't have the disclaimer. */", |
| 28 | + " // BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers", |
| 29 | + " public static class Two {}", |
| 30 | + "}") |
| 31 | + .doTest(); |
17 | 32 | }
|
18 | 33 |
|
19 |
| - private static void doTest(String path) { |
| 34 | + @Test |
| 35 | + void negativeCases() { |
20 | 36 | CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class)
|
21 |
| - .addSourceFile(path) |
| 37 | + .addSourceLines( |
| 38 | + "internal/InternalJavadocNegativeCases.java", |
| 39 | + "/*", |
| 40 | + " * Copyright The OpenTelemetry Authors", |
| 41 | + " * SPDX-License-Identifier: Apache-2.0", |
| 42 | + " */", |
| 43 | + "package io.opentelemetry.gradle.customchecks.internal;", |
| 44 | + "/**", |
| 45 | + " * This class is internal and is hence not for public use. Its APIs are unstable and can change at", |
| 46 | + " * any time.", |
| 47 | + " */", |
| 48 | + "public class InternalJavadocNegativeCases {", |
| 49 | + " /**", |
| 50 | + " * This class is internal and is hence not for public use. Its APIs are unstable and can change at", |
| 51 | + " * any time.", |
| 52 | + " */", |
| 53 | + " public static class One {}", |
| 54 | + " static class Two {}", |
| 55 | + "}") |
22 | 56 | .doTest();
|
23 | 57 | }
|
24 | 58 | }
|
0 commit comments