Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GlassFish 7.0.2 #5611

Merged
merged 4 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ STR_624_SERVER_NAME=GlassFish Server 6.2.4
STR_625_SERVER_NAME=GlassFish Server 6.2.5
STR_700_SERVER_NAME=GlassFish Server 7.0.0
STR_701_SERVER_NAME=GlassFish Server 7.0.1
STR_702_SERVER_NAME=GlassFish Server 7.0.2

# CommonServerSupport.java
MSG_FLAKEY_NETWORK=<html>Network communication problem<br/>Could not establish \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,21 @@ public enum ServerDetails {
*/
GLASSFISH_SERVER_7_0_1(NbBundle.getMessage(ServerDetails.class, "STR_701_SERVER_NAME", new Object[]{}), // NOI18N
"deployer:gfv700ee10", // NOI18N
700,
701,
"https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/7.0.1/glassfish-7.0.1.zip", // NOI18N
"https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/7.0.1/glassfish-7.0.1.zip", // NOI18N
"http://www.eclipse.org/legal/epl-2.0" //NOI18N
),

/**
* details for an instance of GlassFish Server 7.0.2
*/
GLASSFISH_SERVER_7_0_2(NbBundle.getMessage(ServerDetails.class, "STR_702_SERVER_NAME", new Object[]{}), // NOI18N
"deployer:gfv700ee10", // NOI18N
702,
"https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/7.0.2/glassfish-7.0.2.zip", // NOI18N
"https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/7.0.2/glassfish-7.0.2.zip", // NOI18N
"http://www.eclipse.org/legal/epl-2.0" //NOI18N
);

/**
Expand All @@ -323,6 +334,7 @@ public enum ServerDetails {
public static WizardDescriptor.InstantiatingIterator
getInstantiatingIterator() {
return new ServerWizardIterator(new ServerDetails[]{
GLASSFISH_SERVER_7_0_2,
GLASSFISH_SERVER_7_0_1,
GLASSFISH_SERVER_7_0_0,
GLASSFISH_SERVER_6_2_5,
Expand All @@ -348,6 +360,7 @@ public enum ServerDetails {
GLASSFISH_SERVER_3_0_1,
GLASSFISH_SERVER_3},
new ServerDetails[]{
GLASSFISH_SERVER_7_0_2,
GLASSFISH_SERVER_7_0_1,
GLASSFISH_SERVER_7_0_0,
GLASSFISH_SERVER_6_2_5,
Expand Down Expand Up @@ -410,6 +423,7 @@ public static int getVersionFromInstallDirectory(File glassfishDir) {
case GF_6_2_5: return GLASSFISH_SERVER_6_2_5.getVersion();
case GF_7_0_0: return GLASSFISH_SERVER_7_0_0.getVersion();
case GF_7_0_1: return GLASSFISH_SERVER_7_0_1.getVersion();
case GF_7_0_2: return GLASSFISH_SERVER_7_0_2.getVersion();
default: return -1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ static AdminFactory getInstance(final GlassFishVersion version)
case GF_6_2_3:
case GF_6_2_4:
case GF_6_2_5:
case GF_7_0_0:
case GF_7_0_1:
case GF_7_0_2:
return AdminFactoryRest.getInstance();
// Anything else is not unknown.
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ public enum GlassFishVersion {
/** GlassFish 7.0.0 */
GF_7_0_0 ((short) 7, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_7_0_0_STR),
/** GlassFish 7.0.1 */
GF_7_0_1 ((short) 7, (short) 0, (short) 1, (short) 0, GlassFishVersion.GF_7_0_1_STR);
GF_7_0_1 ((short) 7, (short) 0, (short) 1, (short) 0, GlassFishVersion.GF_7_0_1_STR),
/** GlassFish 7.0.2 */
GF_7_0_2 ((short) 7, (short) 0, (short) 2, (short) 0, GlassFishVersion.GF_7_0_2_STR);
////////////////////////////////////////////////////////////////////////////
// Class attributes //
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -260,6 +262,11 @@ public enum GlassFishVersion {
static final String GF_7_0_1_STR = "7.0.1";
/** Additional <code>String</code> representations of GF_7_0_1 value. */
static final String GF_7_0_1_STR_NEXT[] = {"7.0.1", "7.0.1.0"};

/** A {@code String} representation of GF_7_0_2 value. */
static final String GF_7_0_2_STR = "7.0.2";
/** Additional {@code String} representations of GF_7_0_2 value. */
static final String GF_7_0_2_STR_NEXT[] = {"7.0.2", "7.0.2.0"};

/**
* Stored <code>String</code> values for backward <code>String</code>
Expand Down Expand Up @@ -299,6 +306,7 @@ public enum GlassFishVersion {
initStringValuesMapFromArray(GF_6_2_5, GF_6_2_5_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_0, GF_7_0_0_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_1, GF_7_0_1_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_2, GF_7_0_2_STR_NEXT);
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,19 @@ public class ConfigBuilderProvider {
private static final Config.Next CONFIG_V7_0_1
= new Config.Next(GlassFishVersion.GF_7_0_1,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_1.xml"));

/** Library builder configuration since GlassFish 7.0.2. */
private static final Config.Next CONFIG_V7_0_2
= new Config.Next(GlassFishVersion.GF_7_0_2,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_1.xml"));

/** Library builder configuration for GlassFish cloud. */
private static final Config config
= new Config(CONFIG_V3, CONFIG_V4, CONFIG_V4_1, CONFIG_V5,
CONFIG_V5_0_1, CONFIG_V5_1, CONFIG_V6, CONFIG_V6_1_0,
CONFIG_V6_2_0, CONFIG_V6_2_1, CONFIG_V6_2_2,
CONFIG_V6_2_3, CONFIG_V6_2_4, CONFIG_V6_2_5,
CONFIG_V7_0_0, CONFIG_V7_0_1);
CONFIG_V7_0_0, CONFIG_V7_0_1, CONFIG_V7_0_2);

/** Builders array for each server instance. */
private static final Map<GlassFishServer, ConfigBuilder> builders
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->
<server>
<tools lib="lib">
<asadmin jar="client/appserver-cli.jar"/>
</tools>
<java version="20">
<platform version="11"/>
<platform version="12"/>
<platform version="13"/>
<platform version="14"/>
<platform version="15"/>
<platform version="16"/>
<platform version="17"/>
<platform version="18"/>
<platform version="19"/>
<platform version="20"/>
</java>
<javaee version="10.0.0">
<profile version="10.0.0" type="web"/>
<profile version="10.0.0" type="full" check="full"/>
<module type="war"/>
<module type="car" check="full"/>
<module type="ear" check="full"/>
<module type="ejb" check="full"/>
<module type="rar" check="full"/>
<check name="full">
<file path="appclient-server-core.jar"/>
</check>
</javaee>
<library id="Java EE">
<classpath>
<fileset dir="modules">
<include name="jakarta\..+\.jar"/>
<include name="jakarta.enterprise.cdi-api.jar"/>
<include name="jakarta.validation-api.jar"/>
<include name="jaxb-osgi.jar"/>
<include name="webservices-osgi.jar"/>
<include name="weld-osgi-bundle.jar"/>
</fileset>
<fileset dir="modules/endorsed">
<include name=".+\.jar"/>
</fileset>
</classpath>
<javadocs>
<lookup path="docs/jakartaee10-doc-api.jar"/>
</javadocs>
<sources>
</sources>
</library>
<library id="Jersey 3">
<classpath>
<fileset dir="modules">
<include name="jackson.+\.jar"/>
<include name="jersey.+\.jar"/>
<include name="jettison.*\.jar"/>
</fileset>
</classpath>
<javadocs>
<link url="https://repo1.maven.org/maven2/org/glassfish/jersey/jersey-documentation/3.1.1/jersey-documentation-3.1.1-docbook.zip"/>
</javadocs>
<sources>
</sources>
</library>
<library id="JAX-RS">
<classpath>
<fileset dir="modules">
<include name="jakarta.ws.rs-api.jar"/>
</fileset>
</classpath>
<javadocs>
</javadocs>
<sources>
</sources>
</library>
</server>
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,110 @@ public void testGetInstanceforVersionGF3() {
// Stored command entity should be the one we supplied.
assertTrue(cmd.equals(runner.getCommand()));
}

/**
* Test factory functionality for GlassFish v. 4.1.2
* <p/>
* Factory should initialize REST {@code Runner} and point it to
* provided {@code Command} instance.
*/
@Test
public void testGetInstanceforVersionGF4() {
GlassFishServerEntity srv = new GlassFishServerEntity();
srv.setVersion(GlassFishVersion.GF_4_1_2);
AdminFactory af = AdminFactory.getInstance(srv.getVersion());
assertTrue(af instanceof AdminFactoryRest);
Command cmd = new CommandVersion();
Runner runner;
try {
runner = af.getRunner(srv, cmd);
} catch (GlassFishIdeException gfie) {
runner = null;
fail("Exception in Runner initialization: " + gfie.getMessage());
}
// Returned runner should be REST interface.
assertTrue(runner instanceof RunnerRest);
// Stored command entity should be the one we supplied.
assertTrue(cmd.equals(runner.getCommand()));
}

/**
* Test factory functionality for GlassFish v. 5.1.0
* <p/>
* Factory should initialize REST {@code Runner} and point it to
* provided {@code Command} instance.
*/
@Test
public void testGetInstanceforVersionGF5() {
GlassFishServerEntity srv = new GlassFishServerEntity();
srv.setVersion(GlassFishVersion.GF_5_1_0);
AdminFactory af = AdminFactory.getInstance(srv.getVersion());
assertTrue(af instanceof AdminFactoryRest);
Command cmd = new CommandVersion();
Runner runner;
try {
runner = af.getRunner(srv, cmd);
} catch (GlassFishIdeException gfie) {
runner = null;
fail("Exception in Runner initialization: " + gfie.getMessage());
}
// Returned runner should be REST interface.
assertTrue(runner instanceof RunnerRest);
// Stored command entity should be the one we supplied.
assertTrue(cmd.equals(runner.getCommand()));
}

/**
* Test factory functionality for GlassFish v. 6.2.5
* <p/>
* Factory should initialize REST {@code Runner} and point it to
* provided {@code Command} instance.
*/
@Test
public void testGetInstanceforVersionGF6() {
GlassFishServerEntity srv = new GlassFishServerEntity();
srv.setVersion(GlassFishVersion.GF_6_2_5);
AdminFactory af = AdminFactory.getInstance(srv.getVersion());
assertTrue(af instanceof AdminFactoryRest);
Command cmd = new CommandVersion();
Runner runner;
try {
runner = af.getRunner(srv, cmd);
} catch (GlassFishIdeException gfie) {
runner = null;
fail("Exception in Runner initialization: " + gfie.getMessage());
}
// Returned runner should be REST interface.
assertTrue(runner instanceof RunnerRest);
// Stored command entity should be the one we supplied.
assertTrue(cmd.equals(runner.getCommand()));
}

/**
* Test factory functionality for GlassFish v. 7.0.2
* <p/>
* Factory should initialize REST {@code Runner} and point it to
* provided {@code Command} instance.
*/
@Test
public void testGetInstanceforVersionGF7() {
GlassFishServerEntity srv = new GlassFishServerEntity();
srv.setVersion(GlassFishVersion.GF_7_0_2);
AdminFactory af = AdminFactory.getInstance(srv.getVersion());
assertTrue(af instanceof AdminFactoryRest);
Command cmd = new CommandVersion();
Runner runner;
try {
runner = af.getRunner(srv, cmd);
} catch (GlassFishIdeException gfie) {
runner = null;
fail("Exception in Runner initialization: " + gfie.getMessage());
}
// Returned runner should be REST interface.
assertTrue(runner instanceof RunnerRest);
// Stored command entity should be the one we supplied.
assertTrue(cmd.equals(runner.getCommand()));
}

/**
* Test factory functionality for GlassFish using REST administration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class GlassFishVersionTest {
* Test that <code>toValue</code> handles addition values for given version
* and additional values array.
*/
public static void verifyToValueFromAdditionalArray(
private static void verifyToValueFromAdditionalArray(
GlassFishVersion version, String[] values) {
for (String value : values) {
GlassFishVersion gfVersion = GlassFishVersion.toValue(value);
Expand Down Expand Up @@ -101,6 +101,8 @@ public void testToValue() {
GlassFishVersion.GF_7_0_0_STR_NEXT);
verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_1,
GlassFishVersion.GF_7_0_1_STR_NEXT);
verifyToValueFromAdditionalArray(GlassFishVersion.GF_7_0_2,
GlassFishVersion.GF_7_0_2_STR_NEXT);
}

/**
Expand All @@ -122,7 +124,8 @@ public void testToValueIncomplete() {
GlassFishVersion.GF_6_2_0, GlassFishVersion.GF_6_2_1,
GlassFishVersion.GF_6_2_2, GlassFishVersion.GF_6_2_3,
GlassFishVersion.GF_6_2_4, GlassFishVersion.GF_6_2_5,
GlassFishVersion.GF_7_0_0, GlassFishVersion.GF_7_0_1
GlassFishVersion.GF_7_0_0, GlassFishVersion.GF_7_0_1,
GlassFishVersion.GF_7_0_2
};
String strings[] = {
"1.0.1.4", "2.0.1.5", "2.1.0.3", "2.1.1.7",
Expand All @@ -131,7 +134,8 @@ public void testToValueIncomplete() {
"4.1.0.0", "4.1.1.0", "4.1.2.0", "5.0.0.0",
"5.0.1.0", "5.1.0.0", "6.0.0.0", "6.1.0.0",
"6.2.0.0", "6.2.1.0", "6.2.2.0", "6.2.3.0",
"6.2.4.0", "6.2.5.0", "7.0.0.0", "7.0.1.0"
"6.2.4.0", "6.2.5.0", "7.0.0.0", "7.0.1.0",
"7.0.2.0"
};
for (int i = 0; i < versions.length; i++) {
GlassFishVersion version = GlassFishVersion.toValue(strings[i]);
Expand Down
Loading