View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.tools.plugin.javadoc;
20  
21  import java.io.IOException;
22  import java.net.URI;
23  import java.util.stream.Stream;
24  
25  import org.junit.jupiter.api.Tag;
26  import org.junit.jupiter.params.ParameterizedTest;
27  import org.junit.jupiter.params.provider.Arguments;
28  import org.junit.jupiter.params.provider.MethodSource;
29  
30  @Tag("nonLtsJavadocs")
31  class JavadocNonLtsSiteIT extends JavadocSiteIT {
32  
33      // tests against all non-LTS Javadoc sites need to be enabled explicitly via tag "nonLtsJavadocs"
34      static Stream<Arguments> javadocBaseUrls() {
35          return Stream.of(
36                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/20/docs/api/")),
37                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/19/docs/api/")),
38                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/18/docs/api/")),
39                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/16/docs/api/")),
40                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/15/docs/api/")),
41                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/14/docs/api/")),
42                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/13/docs/api/")),
43                  Arguments.of(URI.create("https://docs.oracle.com/en/java/javase/12/docs/api/")),
44                  Arguments.of(URI.create("https://docs.oracle.com/javase/10/docs/api/")),
45                  Arguments.of(URI.create("https://docs.oracle.com/javase/9/docs/api/")),
46                  Arguments.of(URI.create("https://docs.oracle.com/javase/7/docs/api/")),
47                  Arguments.of(URI.create("https://docs.oracle.com/javase/6/docs/api/")),
48                  Arguments.of(URI.create("https://docs.oracle.com/javase/1.5.0/docs/api/")),
49                  Arguments.of(URI.create("https://javaalmanac.io/jdk/1.4/api/index.html")),
50                  Arguments.of(URI.create("https://javaalmanac.io/jdk/1.3/api/index.html")));
51      }
52  
53      @ParameterizedTest
54      @MethodSource("javadocBaseUrls")
55      void testConstructors(URI javadocBaseUrl) throws IOException {
56          super.testConstructors(javadocBaseUrl);
57      }
58  
59      @ParameterizedTest
60      @MethodSource("javadocBaseUrls")
61      void testMethods(URI javadocBaseUrl) throws IOException {
62          super.testMethods(javadocBaseUrl);
63      }
64  
65      @ParameterizedTest
66      @MethodSource("javadocBaseUrls")
67      void testFields(URI javadocBaseUrl) throws IOException {
68          super.testFields(javadocBaseUrl);
69      }
70  
71      @ParameterizedTest
72      @MethodSource("javadocBaseUrls")
73      void testNestedClass(URI javadocBaseUrl) throws IOException {
74          super.testNestedClass(javadocBaseUrl);
75      }
76  }