diff --git a/appclient/src/main/resources/schema/application-client_11.xsd b/appclient/src/main/resources/schema/application-client_11.xsd new file mode 100644 index 000000000..0c84d2bf3 --- /dev/null +++ b/appclient/src/main/resources/schema/application-client_11.xsd @@ -0,0 +1,307 @@ + + + + + + Copyright (c) 2009, 2024 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. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The application-client element is the root element of an + application client deployment descriptor. The application + client deployment descriptor describes the enterprise bean + components and external resources referenced by the + application client. + + + + + + + + The env-entry-name element contains the name of an + application client's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name must + be unique within an application client. + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry + in the application client's environment and is relative to the + java:comp/env context. The name must be unique within the + application client. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference.The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an application client. + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the application client + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + application client. + + + + + + + + + + + The message-destination-ref-name element specifies the + name of a message destination reference; its value is + the message destination reference name used in the + application client code. The name is a JNDI name + relative to the java:comp/env context and must be unique + within an application client. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The callback-handler element names a class provided by + the application. The class must have a no args + constructor and must implement the + jakarta.security.auth.callback.CallbackHandler + interface. The class will be instantiated by the + application client container and used by the container + to collect authentication information from the user. + + + + + + + + + + + + + + + + + The required value for the version is 10. + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + diff --git a/appclient/src/main/resources/schema/jboss-client_11_0.xsd b/appclient/src/main/resources/schema/jboss-client_11_0.xsd new file mode 100644 index 000000000..ba5464386 --- /dev/null +++ b/appclient/src/main/resources/schema/jboss-client_11_0.xsd @@ -0,0 +1,68 @@ + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for the + Jakarta EE namespace with the following location: + + https://www.jboss.org/schema/jbossas/jboss-client_11_0.xsd + + ]]> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/appclient/src/test/java/org/jboss/test/metadata/appclient/AppClient11EverythingUnitTestCase.java b/appclient/src/test/java/org/jboss/test/metadata/appclient/AppClient11EverythingUnitTestCase.java new file mode 100644 index 000000000..e450eac7d --- /dev/null +++ b/appclient/src/test/java/org/jboss/test/metadata/appclient/AppClient11EverythingUnitTestCase.java @@ -0,0 +1,45 @@ +/* + * Copyright The JBoss Metadata Authors + * SPDX-License-Identifier: Apache-2.0 + */ +package org.jboss.test.metadata.appclient; + +import org.jboss.metadata.appclient.parser.spec.ApplicationClientMetaDataParser; +import org.jboss.metadata.appclient.spec.AppClientEnvironmentRefsGroupMetaData; +import org.jboss.metadata.appclient.spec.ApplicationClientMetaData; +import org.jboss.metadata.merge.javaee.spec.JavaEEVersion; +import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest; + +/** + * App Client 11 everything test. + * + * @author Eduardo Martins + * + */ +public class AppClient11EverythingUnitTestCase extends AbstractJavaEEEverythingTest { + + protected ApplicationClientMetaData unmarshal() throws Exception { + return ApplicationClientMetaDataParser.INSTANCE.parse(getReader()); + } + + public void testEverything() throws Exception { + // enableTrace("org.jboss.xb"); + ApplicationClientMetaData result = unmarshal(); + String prefix = "app"; + assertEquals("11", result.getVersion()); + assertEquals(prefix, result.getId()); + assertTrue(result.isMetadataComplete()); + assertEquals(prefix + "ModuleName", result.getModuleName()); + assertDescriptionGroup(prefix, result.getDescriptionGroup()); + assertEnvironment(prefix, result.getEnvironmentRefsGroupMetaData()); + } + + protected void assertEnvironment(String prefix, AppClientEnvironmentRefsGroupMetaData env) { + assertNotNull(env); + final Mode mode = Mode.SPEC; + final JavaEEVersion javaEEVersion = JavaEEVersion.V11; + assertRemoteEnvironment(prefix, env, true, Descriptor.APPLICATION_CLIENT, mode, javaEEVersion); + assertMessageDestinations(2,env.getMessageDestinations(), mode, javaEEVersion); + } + +} diff --git a/appclient/src/test/java/org/jboss/test/metadata/appclient/AppclientSpecDescriptorTestCase.java b/appclient/src/test/java/org/jboss/test/metadata/appclient/AppclientSpecDescriptorTestCase.java index d8fa6d487..ae957c763 100644 --- a/appclient/src/test/java/org/jboss/test/metadata/appclient/AppclientSpecDescriptorTestCase.java +++ b/appclient/src/test/java/org/jboss/test/metadata/appclient/AppclientSpecDescriptorTestCase.java @@ -21,7 +21,14 @@ public class AppclientSpecDescriptorTestCase extends SpecDescriptorTestCase { @Parameters public static List parameters() { // The spec descriptor should be guarded in schema - return Arrays.asList(new Object[][]{{"schema/application-client_6.xsd"},{"schema/application-client_7.xsd"},{"schema/application-client_8.xsd"},{"schema/application-client_9.xsd"},{"schema/application-client_10.xsd"}}); + return Arrays.asList(new Object[][]{ + {"schema/application-client_6.xsd"}, + {"schema/application-client_7.xsd"}, + {"schema/application-client_8.xsd"}, + {"schema/application-client_9.xsd"}, + {"schema/application-client_10.xsd"}, + {"schema/application-client_11.xsd"}, + }); } public AppclientSpecDescriptorTestCase(String xsd) { diff --git a/appclient/src/test/resources/org/jboss/test/metadata/appclient/AppClient11Everything_testEverything.xml b/appclient/src/test/resources/org/jboss/test/metadata/appclient/AppClient11Everything_testEverything.xml new file mode 100644 index 000000000..4257025e8 --- /dev/null +++ b/appclient/src/test/resources/org/jboss/test/metadata/appclient/AppClient11Everything_testEverything.xml @@ -0,0 +1,646 @@ + + + + + + appModuleName + + en-app-desc + fr-app-desc + de-app-desc + en-app-disp + fr-app-disp + de-app-disp + + en-app-small-icon + en-app-large-icon + + + fr-app-small-icon + fr-app-large-icon + + + de-app-small-icon + de-app-large-icon + + + + + en-appEnvEntry1-desc + fr-appEnvEntry1-desc + + de-appEnvEntry1-desc + + appEnvEntry1Name + java.lang.String + appEnvEntry1Value + appEnvEntry1MappedName + + appEnvEntry1Injection1Class + appEnvEntry1Injection1Name + + + appEnvEntry1Injection2Class + appEnvEntry1Injection2Name + + + + en-appEnvEntry2-desc + fr-appEnvEntry2-desc + + de-appEnvEntry2-desc + + appEnvEntry2Name + java.lang.String + appEnvEntry2Value + appEnvEntry2MappedName + + appEnvEntry2Injection1Class + appEnvEntry2Injection1Name + + + appEnvEntry2Injection2Class + appEnvEntry2Injection2Name + + + + en-appEjbRef1-desc + fr-appEjbRef1-desc + de-appEjbRef1-desc + appEjbRef1Name + Session + appEjbRef1Home + appEjbRef1Remote + appEjbRef1EjbLink + appEjbRef1MappedName + + appEjbRef1Injection1Class + appEjbRef1Injection1Name + + + appEjbRef1Injection2Class + appEjbRef1Injection2Name + + + + en-appEjbRef2-desc + fr-appEjbRef2-desc + de-appEjbRef2-desc + appEjbRef2Name + Entity + appEjbRef2Home + appEjbRef2Remote + appEjbRef2EjbLink + appEjbRef2MappedName + + appEjbRef2Injection1Class + appEjbRef2Injection1Name + + + appEjbRef2Injection2Class + appEjbRef2Injection2Name + + + + + en-appServiceRef1-desc + fr-appServiceRef1-desc + + de-appServiceRef1-desc + + appServiceRef1Name + appServiceRef1Iface + + + en-appServiceRef2-desc + fr-appServiceRef2-desc + + de-appServiceRef2-desc + + appServiceRef2Name + appServiceRef2Iface + + + + en-appResourceRef1-desc + fr-appResourceRef1-desc + + de-appResourceRef1-desc + + appResourceRef1Name + appResourceRef1Type + Application + Shareable + appResourceRef1MappedName + + appResourceRef1Injection1Class + appResourceRef1Injection1Name + + + appResourceRef1Injection2Class + appResourceRef1Injection2Name + + + + en-appResourceRef2-desc + fr-appResourceRef2-desc + + de-appResourceRef2-desc + + appResourceRef2Name + appResourceRef2Type + Container + Unshareable + appResourceRef2MappedName + + appResourceRef2Injection1Class + appResourceRef2Injection1Name + + + appResourceRef2Injection2Class + appResourceRef2Injection2Name + + + + en-appResourceEnvRef1-desc + fr-appResourceEnvRef1-desc + + de-appResourceEnvRef1-desc + + appResourceEnvRef1Name + appResourceEnvRef1Type + appResourceEnvRef1MappedName + + appResourceEnvRef1Injection1Class + appResourceEnvRef1Injection1Name + + + appResourceEnvRef1Injection2Class + appResourceEnvRef1Injection2Name + + + + en-appResourceEnvRef2-desc + fr-appResourceEnvRef2-desc + + de-appResourceEnvRef2-desc + + appResourceEnvRef2Name + appResourceEnvRef2Type + appResourceEnvRef2MappedName + + appResourceEnvRef2Injection1Class + appResourceEnvRef2Injection1Name + + + appResourceEnvRef2Injection2Class + appResourceEnvRef2Injection2Name + + + + en-appMessageDestinationRef1-desc + fr-appMessageDestinationRef1-desc + + de-appMessageDestinationRef1-desc + + appMessageDestinationRef1Name + appMessageDestinationRef1Type + Consumes + appMessageDestinationRef1Link + appMessageDestinationRef1MappedName + + appMessageDestinationRef1Injection1Class + appMessageDestinationRef1Injection1Name + + + appMessageDestinationRef1Injection2Class + appMessageDestinationRef1Injection2Name + + + + en-appMessageDestinationRef2-desc + fr-appMessageDestinationRef2-desc + + de-appMessageDestinationRef2-desc + + appMessageDestinationRef2Name + appMessageDestinationRef2Type + Produces + appMessageDestinationRef2Link + appMessageDestinationRef2MappedName + + appMessageDestinationRef2Injection1Class + appMessageDestinationRef2Injection1Name + + + appMessageDestinationRef2Injection2Class + appMessageDestinationRef2Injection2Name + + + + en-appMessageDestinationRef3-desc + fr-appMessageDestinationRef3-desc + + de-appMessageDestinationRef3-desc + + appMessageDestinationRef3Name + appMessageDestinationRef3Type + ConsumesProduces + appMessageDestinationRef3Link + appMessageDestinationRef3MappedName + + appMessageDestinationRef3Injection1Class + appMessageDestinationRef3Injection1Name + + + appMessageDestinationRef3Injection2Class + appMessageDestinationRef3Injection2Name + + + + en-appPersistenceUnitRef1-desc + fr-appPersistenceUnitRef1-desc + + de-appPersistenceUnitRef1-desc + + appPersistenceUnitRef1Name + appPersistenceUnitRef1Unit + appPersistenceUnitRef1MappedName + + appPersistenceUnitRef1Injection1Class + appPersistenceUnitRef1Injection1Name + + + appPersistenceUnitRef1Injection2Class + appPersistenceUnitRef1Injection2Name + + + + en-appPersistenceUnitRef2-desc + fr-appPersistenceUnitRef2-desc + + de-appPersistenceUnitRef2-desc + + appPersistenceUnitRef2Name + appPersistenceUnitRef2Unit + appPersistenceUnitRef2MappedName + + appPersistenceUnitRef2Injection1Class + appPersistenceUnitRef2Injection1Name + + + appPersistenceUnitRef2Injection2Class + appPersistenceUnitRef2Injection2Name + + + + appPostConstruct1Class + appPostConstruct1Method + + + appPostConstruct2Class + appPostConstruct2Method + + + appPreDestroy1Class + appPreDestroy1Method + + + appPreDestroy2Class + appPreDestroy2Method + + + en-messageDestination1-desc + fr-messageDestination1-desc + + de-messageDestination1-desc + + en-messageDestination1-disp + fr-messageDestination1-disp + de-messageDestination1-disp + + en-messageDestination1-small-icon + en-messageDestination1-large-icon + + + fr-messageDestination1-small-icon + fr-messageDestination1-large-icon + + + de-messageDestination1-small-icon + de-messageDestination1-large-icon + + messageDestination1Name + messageDestination1MappedName + messageDestination1LookupName + + + en-messageDestination2-desc + fr-messageDestination2-desc + + de-messageDestination2-desc + + en-messageDestination2-disp + fr-messageDestination2-disp + de-messageDestination2-disp + + en-messageDestination2-small-icon + en-messageDestination2-large-icon + + + fr-messageDestination2-small-icon + fr-messageDestination2-large-icon + + + de-messageDestination2-small-icon + de-messageDestination2-large-icon + + messageDestination2Name + messageDestination2MappedName + messageDestination2LookupName + + + + en-appDataSource1-desc + appDataSource1Name + appDataSource1ClassName + appDataSource1ServerName + 1 + appDataSource1DatabaseName + jdbc:appDataSource1:url + appDataSource1User + appDataSource1Password + + appDataSource1Property1Name + appDataSource1Property1Value + + + appDataSource1Property2Name + appDataSource1Property2Value + + 1 + false + TRANSACTION_READ_UNCOMMITTED + 1 + 1 + 1 + 1 + 1 + + + en-appDataSource2-desc + appDataSource2Name + appDataSource2ClassName + appDataSource2ServerName + 2 + appDataSource2DatabaseName + jdbc:appDataSource2:url + appDataSource2User + appDataSource2Password + + appDataSource2Property1Name + appDataSource2Property1Value + + + appDataSource2Property2Name + appDataSource2Property2Value + + 2 + true + TRANSACTION_READ_COMMITTED + 2 + 2 + 2 + 2 + 2 + + + + + appJmsConnectionFactory1Desc + appJmsConnectionFactory1Name + javax.jms.QueueConnectionFactory + appJmsConnectionFactory1ClassName + appJmsConnectionFactory1ResourceAdapter + appJmsConnectionFactory1User + appJmsConnectionFactory1Password + appJmsConnectionFactory1ClientId + + appJmsConnectionFactory1Property1Name + appJmsConnectionFactory1Property1Value + + + appJmsConnectionFactory1Property2Name + appJmsConnectionFactory1Property2Value + + true + 1 + 1 + + + appJmsConnectionFactory2Desc + appJmsConnectionFactory2Name + javax.jms.TopicConnectionFactory + appJmsConnectionFactory2ClassName + appJmsConnectionFactory2ResourceAdapter + appJmsConnectionFactory2User + appJmsConnectionFactory2Password + appJmsConnectionFactory2ClientId + + appJmsConnectionFactory2Property1Name + appJmsConnectionFactory2Property1Value + + + appJmsConnectionFactory2Property2Name + appJmsConnectionFactory2Property2Value + + false + 2 + 2 + + + appJmsConnectionFactory3Name + + + + appJmsDestination1Desc + appJmsDestination1Name + javax.jms.Queue + appJmsDestination1ClassName + appJmsDestination1ResourceAdapter + appJmsDestination1DestinationName + + appJmsDestination1Property1Name + appJmsDestination1Property1Value + + + appJmsDestination1Property2Name + appJmsDestination1Property2Value + + + + appJmsDestination2Desc + appJmsDestination2Name + javax.jms.Queue + appJmsDestination2ClassName + appJmsDestination2ResourceAdapter + appJmsDestination2DestinationName + + appJmsDestination2Property1Name + appJmsDestination2Property1Value + + + appJmsDestination2Property2Name + appJmsDestination2Property2Value + + + + appJmsDestination3Name + javax.jms.Topic + + + + appMailSession1Desc + appMailSession1Name + appMailSession1StoreProtocol + appMailSession1StoreProtocolClass + appMailSession1TransportProtocol + appMailSession1TransportProtocolClass + appMailSession1Host + appMailSession1User + appMailSession1Password + appMailSession1From + + appMailSession1Property1Name + appMailSession1Property1Value + + + appMailSession1Property2Name + appMailSession1Property2Value + + + + appMailSession2Desc + appMailSession2Name + appMailSession2StoreProtocol + appMailSession2StoreProtocolClass + appMailSession2TransportProtocol + appMailSession2TransportProtocolClass + appMailSession2Host + appMailSession2User + appMailSession2Password + appMailSession2From + + appMailSession2Property1Name + appMailSession2Property1Value + + + appMailSession2Property2Name + appMailSession2Property2Value + + + + appMailSession3Name + + + + appConnectionFactory1Desc + appConnectionFactory1Name + appConnectionFactory1InterfaceName + appConnectionFactory1ResourceAdapter + 1 + 1 + NoTransaction + + appConnectionFactory1Property1Name + appConnectionFactory1Property1Value + + + appConnectionFactory1Property2Name + appConnectionFactory1Property2Value + + + + appConnectionFactory2Desc + appConnectionFactory2Name + appConnectionFactory2InterfaceName + appConnectionFactory2ResourceAdapter + 2 + 2 + LocalTransaction + + appConnectionFactory2Property1Name + appConnectionFactory2Property1Value + + + appConnectionFactory2Property2Name + appConnectionFactory2Property2Value + + + + appConnectionFactory3Desc + appConnectionFactory3Name + appConnectionFactory3InterfaceName + appConnectionFactory3ResourceAdapter + 3 + 3 + XATransaction + + appConnectionFactory3Property1Name + appConnectionFactory3Property1Value + + + appConnectionFactory3Property2Name + appConnectionFactory3Property2Value + + + + appConnectionFactory4Name + appConnectionFactory4InterfaceName + appConnectionFactory4ResourceAdapter + + + + appAdministeredObject1Desc + appAdministeredObject1Name + appAdministeredObject1InterfaceName + appAdministeredObject1ClassName + appAdministeredObject1ResourceAdapter + + appAdministeredObject1Property1Name + appAdministeredObject1Property1Value + + + appAdministeredObject1Property2Name + appAdministeredObject1Property2Value + + + + appAdministeredObject2Desc + appAdministeredObject2Name + appAdministeredObject2InterfaceName + appAdministeredObject2ClassName + appAdministeredObject2ResourceAdapter + + appAdministeredObject2Property1Name + appAdministeredObject2Property1Value + + + appAdministeredObject2Property2Name + appAdministeredObject2Property2Value + + + + appAdministeredObject3Name + appAdministeredObject3ClassName + appAdministeredObject3ResourceAdapter + + + diff --git a/common/src/main/java/org/jboss/metadata/parser/util/XMLResourceResolver.java b/common/src/main/java/org/jboss/metadata/parser/util/XMLResourceResolver.java index 808c82e80..0ea0acd40 100644 --- a/common/src/main/java/org/jboss/metadata/parser/util/XMLResourceResolver.java +++ b/common/src/main/java/org/jboss/metadata/parser/util/XMLResourceResolver.java @@ -83,6 +83,7 @@ public Object run() { registerEntity("http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd", "application_8.xsd"); registerEntity("https://jakarta.ee/xml/ns/jakartaee/application_9.xsd", "application_9.xsd"); registerEntity("https://jakarta.ee/xml/ns/jakartaee/application_10.xsd", "application_10.xsd"); + registerEntity("https://jakarta.ee/xml/ns/jakartaee/application_11.xsd", "application_11.xsd"); // jboss-app registerEntity("-//JBoss//DTD J2EE Application 1.3//EN", "jboss-app_3_0.dtd"); @@ -99,6 +100,7 @@ public Object run() { registerEntity("http://xmlns.jcp.org/xml/ns/javaee/application-client_8.xsd", "application-client_8.xsd"); registerEntity("https://jakarta.ee/xml/ns/jakartaee/application-client_9.xsd", "application-client_9.xsd"); registerEntity("https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd", "application-client_10.xsd"); + registerEntity("https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd", "application-client_11.xsd"); // jboss-client registerEntity("-//JBoss//DTD Application Client 3.2//EN", "jboss-client_3_2.dtd"); diff --git a/common/src/main/resources/schema/jboss-common_11_0.xsd b/common/src/main/resources/schema/jboss-common_11_0.xsd new file mode 100644 index 000000000..7f75461b8 --- /dev/null +++ b/common/src/main/resources/schema/jboss-common_11_0.xsd @@ -0,0 +1,551 @@ + + + + + + + + + + + The following conventions apply to all Jakarta EE deployment descriptor + elements unless indicated otherwise. - In elements that specify a pathname to a file within + the same JAR file, relative filenames (i.e., those not starting with "/") are considered + relative to the root of the JAR file's namespace. Absolute filenames (i.e., those starting + with "/") also specify names in the root of the JAR file's namespace. In general, relative + names are preferred. The exception is .war files where absolute names are preferred for + consistency with the Servlet API. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The jmx-name element allows one to specify the JMX ObjectName to use for + the MBean associated with the ejb-jar module. This must be a unique name and valid JMX + ObjectName string. + + + + + + + + + The security-domain element specifies the JNDI name of the security + manager that implements the EJBSecurityManager and RealmMapping for the domain. When + specified at the jboss level it specifies the security domain for all Jakarta EE components in the + deployment unit. One can override the global security-domain at the container level using + the security-domain element at the container-configuration level. + + + + + + + + + The security-role element contains the definition of a security role. + The definition consists of an the security role name and principal name element(s). + + + + + + + + + + + + The principal-name element is the name of the principal that is mapped + to the assembly role-name. + + + + + + + + + The depends element gives a JMX ObjectName of a service on which the + container or ejb depends. (default) + + + + + + + + + The JNDI name under with the local interface should be bound. If it is not + provided jboss will assume "jndi-name" = "beanClass/local" + + + + + + + + + The ejb-ref element is used to give the jndi-name of an external ejb + reference. In the case of an external ejb reference, you don't provide a ejb-link element in + ejb-jar.xml, but you provide a jndi-name in jboss.xml Used in: entity, session, + message-driven, consumer, and service + + + + + + + + + + + + + + + + + + The ejb-local-ref element is used to give the jndi-name of an external ejb + reference. In the case of an external ejb reference, you don't provide a ejb-link element in + ejb-jar.xml, but you provide a jndi-name in jboss.xml + + + + + + + + + + + + + + + + + + The resource-ref element gives a mapping between the "code name" of a + resource (res-ref-name, provided by the Bean Developer) and its "xml name" (resource-name, + provided by the Application Assembler). If no resource-ref is provided, jboss will assume + that "xml-name" = "code name" See resource-managers. + + + + + + + The res-ref-name element specifies the name of a resource manager + connection factory reference. The name is a JNDI name relative to the java:comp/env + context. The name must be unique within a Deployment File. + + + + + + The res-type element specifies the type of the data source. The type + is specified by the fully qualified Java language class or interface expected to be + implemented by the data source. + + + + + + + + + + + + + + + + + + + + + + + + + + The service-ref-name element gives the ENC relative name used in the + ejb-jar.xml service-ref-name element. + + + + + + + + + + jboss.test:loader=cts-cmp2v1-sar.ear + + + dot.com:loader=unique-archive-name + + java2ParentDelegaton=true + + + + ]]> + + + + + + + + + + + + + + + + The loader-repository-config element specifies any arbitrary configuration + fragment for use in configuring the loader-repository instance. The actual content of this + element is specific to the loaderRepositoryClass and the code parsing the element. + + + + + + + + + + + + OrganizationService + file:/wsdlRepository/organization-service.wsdl + + + + OrganizationService + Secure Client Config + META-INF/jbossws-client-config.xml + META-INF/jbossws-client-handlers.xml + + + + SecureService + org.jboss.tests.ws.jaxws.webserviceref.SecureEndpointService + {http://org.jboss.ws/wsref}SecureEndpointService + + org.jboss.tests.ws.jaxws.webserviceref.SecureEndpoint + {http://org.jboss.ws/wsref}SecureEndpointPort + + javax.xml.ws.security.auth.username + kermit + + + javax.xml.ws.security.auth.password + thefrog + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The message-destination element is used to configure the jndi-name for a + message-destination in ejb-jar.xml Used in: assembly-descriptor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java b/common/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java index 3a779ba6b..d8f32f11e 100644 --- a/common/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java +++ b/common/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java @@ -558,7 +558,7 @@ protected void assertPersistenceContextRefs(String prefix, int size, Persistence } protected void assertDataSources(String prefix, DataSourcesMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if ((version != JavaEEVersion.V7 && version != JavaEEVersion.V8 && version != JavaEEVersion.V9 && version != JavaEEVersion.V10) || !full) { + if ((version != JavaEEVersion.V7 && version != JavaEEVersion.V8 && version != JavaEEVersion.V9 && version != JavaEEVersion.V10 && version != JavaEEVersion.V11) || !full) { assertNull(metaDatas); return; } @@ -597,7 +597,7 @@ protected void assertDataSources(String prefix, DataSourcesMetaData metaDatas, M } protected void assertAdministeredObjects(String prefix, AdministeredObjectsMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if ((version != JavaEEVersion.V7 && version != JavaEEVersion.V8 && version != JavaEEVersion.V9 && version != JavaEEVersion.V10) || !full) { + if ((version != JavaEEVersion.V7 && version != JavaEEVersion.V8 && version != JavaEEVersion.V9 && version != JavaEEVersion.V10 && version != JavaEEVersion.V11) || !full) { assertNull(metaDatas); return; } @@ -947,7 +947,7 @@ protected void assertMailSessions(String prefix, MailSessionsMetaData metaDatas, } protected void assertContextServices(String prefix, ContextServicesMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if (version != JavaEEVersion.V10 || !full) { + if (version != JavaEEVersion.V10 && version != JavaEEVersion.V11 || !full) { assertNull(metaDatas); return; } @@ -1007,7 +1007,7 @@ protected void assertContextServices(String prefix, ContextServicesMetaData meta } protected void assertManagedExecutors(String prefix, ManagedExecutorsMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if (version != JavaEEVersion.V10 || !full) { + if (version != JavaEEVersion.V10 && version != JavaEEVersion.V11 || !full) { assertNull(metaDatas); return; } @@ -1068,7 +1068,7 @@ protected void assertManagedExecutors(String prefix, ManagedExecutorsMetaData me } protected void assertManagedScheduledExecutors(String prefix, ManagedScheduledExecutorsMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if (version != JavaEEVersion.V10 || !full) { + if (version != JavaEEVersion.V10 && version != JavaEEVersion.V11 || !full) { assertNull(metaDatas); return; } @@ -1129,7 +1129,7 @@ protected void assertManagedScheduledExecutors(String prefix, ManagedScheduledEx } protected void assertManagedThreadFactories(String prefix, ManagedThreadFactoriesMetaData metaDatas, Mode mode, boolean full, JavaEEVersion version) { - if (version != JavaEEVersion.V10 || !full) { + if (version != JavaEEVersion.V10 && version != JavaEEVersion.V11 || !full) { assertNull(metaDatas); return; } diff --git a/ear/src/main/java/org/jboss/metadata/ear/spec/EarVersion.java b/ear/src/main/java/org/jboss/metadata/ear/spec/EarVersion.java index f6106d689..71ae41f8c 100644 --- a/ear/src/main/java/org/jboss/metadata/ear/spec/EarVersion.java +++ b/ear/src/main/java/org/jboss/metadata/ear/spec/EarVersion.java @@ -23,7 +23,8 @@ public enum EarVersion { APP_7_0("http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd", "7.0", JavaEEVersion.V7), APP_8_0("http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd", "8.0", JavaEEVersion.V8), APP_9_0("https://jakarta.ee/xml/ns/jakartaee/application_9.xsd", "9.0", JavaEEVersion.V9), - APP_10_0("https://jakarta.ee/xml/ns/jakartaee/application_10.xsd", "10.0", JavaEEVersion.V10); + APP_10_0("https://jakarta.ee/xml/ns/jakartaee/application_10.xsd", "10.0", JavaEEVersion.V10), + APP_11_0("https://jakarta.ee/xml/ns/jakartaee/application_11.xsd", "11.0", JavaEEVersion.V11); private static final Map bindings = new HashMap<>(); diff --git a/ear/src/main/resources/schema/jboss-app_11_0.xsd b/ear/src/main/resources/schema/jboss-app_11_0.xsd new file mode 100644 index 000000000..6155d2259 --- /dev/null +++ b/ear/src/main/resources/schema/jboss-app_11_0.xsd @@ -0,0 +1,111 @@ + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for the + Jakarta EE namespace with the following location: + + https://www.jboss.org/schema/jbossas/jboss-app_11_0.xsd + + ]]> + + + + + + + + + + + + + + + + + + Root element for JBoss specific configurations in a .ear + + + + + + + + + The distinct-name for this application. + + + + + + + The security domain application for this application. + + + + + + + The principal that will be used for unauthenticated requests in this application + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ear/src/test/java/org/jboss/test/metadata/ear/Ear11xEverythingUnitTestCase.java b/ear/src/test/java/org/jboss/test/metadata/ear/Ear11xEverythingUnitTestCase.java new file mode 100644 index 000000000..859682c92 --- /dev/null +++ b/ear/src/test/java/org/jboss/test/metadata/ear/Ear11xEverythingUnitTestCase.java @@ -0,0 +1,101 @@ +/* + * Copyright The JBoss Metadata Authors + * SPDX-License-Identifier: Apache-2.0 + */ +package org.jboss.test.metadata.ear; + +import org.jboss.metadata.ear.parser.spec.EarMetaDataParser; +import org.jboss.metadata.ear.spec.ConnectorModuleMetaData; +import org.jboss.metadata.ear.spec.EarEnvironmentRefsGroupMetaData; +import org.jboss.metadata.ear.spec.EarMetaData; +import org.jboss.metadata.ear.spec.EarVersion; +import org.jboss.metadata.ear.spec.EjbModuleMetaData; +import org.jboss.metadata.ear.spec.JavaModuleMetaData; +import org.jboss.metadata.ear.spec.ModuleMetaData; +import org.jboss.metadata.ear.spec.ModulesMetaData; +import org.jboss.metadata.ear.spec.WebModuleMetaData; +import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest; + +/** + * Ear10x tests. + * + * @author Brian Stansberry + */ +public class Ear11xEverythingUnitTestCase extends AbstractJavaEEEverythingTest { + + protected EarMetaData unmarshal() throws Exception { + final EarMetaData earMetaData = EarMetaDataParser.INSTANCE.parse(getReader()); + assertTrue(earMetaData instanceof EarMetaData); + return EarMetaData.class.cast(earMetaData); + } + + protected EarVersion getExpectedEarVersion() { + return EarVersion.APP_11_0; + } + + public void testEverything() throws Exception { + EarMetaData result = unmarshal(); + + assertEquals("application-test-everything", result.getId()); + assertEquals(getExpectedEarVersion(), result.getEarVersion()); + assertEquals("ApplicationName", result.getApplicationName()); + + String prefix = "app"; + final Mode mode = Mode.SPEC; + + assertDescriptionGroup(prefix, result.getDescriptionGroup()); + assertSecurityRoles(2,result.getSecurityRoles(), mode); + assertLibraryDirectory(result); + assertModules(result); + assertTrue(result.getInitializeInOrder()); + assertEarEnvironment(prefix,result.getEarEnvironmentRefsGroup(), result.getEarVersion(), mode); + } + + protected void assertEarEnvironment(String prefix, EarEnvironmentRefsGroupMetaData earEnvironmentRefsGroup, EarVersion earVersion, Mode mode) { + assertNotNull(earEnvironmentRefsGroup); + final boolean full = true; + assertEnvironment(prefix, earEnvironmentRefsGroup, full, Descriptor.APPLICATION, mode, earVersion.getJavaEEVersion()); + assertMessageDestinations(2,earEnvironmentRefsGroup.getMessageDestinations(),mode, earVersion.getJavaEEVersion()); + } + + protected void assertLibraryDirectory(EarMetaData ear) { + assertEquals("lib0", ear.getLibraryDirectory()); + } + + protected void assertModules(EarMetaData ear) { + ModulesMetaData modules = ear.getModules(); + assertEquals(6, modules.size()); + ModuleMetaData connector = modules.get(0); + assertEquals("connector0", connector.getId()); + assertEquals("META-INF/alt-ra.xml", connector.getAlternativeDD()); + ConnectorModuleMetaData connectorMD = (ConnectorModuleMetaData) connector.getValue(); + assertEquals("rar0.rar", connectorMD.getConnector()); + ModuleMetaData java = modules.get(1); + assertEquals("java0", java.getId()); + assertEquals("META-INF/alt-application-client.xml", java.getAlternativeDD()); + JavaModuleMetaData javaMD = (JavaModuleMetaData) java.getValue(); + assertEquals("client0.jar", javaMD.getClientJar()); + ModuleMetaData ejb0 = modules.get(2); + assertEquals("ejb0", ejb0.getId()); + assertEquals("META-INF/alt-ejb-jar.xml", ejb0.getAlternativeDD()); + EjbModuleMetaData ejb0MD = (EjbModuleMetaData) ejb0.getValue(); + assertEquals("ejb-jar0.jar", ejb0MD.getEjbJar()); + ModuleMetaData ejb1 = modules.get(3); + assertEquals("ejb1", ejb1.getId()); + assertEquals("META-INF/alt-ejb-jar.xml", ejb1.getAlternativeDD()); + EjbModuleMetaData ejb1MD = (EjbModuleMetaData) ejb1.getValue(); + assertEquals("ejb-jar1.jar", ejb1MD.getEjbJar()); + ModuleMetaData web0 = modules.get(4); + assertEquals("web0", web0.getId()); + assertEquals("WEB-INF/alt-web.xml", web0.getAlternativeDD()); + WebModuleMetaData web0MD = (WebModuleMetaData) web0.getValue(); + assertEquals("/web0", web0MD.getContextRoot()); + assertEquals("web-app0.war", web0MD.getWebURI()); + ModuleMetaData web1 = modules.get(5); + assertEquals("web1", web1.getId()); + assertEquals("WEB-INF/alt-web.xml", web1.getAlternativeDD()); + WebModuleMetaData web1MD = (WebModuleMetaData) web1.getValue(); + assertEquals("/web1", web1MD.getContextRoot()); + assertEquals("web-app1.war", web1MD.getWebURI()); + } +} diff --git a/ear/src/test/java/org/jboss/test/metadata/ear/JBossApp11xEverythingUnitTestCase.java b/ear/src/test/java/org/jboss/test/metadata/ear/JBossApp11xEverythingUnitTestCase.java new file mode 100644 index 000000000..104d32e0f --- /dev/null +++ b/ear/src/test/java/org/jboss/test/metadata/ear/JBossApp11xEverythingUnitTestCase.java @@ -0,0 +1,164 @@ +/* + * Copyright The JBoss Metadata Authors + * SPDX-License-Identifier: Apache-2.0 + */ +package org.jboss.test.metadata.ear; + +import org.jboss.metadata.ear.jboss.JBossAppMetaData; +import org.jboss.metadata.ear.jboss.ServiceModuleMetaData; +import org.jboss.metadata.ear.merge.JBossAppMetaDataMerger; +import org.jboss.metadata.ear.parser.jboss.JBossAppMetaDataParser; +import org.jboss.metadata.ear.parser.spec.EarMetaDataParser; +import org.jboss.metadata.ear.spec.ConnectorModuleMetaData; +import org.jboss.metadata.ear.spec.EarMetaData; +import org.jboss.metadata.ear.spec.EjbModuleMetaData; +import org.jboss.metadata.ear.spec.JavaModuleMetaData; +import org.jboss.metadata.ear.spec.ModuleMetaData; +import org.jboss.metadata.ear.spec.ModulesMetaData; +import org.jboss.metadata.ear.spec.WebModuleMetaData; +import org.jboss.metadata.javaee.spec.SecurityRoleMetaData; +import org.jboss.metadata.javaee.spec.SecurityRolesMetaData; +import org.jboss.test.metadata.javaee.AbstractJavaEEMetaDataTest; +import org.junit.Test; + +/** + * Test jboss-app.xml which uses jboss-app_11_0.xsd + * + * @author Jaikiran Pai + */ +public class JBossApp11xEverythingUnitTestCase extends AbstractJavaEEMetaDataTest { + + private boolean hasJBossAppOverride = false; + + protected JBossAppMetaData unmarshal() throws Exception { + return JBossAppMetaDataParser.INSTANCE.parse(getReader()); + } + + @Test + public void testOverride() throws Exception { + EarMetaData spec = EarMetaDataParser.INSTANCE.parse(getReader("Ear11xEverything_testEverything.xml")); + JBossAppMetaData jbossAppMD = new JBossAppMetaData(); + JBossAppMetaDataMerger.merge(jbossAppMD, null, spec); + hasJBossAppOverride = false; + assertEveryting(jbossAppMD); + } + + @Test + public void testEverything() + throws Exception { + //enableTrace("org.jboss.xb"); + EarMetaData spec = EarMetaDataParser.INSTANCE.parse(getReader("Ear11xEverything_testEverything.xml")); + JBossAppMetaData jbossAppXml = unmarshal(); + assertEquals("Unexpected distinct-name", "foo", jbossAppXml.getDistinctName()); + JBossAppMetaData jbossAppMD = new JBossAppMetaData(); + JBossAppMetaDataMerger.merge(jbossAppMD, jbossAppXml, spec); + hasJBossAppOverride = true; + assertEveryting(jbossAppMD); + assertEquals("jboss-app-id", jbossAppMD.getId()); + assertEveryting(jbossAppMD); + } + + protected void assertEveryting(JBossAppMetaData ear) throws Exception { + assertSecurityRoles(ear); + assertLibraryDirectory(ear); + assertModules(ear); + } + + protected void assertSecurityRoles(JBossAppMetaData ear) { + SecurityRolesMetaData roles = ear.getSecurityRoles(); + assertEquals("There are 2 roles " + roles, 2, roles.size()); + SecurityRoleMetaData role0 = roles.get("securityRoleRef1RoleLink"); + SecurityRoleMetaData role1 = roles.get("securityRoleRef2RoleLink"); + if (hasJBossAppOverride) { + assertEquals("security-role0", role0.getId()); + assertEquals("securityRoleRef1RoleLink", role0.getName()); + assertEquals("en-securityRole1-desc", role0.getDescriptions().value()[0].value()); + + assertEquals("security-role1", role1.getId()); + assertEquals("securityRoleRef2RoleLink", role1.getName()); + assertEquals("en-securityRole2-desc", role1.getDescriptions().value()[0].value()); + + assertTrue("1 principal in role0", role0.getPrincipals().size() == 1); + assertEquals("principal0", role0.getPrincipals().toArray()[0]); + assertEquals("principal1", role1.getPrincipals().toArray()[0]); + } else { + assertEquals("securityRole1-id", role0.getId()); + assertEquals("securityRoleRef1RoleLink", role0.getName()); + assertEquals("en-securityRole1-desc", role0.getDescriptions().value()[0].value()); + + assertEquals("securityRole2-id", role1.getId()); + assertEquals("securityRoleRef2RoleLink", role1.getName()); + assertEquals("en-securityRole2-desc", role1.getDescriptions().value()[0].value()); + } + } + + protected void assertLibraryDirectory(JBossAppMetaData ear) { + if (hasJBossAppOverride) { + assertEquals("jboss-app-lib0", ear.getLibraryDirectory()); + } else { + assertEquals("lib0", ear.getLibraryDirectory()); + } + } + + protected void assertModules(JBossAppMetaData ear) { + ModulesMetaData modules = ear.getModules(); + if (hasJBossAppOverride) { + assertEquals(9, modules.size()); + } else { + assertEquals(6, modules.size()); + } + ModuleMetaData connector = modules.get(0); + assertEquals("connector0", connector.getId()); + ConnectorModuleMetaData connectorMD = (ConnectorModuleMetaData) connector.getValue(); + assertEquals("rar0.rar", connectorMD.getConnector()); + ModuleMetaData java = modules.get(1); + assertEquals("java0", java.getId()); + JavaModuleMetaData javaMD = (JavaModuleMetaData) java.getValue(); + assertEquals("client0.jar", javaMD.getClientJar()); + ModuleMetaData ejb0 = modules.get(2); + assertEquals("ejb0", ejb0.getId()); + EjbModuleMetaData ejb0MD = (EjbModuleMetaData) ejb0.getValue(); + assertEquals("ejb-jar0.jar", ejb0MD.getEjbJar()); + ModuleMetaData ejb1 = modules.get(3); + assertEquals("ejb1", ejb1.getId()); + EjbModuleMetaData ejb1MD = (EjbModuleMetaData) ejb1.getValue(); + assertEquals("ejb-jar1.jar", ejb1MD.getEjbJar()); + ModuleMetaData web0 = modules.get(4); + assertEquals("web0", web0.getId()); + WebModuleMetaData web0MD = (WebModuleMetaData) web0.getValue(); + assertEquals("/web0", web0MD.getContextRoot()); + assertEquals("web-app0.war", web0MD.getWebURI()); + ModuleMetaData web1 = modules.get(5); + assertEquals("web1", web1.getId()); + WebModuleMetaData web1MD = (WebModuleMetaData) web1.getValue(); + if (hasJBossAppOverride) { + assertEquals("/web1-override", web1MD.getContextRoot()); + } else { + assertEquals("/web1", web1MD.getContextRoot()); + } + assertEquals("web-app1.war", web1MD.getWebURI()); + if (hasJBossAppOverride) { + // Validate the sar, web2, har added in jboss-app.xml + ModuleMetaData sar = modules.get(6); + assertEquals("sar0", sar.getId()); + ServiceModuleMetaData sarMD = (ServiceModuleMetaData) sar.getValue(); + assertEquals("sar0.sar", sarMD.getSar()); + ModuleMetaData web2 = modules.get(7); + assertEquals("web2", web2.getId()); + WebModuleMetaData web2MD = (WebModuleMetaData) web2.getValue(); + assertEquals("/web2", web2MD.getContextRoot()); + assertEquals("web-app2.war", web2MD.getWebURI()); + ModuleMetaData har = modules.get(8); + assertEquals("har0", har.getId()); + ServiceModuleMetaData harMD = (ServiceModuleMetaData) har.getValue(); + assertEquals("har0.har", harMD.getSar()); + } + // Validate lookup by module file name + ModuleMetaData mmd = modules.get("rar0.rar"); + assertEquals(connector, mmd); + mmd = modules.get("ejb-jar1.jar"); + assertEquals(ejb1, mmd); + mmd = modules.get("web-app0.war"); + assertEquals(web0, mmd); + } +} diff --git a/ear/src/test/resources/org/jboss/test/metadata/ear/JBossApp11xEverything_testEverything.xml b/ear/src/test/resources/org/jboss/test/metadata/ear/JBossApp11xEverything_testEverything.xml new file mode 100644 index 000000000..65c623123 --- /dev/null +++ b/ear/src/test/resources/org/jboss/test/metadata/ear/JBossApp11xEverything_testEverything.xml @@ -0,0 +1,47 @@ + + + + + + foo + jboss-app-lib0 + + + + sar0.sar + + + + + web-app1.war + /web1-override + + + + + + web-app2.war + /web2 + + + + har0.har + + + The 0 security role + securityRoleRef1RoleLink + principal0 + + + The 1 security role + securityRoleRef2RoleLink + principal1 + +