[jboss-cvs] JBossAS SVN: r72973 - in projects/metadata/tags: 1.0.0.Beta11 and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 2 02:09:56 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-05-02 02:09:56 -0400 (Fri, 02 May 2008)
New Revision: 72973
Added:
projects/metadata/tags/1.0.0.Beta11/
projects/metadata/tags/1.0.0.Beta11/pom.xml
projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java
projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java
projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java
projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml
Removed:
projects/metadata/tags/1.0.0.Beta11/pom.xml
projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java
projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java
projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java
projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java
projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml
Log:
[maven-release-plugin] copy for tag 1.0.0.Beta11
Copied: projects/metadata/tags/1.0.0.Beta11 (from rev 72947, projects/metadata/trunk)
Deleted: projects/metadata/tags/1.0.0.Beta11/pom.xml
===================================================================
--- projects/metadata/trunk/pom.xml 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/pom.xml 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,221 +0,0 @@
-<!--
- vi:ts=2:sw=2:expandtab
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>3</version>
- </parent>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- <packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>JBoss Metadata</name>
- <url>http://www.jboss.org</url>
- <description>The common JavaEE metadata classes</description>
- <scm>
- <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/trunk/</connection>
- </scm>
- <licenses>
- <license>
- <name>lgpl</name>
- <url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
- <organization>
- <name>JBoss, A division of Red Hat</name>
- <url>http://www.jboss.org</url>
- </organization>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>true</testFailureIgnore>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!--
- Eclipse settings have been removed from parent. This needs to be
- done via an eclipse profile.
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
- -->
- <profiles>
- <profile>
- <id>eclipse</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <!-- This profile allows hudson to skip the jboss-deploy step -->
- <id>jboss-deploy</id>
- <activation>
- <property>
- <name>!skip.jboss-deploy</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jboss-deploy-plugin</artifactId>
- <version>1.5</version>
- <executions>
- <execution>
- <id>jboss-deploy</id>
- <goals>
- <goal>jboss-deploy</goal>
- </goals>
- <phase>deploy</phase>
- </execution>
- </executions>
- <configuration>
- <groupId>jboss</groupId>
- <imports>
- <jboss.common-core>2.2.1.GA,2.2.2.GA</jboss.common-core>
- </imports>
- <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
- <removeArtifactVersion>true</removeArtifactVersion>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
- <!-- Compile Dependencies -->
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.0.5.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.5.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-ext-api</artifactId>
- <version>0.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-javaee</artifactId>
- <version>5.0.0.Beta3Update1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-transaction-api</artifactId>
- <version>1.0.1.Beta3Update1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-spi</artifactId>
- <version>1.0.2.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-jaxws</artifactId>
- <version>2.0.1.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>2.0.0.CR9</version>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.0.0.Beta10</version>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta10</version>
- <scope>compile</scope>
- <exclusions>
- <!-- avoid bringing-in xml-apis 2.7.1, shouldn't jbossxb indicate
- it's using xml-apis 2.9.1, or should we explicitly depend on it? -->
- <exclusion>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <!-- avoid bringing-in jboss:jboss-logging-spi:jar:2.0.3.GA:compile,
- we depend on org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile -->
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <version>1.1.0.GA</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
Copied: projects/metadata/tags/1.0.0.Beta11/pom.xml (from rev 72972, projects/metadata/trunk/pom.xml)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/pom.xml (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/pom.xml 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,221 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>3</version>
+ </parent>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0.Beta11</version>
+ <name>JBoss Metadata</name>
+ <url>http://www.jboss.org</url>
+ <description>The common JavaEE metadata classes</description>
+ <scm>
+ <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/tags/1.0.0.Beta11</connection>
+ </scm>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss, A division of Red Hat</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>true</testFailureIgnore>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!--
+ Eclipse settings have been removed from parent. This needs to be
+ done via an eclipse profile.
+ http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
+ -->
+ <profiles>
+ <profile>
+ <id>eclipse</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!-- This profile allows hudson to skip the jboss-deploy step -->
+ <id>jboss-deploy</id>
+ <activation>
+ <property>
+ <name>!skip.jboss-deploy</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>jboss-deploy</id>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ <phase>deploy</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <groupId>jboss</groupId>
+ <imports>
+ <jboss.common-core>2.2.1.GA,2.2.2.GA</jboss.common-core>
+ </imports>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ <removeArtifactVersion>true</removeArtifactVersion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <!-- Compile Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.0.5.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.5.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>0.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <version>5.0.0.Beta3Update1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-transaction-api</artifactId>
+ <version>1.0.1.Beta3Update1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ <version>1.0.2.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <version>2.0.1.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>2.0.0.CR9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>2.0.0.Beta10</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ <version>2.0.0.Beta10</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- avoid bringing-in xml-apis 2.7.1, shouldn't jbossxb indicate
+ it's using xml-apis 2.9.1, or should we explicitly depend on it? -->
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <!-- avoid bringing-in jboss:jboss-logging-spi:jar:2.0.3.GA:compile,
+ we depend on org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile -->
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>1.1.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Deleted: projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,509 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.client.jboss;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.jboss.metadata.client.spec.ApplicationClientMetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.Environment;
-import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
-import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
-import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationsMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
-import org.jboss.metadata.javaee.spec.RemoteEnvironment;
-import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-import org.jboss.metadata.javaee.support.IdMetaData;
-import org.jboss.metadata.javaee.support.IdMetaDataImpl;
-import org.jboss.metadata.javaee.support.IdMetaDataImplWithDescriptionGroup;
-
-/**
- * The jboss javaee client application metadata
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class JBossClientMetaData extends IdMetaDataImplWithDescriptionGroup
- implements RemoteEnvironment
-{
- private static final long serialVersionUID = 1L;
-
- /** The jndi name for the client environment */
- private String jndiName;
-
- /** The environment */
- private JBossEnvironmentRefsGroupMetaData jndiEnvironmentRefsGroup;
- /** A list of extra dependencies to wait on */
- private List<String> depends;
- /** The legacy dtd public id */
- private String dtdPublicId;
- /** The legacy dtd system id */
- private String dtdSystemId;
- /** The version of the jboss client descriptor */
- private String version;
- /** The callback handler */
- private String callbackHandler;
- /** Whether the spec metadata is complete */
- private boolean metaDataComplete;
- /** The message destinations */
- private MessageDestinationsMetaData messageDestinations;
-
- /**
- * Callback for the DTD information
- * @param root
- * @param publicId
- * @param systemId
- */
- @XmlTransient
- public void setDTD(String root, String publicId, String systemId)
- {
- this.dtdPublicId = publicId;
- this.dtdSystemId = systemId;
- // Set the version from legacy public ids
- if(dtdPublicId != null)
- {
- if(dtdPublicId.contains("3.0"))
- setVersion("3.0");
- if(dtdPublicId.contains("3.2"))
- setVersion("3.2");
- if(dtdPublicId.contains("4.0"))
- setVersion("4.0");
- if(dtdPublicId.contains("4.2"))
- setVersion("4.2");
- if(dtdPublicId.contains("5.0"))
- setVersion("5.0");
- }
- }
- /**
- * Get the DTD public id if one was seen
- * @return the value of the web.xml dtd public id
- */
- @XmlTransient
- public String getDtdPublicId()
- {
- return dtdPublicId;
- }
- /**
- * Get the DTD system id if one was seen
- * @return the value of the web.xml dtd system id
- */
- @XmlTransient
- public String getDtdSystemId()
- {
- return dtdSystemId;
- }
-
-
- public String getVersion()
- {
- return version;
- }
- @XmlAttribute(name="version")
- public void setVersion(String version)
- {
- this.version = version;
- }
-
-
- public boolean isMetadataComplete()
- {
- return metaDataComplete;
- }
- public void setMetadataComplete(boolean metaDataComplete)
- {
- this.metaDataComplete = metaDataComplete;
- }
- public String getCallbackHandler()
- {
- return callbackHandler;
- }
- public void setCallbackHandler(String callbackHandler)
- {
- this.callbackHandler = callbackHandler;
- }
-
- public List<String> getDepends()
- {
- return depends;
- }
- public void setDepends(List<String> depends)
- {
- this.depends = depends;
- }
-
- public String getJndiName()
- {
- return jndiName;
- }
- public void setJndiName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public Environment getJndiEnvironmentRefsGroup()
- {
- return jndiEnvironmentRefsGroup;
- }
- @XmlElement(type=JBossEnvironmentRefsGroupMetaData.class)
- public void setJndiEnvironmentRefsGroup(Environment jndiEnvironmentRefsGroup)
- {
- if(jndiEnvironmentRefsGroup == null)
- throw new IllegalArgumentException("jndiEnvironmentRefsGroup is null");
- this.jndiEnvironmentRefsGroup = (JBossEnvironmentRefsGroupMetaData) jndiEnvironmentRefsGroup;
- }
-
- // Convinence accessors
-
- public MessageDestinationsMetaData getMessageDestinations()
- {
- return messageDestinations;
- }
- public void setMessageDestinations(
- MessageDestinationsMetaData messageDestinations)
- {
- this.messageDestinations = messageDestinations;
- }
- @XmlTransient
- public EJBReferenceMetaData getEjbReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getEjbReferenceByName(name);
- }
-
- @XmlTransient
- public EJBReferencesMetaData getEjbReferences()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getEjbReferences();
- }
- // TODO?
- @XmlTransient
- public AnnotatedEJBReferencesMetaData getAnnotatedEjbReferences()
- {
- AnnotatedEJBReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getAnnotatedEjbReferences();
- return refs;
- }
-
- @XmlTransient
- public EnvironmentEntriesMetaData getEnvironmentEntries()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getEnvironmentEntries();
- }
-
- @XmlTransient
- public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getEnvironmentEntryByName(name);
- }
-
- @XmlTransient
- public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getMessageDestinationReferenceByName(name);
- }
-
- @XmlTransient
- public MessageDestinationReferencesMetaData getMessageDestinationReferences()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getMessageDestinationReferences();
- }
-
- @XmlTransient
- public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getPersistenceUnitReferenceByName(name);
- }
-
- @XmlTransient
- public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getPersistenceUnitRefs();
- }
-
- @XmlTransient
- public LifecycleCallbacksMetaData getPostConstructs()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getPostConstructs();
- }
-
- @XmlTransient
- public LifecycleCallbacksMetaData getPreDestroys()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getPreDestroys();
- }
-
- @XmlTransient
- public ServiceReferenceMetaData getServiceReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getServiceReferenceByName(name);
- }
-
- @XmlTransient
- public ServiceReferencesMetaData getServiceReferences()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getServiceReferences();
- }
-
- @XmlTransient
- public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getResourceEnvironmentReferenceByName(name);
- }
-
- @XmlTransient
- public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
- }
-
- @XmlTransient
- public ResourceReferenceMetaData getResourceReferenceByName(String name)
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getResourceReferenceByName(name);
- }
-
- @XmlTransient
- public ResourceReferencesMetaData getResourceReferences()
- {
- if(jndiEnvironmentRefsGroup == null)
- return null;
- return jndiEnvironmentRefsGroup.getResourceReferences();
- }
-
- @Override
- public void merge(IdMetaData override, IdMetaData original)
- {
- throw new RuntimeException("wrong merge method called");
- }
-
- @Override
- public void merge(IdMetaDataImpl override, IdMetaDataImpl original)
- {
- throw new RuntimeException("wrong merge method called");
- }
-
- /**
- * Merge jboss + spec into this
- * @param jboss
- * @param spec
- */
- public void merge(JBossClientMetaData jboss, ApplicationClientMetaData spec, boolean mustOverride)
- {
- super.merge(jboss, spec);
-
- RemoteEnvironmentRefsGroupMetaData jbossEnv = null;
- RemoteEnvironmentRefsGroupMetaData specEnv = null;
- MessageDestinationsMetaData jbossMsgs = null;
- MessageDestinationsMetaData specMsgs = null;
- if(jboss != null)
- {
- if(jboss.depends != null)
- setDepends(jboss.depends);
- if(jboss.jndiName != null)
- this.setJndiName(jboss.jndiName);
- else if(jboss.getDescriptionGroup() != null && jboss.getDescriptionGroup().getDisplayName() != null)
- this.setJndiName(jboss.getDescriptionGroup().getDisplayName());
- if(jboss.dtdPublicId != null)
- this.dtdPublicId = jboss.dtdPublicId;
- if(jboss.dtdSystemId != null)
- this.dtdSystemId = jboss.dtdSystemId;
- if(jboss.version != null)
- this.version = jboss.version;
- jbossEnv = jboss.jndiEnvironmentRefsGroup;
- jbossMsgs = jboss.getMessageDestinations();
- }
- if(spec != null)
- {
- specEnv = spec.getJndiEnvironmentRefsGroup();
- specMsgs = spec.getMessageDestinations();
- if(jndiName == null && spec.getDescriptionGroup() != null && spec.getDescriptionGroup().getDisplayName() != null)
- setJndiName(spec.getDescriptionGroup().getDisplayName());
- metaDataComplete = spec.isMetadataComplete();
- specMsgs = spec.getMessageDestinations();
- }
-
- if(jboss != null && jboss.callbackHandler != null)
- this.setCallbackHandler(jboss.callbackHandler);
- else if(spec != null && spec.getCallbackHandler() != null)
- this.setCallbackHandler(spec.getCallbackHandler());
-
- if(jndiEnvironmentRefsGroup == null)
- jndiEnvironmentRefsGroup = new JBossEnvironmentRefsGroupMetaData();
- jndiEnvironmentRefsGroup.merge(jbossEnv, specEnv, "jboss-client.xml", "application-client.xml", false);
-
- // Get the merged resource-env-refs
- ResourceEnvironmentReferencesMetaData resEnvRefs = jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
-
- // Merge the message-destinations
- messageDestinations = MessageDestinationsMetaData.merge(jbossMsgs, specMsgs, "jboss-client.xml", "application-client.xml");
-
- /* Need to map message-destinations to resource-env-refs for legacy
- * descriptors that did not have message-destinations
- */
- if(messageDestinations != null && resEnvRefs != null)
- {
- for(MessageDestinationMetaData md : messageDestinations)
- {
- if(md.getMappedName() == null)
- {
- ResourceEnvironmentReferenceMetaData ref = resEnvRefs.get(md.getMessageDestinationName());
- if(ref != null)
- md.setMappedName(ref.getMappedName());
- }
- }
- }
-
- /** A HashMap<String, ArrayList<MessageDestinationReferenceMetaData>> of
- * message-destination-ref that resolve to a jndi-name via a message-destination
- * via a message-destination-link
- */
- HashMap<String, ArrayList<MessageDestinationReferenceMetaData>> resourceEnvReferenceLinks
- = new HashMap<String, ArrayList<MessageDestinationReferenceMetaData>>();
- /* Merge the message-destination-ref elements
- This is a bit convoluted because legacy jboss descriptors did not support
- message-destination-ref elements.
- A message-destination-ref is linked to a jndi-name either via
- the message-destination-ref/message-destination-ref-name mapping to
- a jboss resource-env-ref/resource-env-ref-name if there is no
- message-destination-link, or by the message-destination-link ->
- message-destination/message-destination-name mapping to a jboss
- resource-env-ref/resource-env-ref-name.
- */
- if(specEnv != null)
- {
- ResourceEnvironmentReferencesMetaData specEnvRefs = specEnv.getResourceEnvironmentReferences();
- MessageDestinationReferencesMetaData specMsgRefs = specEnv.getMessageDestinationReferences();
- MessageDestinationReferencesMetaData msgRefs = jndiEnvironmentRefsGroup.getMessageDestinationReferences();
- if(msgRefs == null)
- {
- msgRefs = new MessageDestinationReferencesMetaData();
- jndiEnvironmentRefsGroup.setMessageDestinationReferences(msgRefs);
- }
- if(specMsgRefs != null)
- for(MessageDestinationReferenceMetaData ref : specMsgRefs)
- {
- ref = (MessageDestinationReferenceMetaData)ref.clone();
- String link = ref.getLink();
- if (link != null)
- {
- ArrayList<MessageDestinationReferenceMetaData> linkedRefs = resourceEnvReferenceLinks.get(link);
- if (linkedRefs == null)
- {
- linkedRefs = new ArrayList<MessageDestinationReferenceMetaData>();
- resourceEnvReferenceLinks.put(link, linkedRefs);
- }
- linkedRefs.add(ref);
- }
- msgRefs.add(ref);
- }
-
- // Merge the spec resource-env-refs
- if(resEnvRefs != null && specEnvRefs != null)
- for(ResourceEnvironmentReferenceMetaData ref : resEnvRefs)
- {
- String resRefName = ref.getResourceEnvRefName();
- ResourceEnvironmentReferenceMetaData specRef = specEnvRefs.get(resRefName);
- if (specRef == null)
- {
- // Try the resourceEnvReferenceLinks
- ArrayList<MessageDestinationReferenceMetaData> linkedRefs = resourceEnvReferenceLinks.get(resRefName);
- if (linkedRefs != null)
- {
- for(MessageDestinationReferenceMetaData mref : linkedRefs)
- {
- if(mref.getIgnoreDependency() != null)
- ref.setIgnoreDependency(mref.getIgnoreDependency());
- if(mref.getType() != null)
- ref.setType(mref.getType());
- mref.setMappedName(ref.getMappedName());
- }
- }
- else if(msgRefs.containsKey(resRefName))
- {
- MessageDestinationReferenceMetaData mref = msgRefs.get(resRefName);
- mref.setMappedName(ref.getMappedName());
- }
- else
- {
- throw new IllegalStateException("resource-env-ref " + resRefName + " found in jboss-client.xml but not in application-client.xml");
- }
- }
- else
- {
- // Merge the spec ref into the jboss ref
- ref.merge(null, specRef);
- }
- }
- }
-
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java (from rev 72963, projects/metadata/trunk/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/client/jboss/JBossClientMetaData.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,529 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.client.jboss;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.jboss.metadata.client.spec.ApplicationClientMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.Environment;
+import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationsMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
+import org.jboss.metadata.javaee.spec.RemoteEnvironment;
+import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+import org.jboss.metadata.javaee.support.IdMetaData;
+import org.jboss.metadata.javaee.support.IdMetaDataImpl;
+import org.jboss.metadata.javaee.support.IdMetaDataImplWithDescriptionGroup;
+
+/**
+ * The jboss javaee client application metadata
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class JBossClientMetaData extends IdMetaDataImplWithDescriptionGroup
+ implements RemoteEnvironment
+{
+ private static final long serialVersionUID = 1L;
+
+ /** The jndi name for the client environment */
+ private String jndiName;
+
+ /** The environment */
+ private JBossEnvironmentRefsGroupMetaData jndiEnvironmentRefsGroup;
+ /** A list of extra dependencies to wait on */
+ private List<String> depends;
+ /** The legacy dtd public id */
+ private String dtdPublicId;
+ /** The legacy dtd system id */
+ private String dtdSystemId;
+ /** The version of the jboss client descriptor */
+ private String version;
+ /** The callback handler */
+ private String callbackHandler;
+ /** Whether the spec metadata is complete */
+ private boolean metaDataComplete;
+ /** The message destinations */
+ private MessageDestinationsMetaData messageDestinations;
+
+ /**
+ * Callback for the DTD information
+ * @param root
+ * @param publicId
+ * @param systemId
+ */
+ @XmlTransient
+ public void setDTD(String root, String publicId, String systemId)
+ {
+ this.dtdPublicId = publicId;
+ this.dtdSystemId = systemId;
+ // Set the version from legacy public ids
+ if(dtdPublicId != null)
+ {
+ if(dtdPublicId.contains("3.0"))
+ setVersion("3.0");
+ if(dtdPublicId.contains("3.2"))
+ setVersion("3.2");
+ if(dtdPublicId.contains("4.0"))
+ setVersion("4.0");
+ if(dtdPublicId.contains("4.2"))
+ setVersion("4.2");
+ if(dtdPublicId.contains("5.0"))
+ setVersion("5.0");
+ }
+ }
+ /**
+ * Get the DTD public id if one was seen
+ * @return the value of the web.xml dtd public id
+ */
+ @XmlTransient
+ public String getDtdPublicId()
+ {
+ return dtdPublicId;
+ }
+ /**
+ * Get the DTD system id if one was seen
+ * @return the value of the web.xml dtd system id
+ */
+ @XmlTransient
+ public String getDtdSystemId()
+ {
+ return dtdSystemId;
+ }
+
+
+ public String getVersion()
+ {
+ return version;
+ }
+ @XmlAttribute(name="version")
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+
+ public boolean isMetadataComplete()
+ {
+ return metaDataComplete;
+ }
+ public void setMetadataComplete(boolean metaDataComplete)
+ {
+ this.metaDataComplete = metaDataComplete;
+ }
+ public String getCallbackHandler()
+ {
+ return callbackHandler;
+ }
+ public void setCallbackHandler(String callbackHandler)
+ {
+ this.callbackHandler = callbackHandler;
+ }
+
+ public List<String> getDepends()
+ {
+ return depends;
+ }
+ public void setDepends(List<String> depends)
+ {
+ this.depends = depends;
+ }
+
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+ public void setJndiName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public Environment getJndiEnvironmentRefsGroup()
+ {
+ return jndiEnvironmentRefsGroup;
+ }
+ @XmlElement(type=JBossEnvironmentRefsGroupMetaData.class)
+ public void setJndiEnvironmentRefsGroup(Environment jndiEnvironmentRefsGroup)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ throw new IllegalArgumentException("jndiEnvironmentRefsGroup is null");
+ this.jndiEnvironmentRefsGroup = (JBossEnvironmentRefsGroupMetaData) jndiEnvironmentRefsGroup;
+ }
+
+ // Convinence accessors
+
+ /**
+ * Get a message destination
+ *
+ * @param name the name of the destination
+ * @return the destination or null if not found
+ */
+ public MessageDestinationMetaData getMessageDestinationByName(String name)
+ {
+ if (messageDestinations == null)
+ return null;
+ return messageDestinations.get(name);
+ }
+ public MessageDestinationsMetaData getMessageDestinations()
+ {
+ return messageDestinations;
+ }
+ public void setMessageDestinations(
+ MessageDestinationsMetaData messageDestinations)
+ {
+ this.messageDestinations = messageDestinations;
+ }
+ @XmlTransient
+ public EJBReferenceMetaData getEjbReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getEjbReferenceByName(name);
+ }
+
+ @XmlTransient
+ public EJBReferencesMetaData getEjbReferences()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getEjbReferences();
+ }
+ // TODO?
+ @XmlTransient
+ public AnnotatedEJBReferencesMetaData getAnnotatedEjbReferences()
+ {
+ AnnotatedEJBReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getAnnotatedEjbReferences();
+ return refs;
+ }
+
+ @XmlTransient
+ public EnvironmentEntriesMetaData getEnvironmentEntries()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getEnvironmentEntries();
+ }
+
+ @XmlTransient
+ public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getEnvironmentEntryByName(name);
+ }
+
+ @XmlTransient
+ public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getMessageDestinationReferenceByName(name);
+ }
+
+ @XmlTransient
+ public MessageDestinationReferencesMetaData getMessageDestinationReferences()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getMessageDestinationReferences();
+ }
+
+ @XmlTransient
+ public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getPersistenceUnitReferenceByName(name);
+ }
+
+ @XmlTransient
+ public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getPersistenceUnitRefs();
+ }
+
+ @XmlTransient
+ public LifecycleCallbacksMetaData getPostConstructs()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getPostConstructs();
+ }
+
+ @XmlTransient
+ public LifecycleCallbacksMetaData getPreDestroys()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getPreDestroys();
+ }
+
+ @XmlTransient
+ public ServiceReferenceMetaData getServiceReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getServiceReferenceByName(name);
+ }
+
+ @XmlTransient
+ public ServiceReferencesMetaData getServiceReferences()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getServiceReferences();
+ }
+
+ @XmlTransient
+ public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getResourceEnvironmentReferenceByName(name);
+ }
+
+ @XmlTransient
+ public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
+ }
+
+ @XmlTransient
+ public ResourceReferenceMetaData getResourceReferenceByName(String name)
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getResourceReferenceByName(name);
+ }
+
+ @XmlTransient
+ public ResourceReferencesMetaData getResourceReferences()
+ {
+ if(jndiEnvironmentRefsGroup == null)
+ return null;
+ return jndiEnvironmentRefsGroup.getResourceReferences();
+ }
+
+ @Override
+ public void merge(IdMetaData override, IdMetaData original)
+ {
+ throw new RuntimeException("wrong merge method called");
+ }
+
+ @Override
+ public void merge(IdMetaDataImpl override, IdMetaDataImpl original)
+ {
+ throw new RuntimeException("wrong merge method called");
+ }
+
+ /**
+ * Merge jboss + spec into this
+ * @param jboss
+ * @param spec
+ */
+ public void merge(JBossClientMetaData jboss, ApplicationClientMetaData spec, boolean mustOverride)
+ {
+ super.merge(jboss, spec);
+
+ RemoteEnvironmentRefsGroupMetaData jbossEnv = null;
+ RemoteEnvironmentRefsGroupMetaData specEnv = null;
+ MessageDestinationsMetaData jbossMsgs = null;
+ MessageDestinationsMetaData specMsgs = null;
+ if(jboss != null)
+ {
+ if(jboss.depends != null)
+ setDepends(jboss.depends);
+ if(jboss.jndiName != null)
+ this.setJndiName(jboss.jndiName);
+ else if(jboss.getDescriptionGroup() != null && jboss.getDescriptionGroup().getDisplayName() != null)
+ this.setJndiName(jboss.getDescriptionGroup().getDisplayName());
+ if(jboss.dtdPublicId != null)
+ this.dtdPublicId = jboss.dtdPublicId;
+ if(jboss.dtdSystemId != null)
+ this.dtdSystemId = jboss.dtdSystemId;
+ if(jboss.version != null)
+ this.version = jboss.version;
+ jbossEnv = jboss.jndiEnvironmentRefsGroup;
+ jbossMsgs = jboss.getMessageDestinations();
+ }
+ if(spec != null)
+ {
+ specEnv = spec.getJndiEnvironmentRefsGroup();
+ specMsgs = spec.getMessageDestinations();
+ if(jndiName == null && spec.getDescriptionGroup() != null && spec.getDescriptionGroup().getDisplayName() != null)
+ setJndiName(spec.getDescriptionGroup().getDisplayName());
+ metaDataComplete = spec.isMetadataComplete();
+ specMsgs = spec.getMessageDestinations();
+ }
+
+ if(jboss != null && jboss.callbackHandler != null)
+ this.setCallbackHandler(jboss.callbackHandler);
+ else if(spec != null && spec.getCallbackHandler() != null)
+ this.setCallbackHandler(spec.getCallbackHandler());
+
+ if(jndiEnvironmentRefsGroup == null)
+ jndiEnvironmentRefsGroup = new JBossEnvironmentRefsGroupMetaData();
+ jndiEnvironmentRefsGroup.merge(jbossEnv, specEnv, "jboss-client.xml", "application-client.xml", false);
+
+ // Get the merged resource-env-refs
+ ResourceEnvironmentReferencesMetaData resEnvRefs = jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
+
+ // Merge the message-destinations
+ messageDestinations = MessageDestinationsMetaData.merge(jbossMsgs, specMsgs, "jboss-client.xml", "application-client.xml");
+
+ /* Need to map message-destinations to resource-env-refs for legacy
+ * descriptors that did not have message-destinations
+ */
+ if(messageDestinations != null && resEnvRefs != null)
+ {
+ for(MessageDestinationMetaData md : messageDestinations)
+ {
+ if(md.getMappedName() == null)
+ {
+ ResourceEnvironmentReferenceMetaData ref = resEnvRefs.get(md.getMessageDestinationName());
+ if(ref != null)
+ md.setMappedName(ref.getMappedName());
+ }
+ }
+ }
+
+ /** A HashMap<String, ArrayList<MessageDestinationReferenceMetaData>> of
+ * message-destination-ref that resolve to a jndi-name via a message-destination
+ * via a message-destination-link
+ */
+ HashMap<String, ArrayList<MessageDestinationReferenceMetaData>> resourceEnvReferenceLinks
+ = new HashMap<String, ArrayList<MessageDestinationReferenceMetaData>>();
+ /* Merge the message-destination-ref elements
+ This is a bit convoluted because legacy jboss descriptors did not support
+ message-destination-ref elements.
+ A message-destination-ref is linked to a jndi-name either via
+ the message-destination-ref/message-destination-ref-name mapping to
+ a jboss resource-env-ref/resource-env-ref-name if there is no
+ message-destination-link, or by the message-destination-link ->
+ message-destination/message-destination-name mapping to a jboss
+ resource-env-ref/resource-env-ref-name.
+ */
+ if(specEnv != null)
+ {
+ ResourceEnvironmentReferencesMetaData specEnvRefs = specEnv.getResourceEnvironmentReferences();
+ MessageDestinationReferencesMetaData specMsgRefs = specEnv.getMessageDestinationReferences();
+ MessageDestinationReferencesMetaData msgRefs = jndiEnvironmentRefsGroup.getMessageDestinationReferences();
+ if(msgRefs == null)
+ {
+ msgRefs = new MessageDestinationReferencesMetaData();
+ jndiEnvironmentRefsGroup.setMessageDestinationReferences(msgRefs);
+ }
+ if(specMsgRefs != null)
+ for(MessageDestinationReferenceMetaData ref : specMsgRefs)
+ {
+ ref = (MessageDestinationReferenceMetaData)ref.clone();
+ String link = ref.getLink();
+ if (link != null)
+ {
+ ArrayList<MessageDestinationReferenceMetaData> linkedRefs = resourceEnvReferenceLinks.get(link);
+ if (linkedRefs == null)
+ {
+ linkedRefs = new ArrayList<MessageDestinationReferenceMetaData>();
+ resourceEnvReferenceLinks.put(link, linkedRefs);
+ }
+ linkedRefs.add(ref);
+ }
+ if(msgRefs.contains(ref) == false)
+ msgRefs.add(ref);
+ else
+ {
+ MessageDestinationReferenceMetaData existingRef = msgRefs.get(ref.getMessageDestinationRefName());
+ existingRef.merge(null, ref);
+ }
+ }
+
+ // Merge the spec resource-env-refs
+ if(resEnvRefs != null && specEnvRefs != null)
+ for(ResourceEnvironmentReferenceMetaData ref : resEnvRefs)
+ {
+ String resRefName = ref.getResourceEnvRefName();
+ ResourceEnvironmentReferenceMetaData specRef = specEnvRefs.get(resRefName);
+ if (specRef == null)
+ {
+ // Try the resourceEnvReferenceLinks
+ ArrayList<MessageDestinationReferenceMetaData> linkedRefs = resourceEnvReferenceLinks.get(resRefName);
+ if (linkedRefs != null)
+ {
+ for(MessageDestinationReferenceMetaData mref : linkedRefs)
+ {
+ // Need to make sure this is the ref in the map
+ MessageDestinationReferenceMetaData existingRef = msgRefs.get(mref.getMessageDestinationRefName());
+ if(existingRef.getIgnoreDependency() != null)
+ ref.setIgnoreDependency(mref.getIgnoreDependency());
+ if(existingRef.getType() != null)
+ ref.setType(mref.getType());
+ existingRef.setMappedName(ref.getMappedName());
+ }
+ }
+ else if(msgRefs.containsKey(resRefName))
+ {
+ MessageDestinationReferenceMetaData mref = msgRefs.get(resRefName);
+ mref.setMappedName(ref.getMappedName());
+ }
+ else
+ {
+ throw new IllegalStateException("resource-env-ref " + resRefName + " found in jboss-client.xml but not in application-client.xml");
+ }
+ }
+ else
+ {
+ // Merge the spec ref into the jboss ref
+ ref.merge(null, specRef);
+ }
+ }
+ }
+
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.javaee.spec;
-
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.metadata.javaee.support.MergeableMappedMetaData;
-
-/**
- * Metadata for an @EJB reference
- * @EJB.name = ejbRefName
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
- at XmlType(name="annotated-ejb-refType")
-public class AnnotatedEJBReferenceMetaData
- extends AbstractEJBReferenceMetaData
- implements MergeableMappedMetaData<AnnotatedEJBReferenceMetaData>
-{
- private static final long serialVersionUID = 1;
- private Class beanInterface;
-
- public Class getBeanInterface()
- {
- return beanInterface;
- }
- public void setBeanInterface(Class beanInterface)
- {
- this.beanInterface = beanInterface;
- }
-
- public AnnotatedEJBReferenceMetaData merge(AnnotatedEJBReferenceMetaData original)
- {
- AnnotatedEJBReferenceMetaData merged = new AnnotatedEJBReferenceMetaData();
- merged.merge(this, original);
- if(beanInterface != null)
- merged.setBeanInterface(beanInterface);
- else if(original != null && original.getBeanInterface() != null)
- merged.setBeanInterface(original.getBeanInterface());
- return merged;
- }
-
- @Override
- public String toString()
- {
- StringBuilder tmp = new StringBuilder("AnnotatedEJBReferenceMetaData{");
- tmp.append("name=");
- tmp.append(super.getEjbRefName());
- tmp.append(",ejb-ref-type=");
- tmp.append(super.getEjbRefType());
- tmp.append(",link=");
- tmp.append(super.getLink());
- tmp.append(",ignore-dependecy=");
- tmp.append(super.isDependencyIgnored());
- tmp.append(",jndi-name=");
- tmp.append(super.getJndiName());
- tmp.append(",resolvoed-jndi-name=");
- tmp.append(super.getResolvedJndiName());
- tmp.append(",beanInterface=");
- tmp.append(getBeanInterface());
- tmp.append('}');
- return tmp.toString();
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java (from rev 72960, projects/metadata/trunk/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/java/org/jboss/metadata/javaee/spec/AnnotatedEJBReferenceMetaData.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.javaee.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.metadata.javaee.support.MergeableMappedMetaData;
+
+/**
+ * Metadata for an @EJB reference
+ * @EJB.name = ejbRefName
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at XmlType(name="annotated-ejb-refType")
+public class AnnotatedEJBReferenceMetaData
+ extends AbstractEJBReferenceMetaData
+ implements MergeableMappedMetaData<AnnotatedEJBReferenceMetaData>
+{
+ private static final long serialVersionUID = 1;
+ private Class beanInterface;
+
+ public Class getBeanInterface()
+ {
+ return beanInterface;
+ }
+ public void setBeanInterface(Class beanInterface)
+ {
+ this.beanInterface = beanInterface;
+ }
+
+ public AnnotatedEJBReferenceMetaData merge(AnnotatedEJBReferenceMetaData original)
+ {
+ AnnotatedEJBReferenceMetaData merged = new AnnotatedEJBReferenceMetaData();
+ merged.merge(this, original);
+ if(beanInterface != null)
+ merged.setBeanInterface(beanInterface);
+ else if(original != null && original.getBeanInterface() != null)
+ merged.setBeanInterface(original.getBeanInterface());
+ return merged;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder tmp = new StringBuilder("AnnotatedEJBReferenceMetaData{");
+ tmp.append("name=");
+ tmp.append(super.getEjbRefName());
+ tmp.append(",ejb-ref-type=");
+ tmp.append(super.getEjbRefType());
+ tmp.append(",link=");
+ tmp.append(super.getLink());
+ tmp.append(",ignore-dependecy=");
+ tmp.append(super.isDependencyIgnored());
+ tmp.append(",mapped/jndi-name=");
+ tmp.append(super.getJndiName());
+ tmp.append(",resolved-jndi-name=");
+ tmp.append(super.getResolvedJndiName());
+ tmp.append(",beanInterface=");
+ tmp.append(getBeanInterface());
+ tmp.append('}');
+ return tmp.toString();
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd
===================================================================
--- projects/metadata/trunk/src/main/resources/dtd/jboss-client_5_0.dtd 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,149 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!--
-$Id$
-
-The JBoss specific elements used to deploy an application client.
-This version applies to the JBoss 5.x releases and the
-j2ee-1.4 application-client_1_4.xsd.
-
- <!DOCTYPE jboss-client PUBLIC
- "-//JBoss//DTD Application Client 5.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
--->
-
-<!ENTITY % service-ref PUBLIC
- "-//JBoss//DTD Web Service Reference 5.0//EN"
- "http://www.jboss.org/j2ee/dtd/service-ref_5_0.dtd">
-
-%service-ref;
-
-<!-- The jboss-client element is the root element.
--->
-<!ELEMENT jboss-client (jndi-name, ejb-ref*, service-ref*, resource-ref*,
- resource-env-ref*)>
-
-<!-- The required jndi-name element specifies the JNDI name of a deployed
-object. It is used in two different contexts:
-
-1. In jboss-client to specify the location in JNDI on the server side which
-contains the ObjectFactory which handles the java:comp/env enterprise naming
-context (ENC) on the client. The application client code maps its ENC to the
-approriate client jar deployment jboss-client/jndi-name value by specifying this
-location via the j2ee.clientName IntialContext environment property, or as a
-system property. The prototype code for creating the client side InitialContext
-is:
-
- Properties env = new Properties();
- env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
- "org.jnp.interfaces.NamingContextFactory");
- env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
- env.setProperty(Context.PROVIDER_URL, "jnp://somehost:1099");
- env.setProperty("j2ee.clientName", "test-client");
- InitialContext ctx = new InitialContext(env);
- Context enc = (Context) ctx.lookup("java:comp/env");
-
-2. In resource-ref, resource-env-ref, ejb-ref to specify the the actual server
-side binding location of the target the client ENC binding will link to via a
-JNDI LinkRef.
-
-Used in: jboss-client, resource-ref, resource-env-ref, ejb-ref
--->
-<!ELEMENT jndi-name (#PCDATA)>
-
-<!-- The ejb-ref element maps from the servlet ENC relative name
-of the ejb reference to the deployment environment JNDI name of
-the bean.
-Example:
- <ejb-ref>
- <ejb-ref-name>ejb/Bean0</ejb-ref-name>
- <jndi-name>deployed/ejbs/Bean0</jndi-name>
- </ejb-ref>
--->
-<!ELEMENT ejb-ref (ejb-ref-name , jndi-name)>
-
-<!-- The ejb-ref-name element gives the ENC relative name used
-in the client code.
-
-Used in: ejb-ref
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--The resource-ref element maps from the client ENC relative name
-of the resource-ref to the deployment environment JNDI name of
-the resource manager connection factory.
-Example:
- <resource-ref>
- <res-ref-name>jdbc/TheDataSource</res-ref-name>
- <jndi-name>java:/DefaultDS</jndi-name>
- </resource-ref>
-
- <resource-ref>
- <res-ref-name>url/XYZHome</res-ref-name>
- <res-url>http://x.y.z</res-url>
- </resource-ref>
--->
-<!ELEMENT resource-ref (res-ref-name , (jndi-name | res-url))>
-
-<!-- The res-ref-name specifies the name of the application-client.xml
-res-ref-name element to which this mapping applies.
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--The resource-env-ref element maps from the servlet ENC relative name
-of the resource-env-ref to the deployment environment JNDI name of
-the administered object resource.
-Example:
- <resource-env-ref>
- <resource-env-ref-name>jms/NewsTopic</resource-env-ref-name>
- <jndi-name>topic/NewsTopic</jndi-name>
- </resource-env-ref>
--->
-<!ELEMENT resource-env-ref (resource-env-ref-name , jndi-name)>
-
-<!-- The resource-env-ref-name specifies the name of the application-client.xml
-resource-env-ref-name element to which this mapping applies.
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!-- The res-url element value is a URL string for a resource-ref of
-res-type = java.net.URL. Using a res-url creates a binding of the URL
-instance under the java:comp/env. If you want to link to another binding
-of a URL, you can use the jndi-name to do so.
-
-// Binds the URL(http://x.y.z) under java:comp/env/jdbc/XYZHome
-<resource-ref>
- <res-ref-name>jdbc/XYZHome</res-ref-name>
- <res-url>http://x.y.z</res-url>
-</resource-ref>
-// Binds a link to urls/XYZHomePage under java:comp/env/jdbc/XYZHome
-<resource-ref>
- <res-ref-name>jdbc/XYZHome</res-ref-name>
- <res-url>urls/XYZHomePage</res-url>
-</resource-ref>
-
- Used in: resource-ref
--->
-<!ELEMENT res-url (#PCDATA)>
-
-<!-- message-destination-ref is used to directly bind a message destination reference
-to the JNDI name of a Queue, Topic, or some other physical destination. It should
-only be used when the corresponding message destination reference does not
-specify a message-destination-link to a logical message-destination.
-Example:
- <message-destination-ref>
- <message-destination-ref-name>MyQueue</message-destination-ref-name>
- <jndi-name>queue/GlobalQueue</jndi-name>
- </message-destination-ref>
--->
-<!ELEMENT message-destination-ref (message-destination-ref-name, jndi-name)>
-
-<!-- The message-destination-ref-name specifies the name of the application-client.xml
-message-destination-ref-name element to which this mapping applies.
--->
-<!ELEMENT message-destination-ref-name (#PCDATA)>
-
-<!-- The depends element gives a JMX ObjectName of a service on which the
-container depends.
--->
-<!ELEMENT depends (#PCDATA)>
Copied: projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd (from rev 72953, projects/metadata/trunk/src/main/resources/dtd/jboss-client_5_0.dtd)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/main/resources/dtd/jboss-client_5_0.dtd 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,149 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--
+$Id$
+
+The JBoss specific elements used to deploy an application client.
+This version applies to the JBoss 5.x releases and the
+j2ee-1.4 application-client_1_4.xsd.
+
+ <!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
+-->
+
+<!ENTITY % service-ref PUBLIC
+ "-//JBoss//DTD Web Service Reference 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/service-ref_5_0.dtd">
+
+%service-ref;
+
+<!-- The jboss-client element is the root element.
+-->
+<!ELEMENT jboss-client (jndi-name, ejb-ref*, service-ref*, resource-ref*,
+ resource-env-ref*, message-destination-ref*, depends*)>
+
+<!-- The required jndi-name element specifies the JNDI name of a deployed
+object. It is used in two different contexts:
+
+1. In jboss-client to specify the location in JNDI on the server side which
+contains the ObjectFactory which handles the java:comp/env enterprise naming
+context (ENC) on the client. The application client code maps its ENC to the
+approriate client jar deployment jboss-client/jndi-name value by specifying this
+location via the j2ee.clientName IntialContext environment property, or as a
+system property. The prototype code for creating the client side InitialContext
+is:
+
+ Properties env = new Properties();
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+ env.setProperty(Context.PROVIDER_URL, "jnp://somehost:1099");
+ env.setProperty("j2ee.clientName", "test-client");
+ InitialContext ctx = new InitialContext(env);
+ Context enc = (Context) ctx.lookup("java:comp/env");
+
+2. In resource-ref, resource-env-ref, ejb-ref to specify the the actual server
+side binding location of the target the client ENC binding will link to via a
+JNDI LinkRef.
+
+Used in: jboss-client, resource-ref, resource-env-ref, ejb-ref
+-->
+<!ELEMENT jndi-name (#PCDATA)>
+
+<!-- The ejb-ref element maps from the servlet ENC relative name
+of the ejb reference to the deployment environment JNDI name of
+the bean.
+Example:
+ <ejb-ref>
+ <ejb-ref-name>ejb/Bean0</ejb-ref-name>
+ <jndi-name>deployed/ejbs/Bean0</jndi-name>
+ </ejb-ref>
+-->
+<!ELEMENT ejb-ref (ejb-ref-name , jndi-name)>
+
+<!-- The ejb-ref-name element gives the ENC relative name used
+in the client code.
+
+Used in: ejb-ref
+-->
+<!ELEMENT ejb-ref-name (#PCDATA)>
+
+<!--The resource-ref element maps from the client ENC relative name
+of the resource-ref to the deployment environment JNDI name of
+the resource manager connection factory.
+Example:
+ <resource-ref>
+ <res-ref-name>jdbc/TheDataSource</res-ref-name>
+ <jndi-name>java:/DefaultDS</jndi-name>
+ </resource-ref>
+
+ <resource-ref>
+ <res-ref-name>url/XYZHome</res-ref-name>
+ <res-url>http://x.y.z</res-url>
+ </resource-ref>
+-->
+<!ELEMENT resource-ref (res-ref-name , (jndi-name | res-url))>
+
+<!-- The res-ref-name specifies the name of the application-client.xml
+res-ref-name element to which this mapping applies.
+-->
+<!ELEMENT res-ref-name (#PCDATA)>
+
+<!--The resource-env-ref element maps from the servlet ENC relative name
+of the resource-env-ref to the deployment environment JNDI name of
+the administered object resource.
+Example:
+ <resource-env-ref>
+ <resource-env-ref-name>jms/NewsTopic</resource-env-ref-name>
+ <jndi-name>topic/NewsTopic</jndi-name>
+ </resource-env-ref>
+-->
+<!ELEMENT resource-env-ref (resource-env-ref-name , jndi-name)>
+
+<!-- The resource-env-ref-name specifies the name of the application-client.xml
+resource-env-ref-name element to which this mapping applies.
+-->
+<!ELEMENT resource-env-ref-name (#PCDATA)>
+
+<!-- The res-url element value is a URL string for a resource-ref of
+res-type = java.net.URL. Using a res-url creates a binding of the URL
+instance under the java:comp/env. If you want to link to another binding
+of a URL, you can use the jndi-name to do so.
+
+// Binds the URL(http://x.y.z) under java:comp/env/jdbc/XYZHome
+<resource-ref>
+ <res-ref-name>jdbc/XYZHome</res-ref-name>
+ <res-url>http://x.y.z</res-url>
+</resource-ref>
+// Binds a link to urls/XYZHomePage under java:comp/env/jdbc/XYZHome
+<resource-ref>
+ <res-ref-name>jdbc/XYZHome</res-ref-name>
+ <res-url>urls/XYZHomePage</res-url>
+</resource-ref>
+
+ Used in: resource-ref
+-->
+<!ELEMENT res-url (#PCDATA)>
+
+<!-- message-destination-ref is used to directly bind a message destination reference
+to the JNDI name of a Queue, Topic, or some other physical destination. It should
+only be used when the corresponding message destination reference does not
+specify a message-destination-link to a logical message-destination.
+Example:
+ <message-destination-ref>
+ <message-destination-ref-name>MyQueue</message-destination-ref-name>
+ <jndi-name>queue/GlobalQueue</jndi-name>
+ </message-destination-ref>
+-->
+<!ELEMENT message-destination-ref (message-destination-ref-name, jndi-name)>
+
+<!-- The message-destination-ref-name specifies the name of the application-client.xml
+message-destination-ref-name element to which this mapping applies.
+-->
+<!ELEMENT message-destination-ref-name (#PCDATA)>
+
+<!-- The depends element gives a JMX ObjectName of a service on which the
+container depends.
+-->
+<!ELEMENT depends (#PCDATA)>
Deleted: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.metadata.annotation.client;
-
-import java.lang.reflect.AnnotatedElement;
-import java.util.Collection;
-import java.util.Set;
-
-import org.jboss.metadata.annotation.creator.client.ApplicationClient5MetaDataCreator;
-import org.jboss.metadata.annotation.finder.AnnotationFinder;
-import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
-import org.jboss.metadata.client.jboss.JBossClient5DTDMetaData;
-import org.jboss.metadata.client.spec.AnnotationMergedView;
-import org.jboss.metadata.client.spec.ApplicationClient14DTDMetaData;
-import org.jboss.metadata.client.spec.ApplicationClient14MetaData;
-import org.jboss.metadata.client.spec.ApplicationClient5MetaData;
-import org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData;
-import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
-import org.jboss.metadata.ejb.spec.EjbJar20MetaData;
-import org.jboss.metadata.ejb.spec.EjbJar21MetaData;
-import org.jboss.metadata.ejb.spec.EjbJar30MetaData;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferenceMetaData;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
-import org.jboss.metadata.javaee.spec.LifecycleCallbackMetaData;
-import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
-import org.jboss.test.metadata.annotation.client.basic.Client;
-import org.jboss.test.metadata.annotation.client.basic.ResourceIF;
-import org.jboss.test.metadata.common.PackageScanner;
-import org.jboss.test.metadata.common.ScanPackage;
-import org.jboss.test.metadata.javaee.AbstractJavaEEMetaDataTest;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-import org.omg.CORBA.ORB;
-
-/**
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class AnnotationClientUnitTestCase extends AbstractJavaEEMetaDataTest
-{
- public static SchemaBindingResolver initResolver()
- {
- DefaultSchemaResolver resolver = new DefaultSchemaResolver();
-
- resolver.addClassBindingForLocation("application-client_1_3.dtd", ApplicationClient14DTDMetaData.class);
- resolver.addClassBindingForLocation("application-client_1_4.xsd", ApplicationClient14MetaData.class);
- resolver.addClassBindingForLocation("application-client_5.xsd", ApplicationClient5MetaData.class);
- resolver.addClassBindingForLocation("jboss-client", JBossClient5DTDMetaData.class);
- return resolver;
- }
-
- public AnnotationClientUnitTestCase(String name)
- {
- super(name);
- }
-
- @SuppressWarnings("unchecked")
- @ScanPackage("org.jboss.test.metadata.annotation.client.basic")
- public void testApplicationClientProcessor()
- throws Exception
- {
- AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
-
- Collection<Class<?>> classes = PackageScanner.loadClasses();
- System.out.println("Processing classes: "+classes);
- ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder);
- ApplicationClient5MetaData clientMD = creator.create(classes);
- System.out.println(clientMD.getAnnotatedEjbReferences());
- assertEquals(3, clientMD.getAnnotatedEjbReferences().size());
-
- AnnotatedEJBReferenceMetaData resourceMethodBean = clientMD.getAnnotatedEjbReferences().get("resourceMethodBean");
- assertNotNull(resourceMethodBean);
- assertEquals(ResourceIF.class, resourceMethodBean.getBeanInterface());
- assertEquals("ResourceOnMethodBean", resourceMethodBean.getLink());
- Set<ResourceInjectionTargetMetaData> resourceMethodBeanTargets = resourceMethodBean.getInjectionTargets();
- assertNotNull(resourceMethodBeanTargets);
- assertEquals(1, resourceMethodBeanTargets.size());
- ResourceInjectionTargetMetaData method = resourceMethodBeanTargets.iterator().next();
- assertEquals(Client.class.getName(), method.getInjectionTargetClass());
- assertEquals("setResourceMethodBean", method.getInjectionTargetName());
-
- AnnotatedEJBReferenceMetaData resourceFieldBean = clientMD.getAnnotatedEjbReferences().get("resourceFieldBean");
- assertNotNull(resourceFieldBean);
- assertEquals("ResourceOnFieldBean", resourceFieldBean.getLink());
- Set<ResourceInjectionTargetMetaData> resourceFieldBeanTargets = resourceFieldBean.getInjectionTargets();
- assertNotNull(resourceFieldBeanTargets);
- assertEquals(1, resourceFieldBeanTargets.size());
- ResourceInjectionTargetMetaData field = resourceFieldBeanTargets.iterator().next();
- assertEquals(Client.class.getName(), field.getInjectionTargetClass());
- assertEquals("resourceFieldBean", field.getInjectionTargetName());
-
- AnnotatedEJBReferenceMetaData resourceClassBean = clientMD.getAnnotatedEjbReferences().get("ejb/resourceClassBean");
- assertNotNull(resourceClassBean);
- assertEquals("ResourcesOnClassBean", resourceClassBean.getLink());
- assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getMappedName());
- assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getJndiName());
-
- // ORB maps to a resource-env-ref
- ResourceEnvironmentReferenceMetaData orbRes = clientMD.getResourceEnvironmentReferenceByName("orb");
- System.out.println(clientMD.getResourceEnvironmentReferences());
- assertNotNull(orbRes);
- Set<ResourceInjectionTargetMetaData> orbResTargets = orbRes.getInjectionTargets();
- assertNotNull(orbResTargets);
- assertEquals(1, orbResTargets.size());
- ResourceInjectionTargetMetaData orbField = orbResTargets.iterator().next();
- assertEquals(Client.class.getName(), orbField.getInjectionTargetClass());
- assertEquals("orb", orbField.getInjectionTargetName());
-
- // URL maps to resource-ref
- ResourceReferenceMetaData urlRes = clientMD.getResourceReferenceByName("jboss-home-page");
- assertNotNull(urlRes);
- assertEquals("http://www.jboss.org", urlRes.getMappedName());
- Set<ResourceInjectionTargetMetaData> urlResTargets = urlRes.getInjectionTargets();
- assertNotNull(urlResTargets);
- assertEquals(1, urlResTargets.size());
- ResourceInjectionTargetMetaData urlResField = urlResTargets.iterator().next();
- assertEquals(Client.class.getName(), urlResField.getInjectionTargetClass());
- assertEquals("jbossHome", urlResField.getInjectionTargetName());
-
- // UserTransaction
-
- // String maps to env-entry
- System.out.println(clientMD.getEnvironmentEntries());
- EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
- assertNotNull(queueNameEntry);
- assertEquals("queue/testQueue", queueNameEntry.getValue());
- Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
- assertNotNull(queueNameEntryTargets);
- assertEquals(1, queueNameEntryTargets.size());
- ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
- assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
- assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
- // Float
- // int
-
- LifecycleCallbacksMetaData postConstructs = clientMD.getPostConstructs();
- assertNotNull(postConstructs);
- assertEquals(1, postConstructs.size());
- LifecycleCallbackMetaData pc = postConstructs.get(0);
- assertEquals(Client.class.getName(), pc.getClassName());
- assertEquals("postConstruct", pc.getMethodName());
-
- LifecycleCallbacksMetaData preDestroys = clientMD.getPreDestroys();
- assertNotNull(preDestroys);
- assertEquals(1, preDestroys.size());
- LifecycleCallbackMetaData pd = preDestroys.get(0);
- assertEquals(Client.class.getName(), pd.getClassName());
- assertEquals("destroy", pd.getMethodName());
- }
- @ScanPackage("org.jboss.test.metadata.annotation.client.basic")
- public void testXmlMerge()
- throws Exception
- {
- AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
- Collection<Class<?>> classes = PackageScanner.loadClasses();
- System.out.println("Processing classes: "+classes);
- ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder);
- ApplicationClient5MetaData clientMD = creator.create(classes);
-
- ApplicationClient5MetaData xmlMD = super.unmarshal(ApplicationClient5MetaData.class);
- ApplicationClient5MetaData merged = new ApplicationClient5MetaData();
- AnnotationMergedView.merge(merged, xmlMD, clientMD);
-
- EnvironmentEntryMetaData msg = merged.getEnvironmentEntryByName("msg");
- assertNotNull(msg);
- assertEquals("java.lang.String", msg.getType());
- assertEquals("how are you?", msg.getValue());
-
- LifecycleCallbacksMetaData postConstructs = merged.getPostConstructs();
- assertNotNull(postConstructs);
- // 2 because of the null class name in the xml
- assertEquals(2, postConstructs.size());
- LifecycleCallbackMetaData pc0 = postConstructs.get(0);
- assertEquals("postConstruct", pc0.getMethodName());
-
- LifecycleCallbacksMetaData preDestroys = merged.getPreDestroys();
- assertNotNull(preDestroys);
- // 2 because of the null class name in the xml
- assertEquals(2, preDestroys.size());
- LifecycleCallbackMetaData pd0 = preDestroys.get(0);
- assertEquals("preDestroy", pd0.getMethodName());
-
- assertEquals("org.jboss.ejb3.test.applicationclient.client.TestCallbackHandler", merged.getCallbackHandler());
-
- // ORB maps to a resource-env-ref
- ResourceEnvironmentReferenceMetaData orbRes = merged.getResourceEnvironmentReferenceByName("orb");
- System.out.println(clientMD.getResourceEnvironmentReferences());
- assertNotNull(orbRes);
- assertEquals(ORB.class.getName(), orbRes.getType());
- ResourceEnvironmentReferenceMetaData messageReplier = merged.getResourceEnvironmentReferenceByName("messageReplier");
- assertNotNull(messageReplier);
- assertEquals("javax.jms.Queue", messageReplier.getType());
-
- // String maps to env-entry
- System.out.println(clientMD.getEnvironmentEntries());
- EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
- assertNotNull(queueNameEntry);
- assertEquals("queue/testQueueOverride", queueNameEntry.getValue());
- Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
- assertNotNull(queueNameEntryTargets);
- assertEquals(1, queueNameEntryTargets.size());
- ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
- assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
- assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
-
- MessageDestinationMetaData md = merged.getMessageDestinationByName("MY-QUEUE");
- assertNotNull(md);
- assertEquals("queue/testQueue", md.getJndiName());
- assertEquals("queue/testQueue", md.getMappedName());
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java (from rev 72968, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/AnnotationClientUnitTestCase.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,340 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.metadata.annotation.client;
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.Collection;
+import java.util.Set;
+
+import org.jboss.metadata.annotation.creator.client.ApplicationClient5MetaDataCreator;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
+import org.jboss.metadata.client.jboss.JBossClient5DTDMetaData;
+import org.jboss.metadata.client.jboss.JBossClientMetaData;
+import org.jboss.metadata.client.spec.AnnotationMergedView;
+import org.jboss.metadata.client.spec.ApplicationClient14DTDMetaData;
+import org.jboss.metadata.client.spec.ApplicationClient14MetaData;
+import org.jboss.metadata.client.spec.ApplicationClient5MetaData;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.LifecycleCallbackMetaData;
+import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.jboss.test.metadata.annotation.client.basic.Client;
+import org.jboss.test.metadata.annotation.client.basic.ResourceIF;
+import org.jboss.test.metadata.common.PackageScanner;
+import org.jboss.test.metadata.common.ScanPackage;
+import org.jboss.test.metadata.javaee.AbstractJavaEEMetaDataTest;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.omg.CORBA.ORB;
+
+/**
+ * Tests of JBossClientMetaData from annotations + xml merging
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class AnnotationClientUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+ public static SchemaBindingResolver initResolver()
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+
+ resolver.addClassBindingForLocation("application-client_1_3.dtd", ApplicationClient14DTDMetaData.class);
+ resolver.addClassBindingForLocation("application-client_1_4.xsd", ApplicationClient14MetaData.class);
+ resolver.addClassBindingForLocation("application-client_5.xsd", ApplicationClient5MetaData.class);
+ resolver.addClassBindingForLocation("jboss-client_5_0.dtd", JBossClient5DTDMetaData.class);
+ resolver.addClassBindingForLocation("jboss-client", JBossClient5DTDMetaData.class);
+ return resolver;
+ }
+
+ public AnnotationClientUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ @ScanPackage("org.jboss.test.metadata.annotation.client.basic")
+ public void testApplicationClientProcessor()
+ throws Exception
+ {
+ AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
+
+ Collection<Class<?>> classes = PackageScanner.loadClasses();
+ System.out.println("Processing classes: "+classes);
+ ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder);
+ ApplicationClient5MetaData clientMD = creator.create(classes);
+ System.out.println(clientMD.getAnnotatedEjbReferences());
+ assertEquals(3, clientMD.getAnnotatedEjbReferences().size());
+
+ AnnotatedEJBReferenceMetaData resourceMethodBean = clientMD.getAnnotatedEjbReferences().get("resourceMethodBean");
+ assertNotNull(resourceMethodBean);
+ assertEquals(ResourceIF.class, resourceMethodBean.getBeanInterface());
+ assertEquals("ResourceOnMethodBean", resourceMethodBean.getLink());
+ Set<ResourceInjectionTargetMetaData> resourceMethodBeanTargets = resourceMethodBean.getInjectionTargets();
+ assertNotNull(resourceMethodBeanTargets);
+ assertEquals(1, resourceMethodBeanTargets.size());
+ ResourceInjectionTargetMetaData method = resourceMethodBeanTargets.iterator().next();
+ assertEquals(Client.class.getName(), method.getInjectionTargetClass());
+ assertEquals("setResourceMethodBean", method.getInjectionTargetName());
+
+ AnnotatedEJBReferenceMetaData resourceFieldBean = clientMD.getAnnotatedEjbReferences().get("resourceFieldBean");
+ assertNotNull(resourceFieldBean);
+ assertEquals("ResourceOnFieldBean", resourceFieldBean.getLink());
+ Set<ResourceInjectionTargetMetaData> resourceFieldBeanTargets = resourceFieldBean.getInjectionTargets();
+ assertNotNull(resourceFieldBeanTargets);
+ assertEquals(1, resourceFieldBeanTargets.size());
+ ResourceInjectionTargetMetaData field = resourceFieldBeanTargets.iterator().next();
+ assertEquals(Client.class.getName(), field.getInjectionTargetClass());
+ assertEquals("resourceFieldBean", field.getInjectionTargetName());
+
+ AnnotatedEJBReferenceMetaData resourceClassBean = clientMD.getAnnotatedEjbReferences().get("ejb/resourceClassBean");
+ assertNotNull(resourceClassBean);
+ assertEquals("ResourcesOnClassBean", resourceClassBean.getLink());
+ assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getMappedName());
+ assertEquals("refs/resources/ResourcesOnClassBean", resourceClassBean.getJndiName());
+
+ // jms Queue maps to message-destination-refs
+ MessageDestinationReferencesMetaData msgRefs = clientMD.getMessageDestinationReferences();
+ System.out.println(clientMD.getResourceEnvironmentReferences());
+ assertNotNull(msgRefs);
+ MessageDestinationReferenceMetaData sendQueue = clientMD.getMessageDestinationReferenceByName("sendQueue");
+ assertNotNull(sendQueue);
+ Set<ResourceInjectionTargetMetaData> sendQueueTargets = sendQueue.getInjectionTargets();
+ assertNotNull(sendQueueTargets);
+ assertEquals(1, sendQueueTargets.size());
+ ResourceInjectionTargetMetaData sendQueueField = sendQueueTargets.iterator().next();
+ assertEquals(Client.class.getName(), sendQueueField.getInjectionTargetClass());
+ assertEquals("sendQueue", sendQueueField.getInjectionTargetName());
+
+ // ORB maps to a resource-env-ref
+ ResourceEnvironmentReferenceMetaData orbRes = clientMD.getResourceEnvironmentReferenceByName("orb");
+ System.out.println(clientMD.getResourceEnvironmentReferences());
+ assertNotNull(orbRes);
+ Set<ResourceInjectionTargetMetaData> orbResTargets = orbRes.getInjectionTargets();
+ assertNotNull(orbResTargets);
+ assertEquals(1, orbResTargets.size());
+ ResourceInjectionTargetMetaData orbField = orbResTargets.iterator().next();
+ assertEquals(Client.class.getName(), orbField.getInjectionTargetClass());
+ assertEquals("orb", orbField.getInjectionTargetName());
+
+ // URL maps to resource-ref
+ ResourceReferenceMetaData urlRes = clientMD.getResourceReferenceByName("jboss-home-page");
+ assertNotNull(urlRes);
+ assertEquals("http://www.jboss.org", urlRes.getMappedName());
+ Set<ResourceInjectionTargetMetaData> urlResTargets = urlRes.getInjectionTargets();
+ assertNotNull(urlResTargets);
+ assertEquals(1, urlResTargets.size());
+ ResourceInjectionTargetMetaData urlResField = urlResTargets.iterator().next();
+ assertEquals(Client.class.getName(), urlResField.getInjectionTargetClass());
+ assertEquals("jbossHome", urlResField.getInjectionTargetName());
+
+ // UserTransaction
+
+ // String maps to env-entry
+ System.out.println(clientMD.getEnvironmentEntries());
+ EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
+ assertNotNull(queueNameEntry);
+ assertEquals("queue/testQueue", queueNameEntry.getValue());
+ Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
+ assertNotNull(queueNameEntryTargets);
+ assertEquals(1, queueNameEntryTargets.size());
+ ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
+ assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
+ assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
+ // Float
+ // int
+
+ LifecycleCallbacksMetaData postConstructs = clientMD.getPostConstructs();
+ assertNotNull(postConstructs);
+ assertEquals(1, postConstructs.size());
+ LifecycleCallbackMetaData pc = postConstructs.get(0);
+ assertEquals(Client.class.getName(), pc.getClassName());
+ assertEquals("postConstruct", pc.getMethodName());
+
+ LifecycleCallbacksMetaData preDestroys = clientMD.getPreDestroys();
+ assertNotNull(preDestroys);
+ assertEquals(1, preDestroys.size());
+ LifecycleCallbackMetaData pd = preDestroys.get(0);
+ assertEquals(Client.class.getName(), pd.getClassName());
+ assertEquals("destroy", pd.getMethodName());
+ }
+ @ScanPackage("org.jboss.test.metadata.annotation.client.basic")
+ public void testXmlMerge()
+ throws Exception
+ {
+ AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
+ Collection<Class<?>> classes = PackageScanner.loadClasses();
+ System.out.println("Processing classes: "+classes);
+ ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder);
+ ApplicationClient5MetaData clientMD = creator.create(classes);
+
+ ApplicationClient5MetaData xmlMD = super.unmarshal(ApplicationClient5MetaData.class);
+ ApplicationClient5MetaData merged = new ApplicationClient5MetaData();
+ AnnotationMergedView.merge(merged, xmlMD, clientMD);
+
+ EnvironmentEntryMetaData msg = merged.getEnvironmentEntryByName("msg");
+ assertNotNull(msg);
+ assertEquals("java.lang.String", msg.getType());
+ assertEquals("how are you?", msg.getValue());
+
+ LifecycleCallbacksMetaData postConstructs = merged.getPostConstructs();
+ assertNotNull(postConstructs);
+ // 2 because of the null class name in the xml
+ assertEquals(2, postConstructs.size());
+ LifecycleCallbackMetaData pc0 = postConstructs.get(0);
+ assertEquals("postConstruct", pc0.getMethodName());
+
+ LifecycleCallbacksMetaData preDestroys = merged.getPreDestroys();
+ assertNotNull(preDestroys);
+ // 2 because of the null class name in the xml
+ assertEquals(2, preDestroys.size());
+ LifecycleCallbackMetaData pd0 = preDestroys.get(0);
+ assertEquals("preDestroy", pd0.getMethodName());
+
+ assertEquals("org.jboss.ejb3.test.applicationclient.client.TestCallbackHandler", merged.getCallbackHandler());
+
+ // ORB maps to a resource-env-ref
+ ResourceEnvironmentReferenceMetaData orbRes = merged.getResourceEnvironmentReferenceByName("orb");
+ System.out.println(clientMD.getResourceEnvironmentReferences());
+ assertNotNull(orbRes);
+ assertEquals(ORB.class.getName(), orbRes.getType());
+ ResourceEnvironmentReferenceMetaData messageReplier = merged.getResourceEnvironmentReferenceByName("messageReplier");
+ assertNotNull(messageReplier);
+ assertEquals("javax.jms.Queue", messageReplier.getType());
+
+ // String maps to env-entry
+ System.out.println(clientMD.getEnvironmentEntries());
+ EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
+ assertNotNull(queueNameEntry);
+ assertEquals("queue/testQueueOverride", queueNameEntry.getValue());
+ Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
+ assertNotNull(queueNameEntryTargets);
+ assertEquals(1, queueNameEntryTargets.size());
+ ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
+ assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
+ assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
+
+ MessageDestinationMetaData md = merged.getMessageDestinationByName("MY-QUEUE");
+ assertNotNull(md);
+ assertEquals("queue/testQueue", md.getJndiName());
+ assertEquals("queue/testQueue", md.getMappedName());
+ }
+
+ @ScanPackage("org.jboss.test.metadata.annotation.client.basic")
+ public void testJBossXmlMerge()
+ throws Exception
+ {
+ AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
+ Collection<Class<?>> classes = PackageScanner.loadClasses();
+ System.out.println("Processing classes: "+classes);
+ ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder);
+ ApplicationClient5MetaData clientMD = creator.create(classes);
+
+ ApplicationClient5MetaData xmlMD = super.unmarshal("AnnotationClient_testXmlMerge.xml", ApplicationClient5MetaData.class);
+ ApplicationClient5MetaData merged = new ApplicationClient5MetaData();
+ AnnotationMergedView.merge(merged, xmlMD, clientMD);
+
+ JBossClientMetaData jbossXmlMD = super.unmarshal(JBossClientMetaData.class);
+ // Create a merged view
+ JBossClientMetaData mergedMetaData = new JBossClientMetaData();
+ mergedMetaData.merge(jbossXmlMD, merged, false);
+
+ EnvironmentEntryMetaData msg = mergedMetaData.getEnvironmentEntryByName("msg");
+ assertNotNull(msg);
+ assertEquals("java.lang.String", msg.getType());
+ assertEquals("how are you?", msg.getValue());
+
+ LifecycleCallbacksMetaData postConstructs = mergedMetaData.getPostConstructs();
+ assertNotNull(postConstructs);
+ // 2 because of the null class name in the xml
+ assertEquals(2, postConstructs.size());
+ LifecycleCallbackMetaData pc0 = postConstructs.get(0);
+ assertEquals("postConstruct", pc0.getMethodName());
+
+ LifecycleCallbacksMetaData preDestroys = mergedMetaData.getPreDestroys();
+ assertNotNull(preDestroys);
+ // 2 because of the null class name in the xml
+ assertEquals(2, preDestroys.size());
+ LifecycleCallbackMetaData pd0 = preDestroys.get(0);
+ assertEquals("preDestroy", pd0.getMethodName());
+
+ assertEquals("org.jboss.ejb3.test.applicationclient.client.TestCallbackHandler", mergedMetaData.getCallbackHandler());
+
+ // jms Queue maps to message-destination-refs
+ MessageDestinationReferencesMetaData msgRefs = mergedMetaData.getMessageDestinationReferences();
+ System.out.println(clientMD.getResourceEnvironmentReferences());
+ assertNotNull(msgRefs);
+ MessageDestinationReferenceMetaData sendQueue = mergedMetaData.getMessageDestinationReferenceByName("sendQueue");
+ assertNotNull(sendQueue);
+ assertEquals("MDB_QUEUE", sendQueue.getJndiName());
+ assertEquals("MDB_QUEUE", sendQueue.getMappedName());
+ Set<ResourceInjectionTargetMetaData> sendQueueTargets = sendQueue.getInjectionTargets();
+ assertEquals(1, sendQueueTargets.size());
+ ResourceInjectionTargetMetaData sendQueueField = sendQueueTargets.iterator().next();
+ assertEquals(Client.class.getName(), sendQueueField.getInjectionTargetClass());
+ assertEquals("sendQueue", sendQueueField.getInjectionTargetName());
+
+ // jms queue connection factory maps to resource-ref
+ ResourceReferenceMetaData qcfRef = mergedMetaData.getResourceReferenceByName("queueConnectionFactory");
+ assertNotNull(qcfRef);
+ assertEquals("jms/QueueConnectionFactory", qcfRef.getJndiName());
+ assertEquals("jms/QueueConnectionFactory", qcfRef.getMappedName());
+ Set<ResourceInjectionTargetMetaData> qcfRefTargets = qcfRef.getInjectionTargets();
+ assertEquals(1, qcfRefTargets.size());
+ ResourceInjectionTargetMetaData qcfRefField = qcfRefTargets.iterator().next();
+ assertEquals(Client.class.getName(), qcfRefField.getInjectionTargetClass());
+ assertEquals("queueConnectionFactory", qcfRefField.getInjectionTargetName());
+
+ // ORB maps to a resource-env-ref
+ ResourceEnvironmentReferenceMetaData orbRes = mergedMetaData.getResourceEnvironmentReferenceByName("orb");
+ System.out.println(clientMD.getResourceEnvironmentReferences());
+ assertNotNull(orbRes);
+ assertEquals(ORB.class.getName(), orbRes.getType());
+ ResourceEnvironmentReferenceMetaData messageReplier = mergedMetaData.getResourceEnvironmentReferenceByName("messageReplier");
+ assertNotNull(messageReplier);
+ assertEquals("javax.jms.Queue", messageReplier.getType());
+
+ // String maps to env-entry
+ System.out.println(clientMD.getEnvironmentEntries());
+ EnvironmentEntryMetaData queueNameEntry = clientMD.getEnvironmentEntryByName("queueName");
+ assertNotNull(queueNameEntry);
+ assertEquals("queue/testQueueOverride", queueNameEntry.getValue());
+ Set<ResourceInjectionTargetMetaData> queueNameEntryTargets = queueNameEntry.getInjectionTargets();
+ assertNotNull(queueNameEntryTargets);
+ assertEquals(1, queueNameEntryTargets.size());
+ ResourceInjectionTargetMetaData queueNameEntryField = queueNameEntryTargets.iterator().next();
+ assertEquals(Client.class.getName(), queueNameEntryField.getInjectionTargetClass());
+ assertEquals("queueName", queueNameEntryField.getInjectionTargetName());
+
+ MessageDestinationMetaData md = mergedMetaData.getMessageDestinationByName("MY-QUEUE");
+ assertNotNull(md);
+ assertEquals("queue/testQueue", md.getJndiName());
+ assertEquals("queue/testQueue", md.getMappedName());
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.metadata.annotation.client.basic;
-
-import java.net.URL;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.transaction.UserTransaction;
-
-import org.omg.CORBA.ORB;
-
-/**
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class Client
-{
- private static ResourceIF resourceMethodBean;
-
- @EJB(beanName = "ResourceOnFieldBean")
- private static ResourceIF resourceFieldBean;
-
- @EJB(name="ejb/resourceClassBean", beanName = "ResourcesOnClassBean", mappedName="refs/resources/ResourcesOnClassBean")
- private static ResourceIF resourceClassBean;
-
- @EJB(beanName = "ResourceOnMethodBean")
- private static void setResourceMethodBean(ResourceIF rif)
- {
- resourceMethodBean = rif;
- }
-
- @Resource(name="queueName", mappedName="queue/testQueue")
- private static String queueName;
- @Resource(mappedName="3.14159", description="pi to 5", name="PI")
- private static Float pi;
-
- @Resource
- private static ORB orb;
- @Resource(name="jboss-home-page", mappedName="http://www.jboss.org")
- private static URL jbossHome;
- private static UserTransaction utx;
-
- @Resource(name="user-tx")
- private static void setUserTransaction(UserTransaction utx)
- {
- Client.utx = utx;
- }
-
- @PostConstruct
- public static void postConstruct()
- {
- }
- @PreDestroy
- public static void destroy()
- {
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java (from rev 72968, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/annotation/client/basic/Client.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.metadata.annotation.client.basic;
+
+import java.net.URL;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.jms.Queue;
+import javax.jms.QueueConnectionFactory;
+import javax.transaction.UserTransaction;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class Client
+{
+ private static ResourceIF resourceMethodBean;
+
+ @EJB(beanName = "ResourceOnFieldBean")
+ private static ResourceIF resourceFieldBean;
+
+ @EJB(name="ejb/resourceClassBean", beanName = "ResourcesOnClassBean", mappedName="refs/resources/ResourcesOnClassBean")
+ private static ResourceIF resourceClassBean;
+
+ @EJB(beanName = "ResourceOnMethodBean")
+ private static void setResourceMethodBean(ResourceIF rif)
+ {
+ resourceMethodBean = rif;
+ }
+
+ @Resource(name="sendQueue")
+ private static Queue sendQueue;
+
+ @Resource(name="receiveQueue")
+ private static Queue receiveQueue;
+
+ @Resource(name="queueConnectionFactory")
+ private static QueueConnectionFactory queueConnectionFactory;
+
+ @Resource(name="queueName", mappedName="queue/testQueue")
+ private static String queueName;
+ @Resource(mappedName="3.14159", description="pi to 5", name="PI")
+ private static Float pi;
+
+ @Resource
+ private static ORB orb;
+ @Resource(name="jboss-home-page", mappedName="http://www.jboss.org")
+ private static URL jbossHome;
+ private static UserTransaction utx;
+
+ @Resource(name="user-tx")
+ private static void setUserTransaction(UserTransaction utx)
+ {
+ Client.utx = utx;
+ }
+
+ @PostConstruct
+ public static void postConstruct()
+ {
+ }
+ @PreDestroy
+ public static void destroy()
+ {
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.metadata.client;
-
-import org.jboss.metadata.client.jboss.JBossClient5MetaData;
-import org.jboss.metadata.client.jboss.JBossClientMetaData;
-import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest;
-import org.jboss.test.metadata.javaee.JBossXBTestDelegate;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-
-/**
- * Test all entries of an JBoss client 5 descriptor.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision$
- */
-public class JBossClient5EverythingUnitTestCase extends AbstractJavaEEEverythingTest
-{
-
- public JBossClient5EverythingUnitTestCase(String name)
- {
- super(name);
- }
-
- protected void assertEverything(JBossClientMetaData jbossClientMetaData)
- {
- assertEquals("appClientJndiName", jbossClientMetaData.getJndiName());
- assertEquals("http://localhost", jbossClientMetaData.getJndiEnvironmentRefsGroup().getResourceReferences().get("appClientResourceRef2Name").getResUrl());
- assertEquals(2, jbossClientMetaData.getDepends().size());
- int count = 1;
- for(String depends : jbossClientMetaData.getDepends())
- {
- assertEquals("appClientDepends" + count, depends);
- count++;
- }
- }
-
- public static SchemaBindingResolver initResolver()
- {
- //return schemaResolverForClass(JBossClient5MetaData.class);
- DefaultSchemaResolver resolver = new DefaultSchemaResolver();
- resolver.addClassBindingForLocation("jboss-client_5_0.xsd", JBossClient5MetaData.class);
- // Workaround wildard resolution slowness
- resolver.addClassBinding("http://www.jboss.com/xml/ns/javaee", JBossClient5MetaData.class);
- return resolver;
- }
-
- public void testEverything() throws Exception
- {
- JBossXBTestDelegate xbdelegate = (JBossXBTestDelegate) super.getDelegate();
- xbdelegate.setValidateSchema(true);
- JBossClient5MetaData jbossClientMetaData = unmarshal();
- assertEverything(jbossClientMetaData);
- }
-
- /**
- * When there is no jndiEnvironmentRefsGroup we don't want
- * any NPE to pop up.
- * @throws Exception
- */
- public void testNoJndiEnvironmentRefsGroup() throws Exception
- {
- JBossClientMetaData metaData = new JBossClient5MetaData();
- assertNull(metaData.getJndiEnvironmentRefsGroup());
- assertNull(metaData.getEjbReferences());
- assertNull(metaData.getEjbReferenceByName("unknown"));
- assertNull(metaData.getAnnotatedEjbReferences());
- assertNull(metaData.getEnvironmentEntries());
- assertNull(metaData.getEnvironmentEntryByName("unknown"));
- assertNull(metaData.getMessageDestinationReferences());
- assertNull(metaData.getMessageDestinationReferenceByName("unknown"));
- assertNull(metaData.getPersistenceUnitRefs());
- assertNull(metaData.getPersistenceUnitReferenceByName("unknown"));
- assertNull(metaData.getPostConstructs());
- assertNull(metaData.getPreDestroys());
- assertNull(metaData.getServiceReferences());
- assertNull(metaData.getServiceReferenceByName("unknown"));
- assertNull(metaData.getResourceEnvironmentReferences());
- assertNull(metaData.getResourceEnvironmentReferenceByName("unknown"));
- assertNull(metaData.getResourceReferences());
- assertNull(metaData.getResourceReferenceByName("unknown"));
- }
-
- protected JBossClient5MetaData unmarshal() throws Exception
- {
- return unmarshal(JBossClient5MetaData.class);
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java (from rev 72956, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/java/org/jboss/test/metadata/client/JBossClient5EverythingUnitTestCase.java 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.metadata.client;
+
+import org.jboss.metadata.client.jboss.JBossClient5MetaData;
+import org.jboss.metadata.client.jboss.JBossClientMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest;
+import org.jboss.test.metadata.javaee.JBossXBTestDelegate;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * Test all entries of an JBoss client 5 descriptor.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision$
+ */
+public class JBossClient5EverythingUnitTestCase extends AbstractJavaEEEverythingTest
+{
+
+ public JBossClient5EverythingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected void assertEverything(JBossClientMetaData jbossClientMetaData)
+ {
+ assertEquals("appClientJndiName", jbossClientMetaData.getJndiName());
+ assertEquals("http://localhost", jbossClientMetaData.getJndiEnvironmentRefsGroup().getResourceReferences().get("appClientResourceRef2Name").getResUrl());
+ MessageDestinationReferenceMetaData mref = jbossClientMetaData.getMessageDestinationReferenceByName("appClientMessageDestinationRef1Name");
+ assertNotNull(mref);
+ assertEquals("MDB_QUEUE", mref.getJndiName());
+ assertEquals("MDB_QUEUE", mref.getMappedName());
+
+ assertEquals(2, jbossClientMetaData.getDepends().size());
+ int count = 1;
+ for(String depends : jbossClientMetaData.getDepends())
+ {
+ assertEquals("appClientDepends" + count, depends);
+ count++;
+ }
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ //return schemaResolverForClass(JBossClient5MetaData.class);
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("jboss-client_5_0.xsd", JBossClient5MetaData.class);
+ // Workaround wildard resolution slowness
+ resolver.addClassBinding("http://www.jboss.com/xml/ns/javaee", JBossClient5MetaData.class);
+ return resolver;
+ }
+
+ public void testEverything() throws Exception
+ {
+ JBossXBTestDelegate xbdelegate = (JBossXBTestDelegate) super.getDelegate();
+ xbdelegate.setValidateSchema(true);
+ JBossClient5MetaData jbossClientMetaData = unmarshal();
+ assertEverything(jbossClientMetaData);
+ }
+
+ /**
+ * When there is no jndiEnvironmentRefsGroup we don't want
+ * any NPE to pop up.
+ * @throws Exception
+ */
+ public void testNoJndiEnvironmentRefsGroup() throws Exception
+ {
+ JBossClientMetaData metaData = new JBossClient5MetaData();
+ assertNull(metaData.getJndiEnvironmentRefsGroup());
+ assertNull(metaData.getEjbReferences());
+ assertNull(metaData.getEjbReferenceByName("unknown"));
+ assertNull(metaData.getAnnotatedEjbReferences());
+ assertNull(metaData.getEnvironmentEntries());
+ assertNull(metaData.getEnvironmentEntryByName("unknown"));
+ assertNull(metaData.getMessageDestinationReferences());
+ assertNull(metaData.getMessageDestinationReferenceByName("unknown"));
+ assertNull(metaData.getPersistenceUnitRefs());
+ assertNull(metaData.getPersistenceUnitReferenceByName("unknown"));
+ assertNull(metaData.getPostConstructs());
+ assertNull(metaData.getPreDestroys());
+ assertNull(metaData.getServiceReferences());
+ assertNull(metaData.getServiceReferenceByName("unknown"));
+ assertNull(metaData.getResourceEnvironmentReferences());
+ assertNull(metaData.getResourceEnvironmentReferenceByName("unknown"));
+ assertNull(metaData.getResourceReferences());
+ assertNull(metaData.getResourceReferenceByName("unknown"));
+ }
+
+ protected JBossClient5MetaData unmarshal() throws Exception
+ {
+ return unmarshal(JBossClient5MetaData.class);
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml
===================================================================
--- projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml 2008-05-01 16:44:24 UTC (rev 72947)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml 2008-05-02 06:09:56 UTC (rev 72973)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jboss-client PUBLIC
- "-//JBoss//DTD Application Client 5.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
-<jboss-client>
- <jndi-name>ee5client_test</jndi-name>
-
- <resource-env-ref>
- <resource-env-ref-name>messageReplier</resource-env-ref-name>
- <jndi-name>queue/messageReplier</jndi-name>
- </resource-env-ref>
-</jboss-client>
Copied: projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml (from rev 72971, projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml)
===================================================================
--- projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml (rev 0)
+++ projects/metadata/tags/1.0.0.Beta11/src/test/resources/org/jboss/test/metadata/annotation/client/AnnotationClient_testJBossXmlMerge.xml 2008-05-02 06:09:56 UTC (rev 72973)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
+<jboss-client>
+ <jndi-name>ee5client_test</jndi-name>
+
+ <resource-ref>
+ <res-ref-name>queueConnectionFactory</res-ref-name>
+ <jndi-name>jms/QueueConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-env-ref>
+ <resource-env-ref-name>messageReplier</resource-env-ref-name>
+ <jndi-name>queue/messageReplier</jndi-name>
+ </resource-env-ref>
+
+ <message-destination-ref>
+ <message-destination-ref-name>sendQueue</message-destination-ref-name>
+ <jndi-name>MDB_QUEUE</jndi-name>
+ </message-destination-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>receiveQueue</message-destination-ref-name>
+ <jndi-name>MDB_QUEUE_REPLY</jndi-name>
+ </message-destination-ref>
+
+</jboss-client>
More information about the jboss-cvs-commits
mailing list