|
| 1 | +/* |
| 2 | + * Copyright 2021 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package com.google.appengine.tools.development; |
| 17 | + |
| 18 | + |
| 19 | +import java.io.File; |
| 20 | +import java.io.IOException; |
| 21 | +import java.util.Arrays; |
| 22 | +import java.util.List; |
| 23 | +import org.junit.Before; |
| 24 | +import org.junit.Test; |
| 25 | +import org.junit.runner.RunWith; |
| 26 | +import org.junit.runners.Parameterized; |
| 27 | + |
| 28 | +@RunWith(Parameterized.class) |
| 29 | +public class JaxRsTest extends DevAppServerTestBase { |
| 30 | + |
| 31 | + @Parameterized.Parameters |
| 32 | + public static List<Object[]> version() { |
| 33 | + // Only EE8 app. |
| 34 | +return Arrays.asList( |
| 35 | + new Object[][] { |
| 36 | + // {"java17", "9.4", "EE6"}, |
| 37 | + {"java17", "12.0", "EE8"}, |
| 38 | + // {"java21", "12.0", "EE8"}, |
| 39 | + // {"java25", "12.1", "EE8"}, |
| 40 | + |
| 41 | + }); |
| 42 | + |
| 43 | + } |
| 44 | + public JaxRsTest(String runtimeVersion, String jettyVersion, String jakartaVersion) { |
| 45 | + super(runtimeVersion, jettyVersion, jakartaVersion); |
| 46 | + } |
| 47 | + |
| 48 | + @Before |
| 49 | + public void setUpClass() throws IOException, InterruptedException { |
| 50 | + File currentDirectory = new File("").getAbsoluteFile(); |
| 51 | + File appRoot = |
| 52 | + new File( |
| 53 | + currentDirectory, |
| 54 | + "../../applications/jaxrs/target/jaxrs" |
| 55 | + + "-" |
| 56 | + + System.getProperty("appengine.projectversion")); |
| 57 | + setUpClass(appRoot); |
| 58 | + } |
| 59 | + |
| 60 | + @Test |
| 61 | + public void testJaxRs() throws Exception { |
| 62 | + // App Engine Memcache access. |
| 63 | + executeHttpGet( |
| 64 | + "/hello", |
| 65 | + "hello\n", |
| 66 | + RESPONSE_200); |
| 67 | + |
| 68 | + } |
| 69 | + |
| 70 | +} |
0 commit comments