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

[master] New WildFly EE platform #1765

Merged
merged 5 commits into from
Jan 9, 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
12 changes: 6 additions & 6 deletions etc/el-testjee.wildfly.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -16,7 +16,7 @@
server.name=jboss

#Server type/major version (value is specified by cargo-maven2-plugin).
server.containerId=wildfly17x
server.containerId=wildfly27x

#Hostname to which server binds. Used by testing client (EJB client) too.
server.host=localhost
Expand All @@ -40,14 +40,14 @@ server.pwd=adminadmin
server.initialCtxFactory=org.wildfly.naming.client.WildFlyInitialContextFactory

#EclipseLink specific property/hint to identify server family.
server.platform=JBoss
server.platform.class=jboss-platform
server.platform=WildFly
server.platform.class=wildfly-platform

#JEE server client library. There are Maven artifact properties. Use Maven Central to find right values.
jee.client.groupId=org.wildfly
jee.client.artifactId=wildfly-ejb-client-bom
#In case of WildFly this property is used as a substitution property in eclipselink-wildfly-module.xsl file.
jee.client.version=18.0.0.Final
jee.client.version=27.0.0.Final

#Server binaries location.
#Just binaries are needed. cargo-maven2-plugin during maven build/tests configures server/server domain automatically in .../target/cargo directory.
Expand All @@ -56,7 +56,7 @@ jee.client.version=18.0.0.Final
#cargo.container.installation.home=/usr/local/javaApplications/wildfly-15.0.1.Final
#false - Maven will download and unpack JEE server to the "${user.home}/.eclipselinktests" directory automatically.
skip.jee.server.installation=false
cargo.container.installation.home=${user.home}/.eclipselinktests/wildfly-18.0.0.Final
cargo.container.installation.home=${user.home}/.eclipselinktests/27.0.0.Final

#Part of JNDI name (suffix) used by generic JPA test client. This JNDI points to the testing EJBs deployed to the server.
#Most test using only first value, but in some cases other JNDIs EJBs are used too.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/

// Contributors:
// Oracle - initial API and implementation
package org.eclipse.persistence.testing.tests.sessionsxml;

import org.eclipse.persistence.platform.server.wildfly.WildFlyPlatform;
import org.eclipse.persistence.sessions.DatabaseSession;
import org.eclipse.persistence.sessions.factories.SessionManager;
import org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader;
import org.eclipse.persistence.testing.framework.AutoVerifyTestCase;
import org.eclipse.persistence.testing.framework.TestErrorException;


/**
* Tests server platform tag for WildFly.
*
* @version 1.0
*/
public class SessionsXMLSchemaWildFlyPlatformTest extends AutoVerifyTestCase {
Exception m_exceptionCaught;
DatabaseSession m_employeeSession;

public SessionsXMLSchemaWildFlyPlatformTest() {
setDescription("Tests loading a WildFly platform from the schema.");
}

@Override
public void reset() {
if ((m_employeeSession != null) && m_employeeSession.isConnected()) {
m_employeeSession.logout();
SessionManager.getManager().getSessions().remove(m_employeeSession);
m_employeeSession = null;
}
}

@Override
protected void setup() {
m_exceptionCaught = null;
}

@Override
public void test() {
try {
XMLSessionConfigLoader loader = new XMLSessionConfigLoader("org/eclipse/persistence/testing/models/sessionsxml/XMLSchemaSessionWildFlyPlatform.xml");

m_employeeSession = (DatabaseSession)SessionManager.getManager().getSession(loader, "EmployeeSessionWildFly", getClass().getClassLoader(), false, true);
} catch (Exception e) {
m_exceptionCaught = e;
}
}

@Override
protected void verify() {
if (m_exceptionCaught != null) {
throw new TestErrorException("Loading of the session failed: " + m_exceptionCaught);
}

if (m_employeeSession == null) {
throw new TestErrorException("Loaded session was null");
}

if (!(m_employeeSession.getServerPlatform() instanceof WildFlyPlatform)) {
throw new TestErrorException("The loaded server platform was not the correct type.");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -76,6 +76,7 @@ public TestSuite getSessionXMLSchemaTestSuite() {
suite.addTest(new SessionsXMLSchemaWeblogicPlatformTest());
suite.addTest(new SessionsXMLSchemaLoggingOptionsTest());
suite.addTest(new SessionsXMLSchemaJBossPlatformTest());
suite.addTest(new SessionsXMLSchemaWildFlyPlatformTest());
suite.addTest(new SessionManagerGetMultipleSessionsTest());
suite.addTest(new FailoverLoginSettingsTest());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="US-ASCII"?>
<!--

Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.

SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause

-->

<sessions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://xsd/eclipselink_sessions_1.0.xsd" version="0">
<session xsi:type="database-session">
<name>EmployeeSessionWildFly</name>
<server-platform xsi:type="wildfly-platform"/>
<primary-project xsi:type="class">org.eclipse.persistence.testing.models.employee.relational.EmployeeProject</primary-project>
<login xsi:type="database-login">
<user-name>@dbUser@</user-name>
<password>@dbPassword@</password>
<driver-class>@driverClass@</driver-class>
<connection-url>@dbURL@</connection-url>
</login>
</session>
</sessions>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2022 IBM Corporation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -43,6 +43,7 @@ public class TargetServer {
public static final String WebLogic_12 = "WebLogic_12";
public static final String JBoss = "JBoss";
public static final String SAPNetWeaver_7_1 = "NetWeaver_7_1";
public static final String WildFly = "WildFly";

public static final String DEFAULT = None;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018 IBM Corporation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -613,7 +613,8 @@ protected static class TargetServerProp extends Prop {
{TargetServer.WebLogic_10, pcg + "wls.WebLogic_10_Platform"},
{TargetServer.WebLogic_12, pcg + "wls.WebLogic_12_Platform"},
{TargetServer.JBoss, pcg + "jboss.JBossPlatform"},
{TargetServer.SAPNetWeaver_7_1, pcg + "sap.SAPNetWeaver_7_1_Platform"}
{TargetServer.SAPNetWeaver_7_1, pcg + "sap.SAPNetWeaver_7_1_Platform"},
{TargetServer.WildFly, pcg + "wildfly.WildFlyPlatform"}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -52,6 +52,7 @@
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_5_0_PlatformConfig;
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_5_1_PlatformConfig;
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_6_0_PlatformConfig;
import org.eclipse.persistence.internal.sessions.factories.model.platform.WildFlyPlatformConfig;
import org.eclipse.persistence.internal.sessions.factories.model.pool.ConnectionPolicyConfig;
import org.eclipse.persistence.internal.sessions.factories.model.pool.ConnectionPoolConfig;
import org.eclipse.persistence.internal.sessions.factories.model.pool.PoolsConfig;
Expand Down Expand Up @@ -226,6 +227,7 @@ public XMLSessionConfigProject() {
addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_6_0_PlatformConfig.class));
addDescriptor(buildServerPlatformConfigDescriptorFor(JBossPlatformConfig.class));
addDescriptor(buildServerPlatformConfigDescriptorFor(NetWeaver_7_1_PlatformConfig.class));
addDescriptor(buildServerPlatformConfigDescriptorFor(WildFlyPlatformConfig.class));

// Set the namespaces on all descriptors.
NamespaceResolver namespaceResolver = new NamespaceResolver();
Expand Down Expand Up @@ -1200,6 +1202,7 @@ public ClassDescriptor buildServerPlatformConfigDescriptor() {
descriptor.getInheritancePolicy().addClassIndicator(WebSphere_5_1_PlatformConfig.class, "websphere-51-platform");
descriptor.getInheritancePolicy().addClassIndicator(WebSphere_6_0_PlatformConfig.class, "websphere-60-platform");
descriptor.getInheritancePolicy().addClassIndicator(JBossPlatformConfig.class, "jboss-platform");
descriptor.getInheritancePolicy().addClassIndicator(WildFlyPlatformConfig.class, "wildfly-platform");
descriptor.getInheritancePolicy().addClassIndicator(NetWeaver_7_1_PlatformConfig.class, "netweaver-71-platform");


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/

// Contributors:
// Oracle - initial API and implementation
package org.eclipse.persistence.internal.sessions.factories.model.platform;

/**
* INTERNAL:
*/
public class WildFlyPlatformConfig extends ServerPlatformConfig {
public WildFlyPlatformConfig() {
super("org.eclipse.persistence.platform.server.wildfly.WildFlyPlatform");
}
}
Loading