[jboss-cvs] JBossAS SVN: r108146 - in projects/jboss-jca/trunk: common/src/main/java/org/jboss/jca/common/metadata/common and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 15 08:43:36 EDT 2010
Author: maeste
Date: 2010-09-15 08:43:35 -0400 (Wed, 15 Sep 2010)
New Revision: 108146
Added:
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-empty.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-xa-empty.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-defaults.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-missed.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute2-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/pool-xa-pool-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/right-element-for-xa-pool-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute2-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-element-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/wrong-element-for-simple-pool-ironjacamar.xml
projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/ra-unexpected-attribute.xml
Modified:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonAdminObject.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonConnDef.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParser.java
projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd
projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java
projects/jboss-jca/trunk/deployers/src/test/resources/ra16standard303jbossra.rar/META-INF/ironjacamar.xml
Log:
JBJCA-420: minimal test suite
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonAdminObject.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonAdminObject.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonAdminObject.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -159,6 +159,10 @@
public enum Attribute
{
+ /** always first
+ *
+ */
+ UNKNOWN(null),
/** jndiName attribute
*
*/
@@ -206,5 +210,31 @@
return name;
}
+ private static final Map<String, Attribute> MAP;
+
+ static
+ {
+ final Map<String, Attribute> map = new HashMap<String, Attribute>();
+ for (Attribute element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Attribute forName(String localName)
+ {
+ final Attribute element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
}
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonConnDef.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonConnDef.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonConnDef.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -215,9 +215,13 @@
public enum Attribute
{
+ /** always first
+ *
+ */
+ UNKNOWN(null),
/** jndiName attribute
- *
- */
+ *
+ */
JNDINAME("jndi-name"),
/** class-name attribute
@@ -262,5 +266,32 @@
return name;
}
+ private static final Map<String, Attribute> MAP;
+
+ static
+ {
+ final Map<String, Attribute> map = new HashMap<String, Attribute>();
+ for (Attribute element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Attribute forName(String localName)
+ {
+ final Attribute element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
}
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -22,7 +22,6 @@
package org.jboss.jca.common.metadata.common;
import org.jboss.jca.common.api.metadata.common.CommonAdminObject;
-import org.jboss.jca.common.api.metadata.common.CommonAdminObject.Attribute;
import org.jboss.jca.common.api.metadata.common.CommonConnDef;
import org.jboss.jca.common.api.metadata.common.CommonPool;
import org.jboss.jca.common.api.metadata.common.CommonSecurity;
@@ -59,8 +58,8 @@
* @throws XMLStreamException XMLStreamException
* @throws ParserException ParserException
*/
- protected CommonConnDef parseConnectionDefinitions(XMLStreamReader reader)
- throws XMLStreamException, ParserException
+ protected CommonConnDef parseConnectionDefinitions(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
{
HashMap<String, String> configProperties = new HashMap<String, String>();
CommonSecurity security = null;
@@ -74,9 +73,13 @@
boolean enabled = true;
String jndiName = null;
String poolName = null;
+ int attributeSize = reader.getAttributeCount();
- for (CommonConnDef.Attribute attribute : CommonConnDef.Attribute.values())
+ boolean isXa = false;
+
+ for (int i = 0; i < attributeSize; i++)
{
+ CommonConnDef.Attribute attribute = CommonConnDef.Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute)
{
case ENABLED : {
@@ -104,6 +107,8 @@
reader.getLocalName());
}
}
+ if (jndiName == null || jndiName.trim().equals(""))
+ throw new ParserException("Missing jndiName mandatory attribute");
while (reader.hasNext())
{
@@ -113,9 +118,8 @@
if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.CONNECTION_DEFINITION)
{
- return new CommonConnDefImpl(configProperties, className, jndiName, poolName,
- enabled, useJavaContext, pool, timeOut, validation,
- security);
+ return new CommonConnDefImpl(configProperties, className, jndiName, poolName, enabled,
+ useJavaContext, pool, timeOut, validation, security);
}
else
{
@@ -138,7 +142,7 @@
break;
}
case TIMEOUT : {
- timeOut = parseTimeOut(reader);
+ timeOut = parseTimeOut(reader, isXa);
break;
}
case VALIDATION : {
@@ -150,6 +154,7 @@
throw new ParserException("You cannot define more than one pool or xa-poll in same"
+ " connection-definition");
pool = parseXaPool(reader);
+ isXa = true;
break;
}
case POOL : {
@@ -219,7 +224,8 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private CommonTimeOut parseTimeOut(XMLStreamReader reader) throws XMLStreamException, ParserException
+ private CommonTimeOut parseTimeOut(XMLStreamReader reader, boolean isXa) throws XMLStreamException,
+ ParserException
{
Long blockingTimeoutMillis = null;
Long allocationRetryWaitMillis = null;
@@ -267,6 +273,9 @@
break;
}
case XARESOURCETIMEOUT : {
+ if (!isXa)
+ throw new ParserException("Element:" + reader.getLocalName() +
+ "cannot be set without an xa-pool");
xaResourceTimeout = elementAsLong(reader);
break;
}
@@ -301,8 +310,12 @@
String jndiName = null;
String poolName = null;
- for (Attribute attribute : CommonAdminObject.Attribute.values())
+ int attributeSize = reader.getAttributeCount();
+
+ for (int i = 0; i < attributeSize; i++)
{
+ CommonAdminObject.Attribute attribute = CommonAdminObject.Attribute.forName(reader
+ .getAttributeLocalName(i));
switch (attribute)
{
case ENABLED : {
@@ -330,6 +343,8 @@
reader.getLocalName());
}
}
+ if (jndiName == null || jndiName.trim().equals(""))
+ throw new ParserException("Missing jndiName mandatory attribute");
while (reader.hasNext())
{
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParser.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParser.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -117,6 +117,7 @@
String bootstrapContext = null;
TransactionSupportEnum transactionSupport = null;
HashMap<String, String> configProperties = null;
+
while (reader.hasNext())
{
switch (reader.nextTag())
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd 2010-09-15 12:43:35 UTC (rev 108146)
@@ -326,7 +326,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="vaidation" type="validationType" minOccurs="0" maxOccurs="1">
+ <xs:element name="validation" type="validationType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
<![CDATA[[
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd 2010-09-15 12:43:35 UTC (rev 108146)
@@ -360,7 +360,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="vaidation" type="validationType" minOccurs="0" maxOccurs="1">
+ <xs:element name="validation" type="validationType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
<![CDATA[[
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -23,8 +23,12 @@
import org.jboss.jca.common.api.metadata.common.CommonAdminObject;
import org.jboss.jca.common.api.metadata.common.CommonConnDef;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+import org.jboss.jca.common.api.metadata.common.CommonTimeOut;
+import org.jboss.jca.common.api.metadata.common.CommonValidation;
import org.jboss.jca.common.api.metadata.common.TransactionSupportEnum;
import org.jboss.jca.common.api.metadata.ironjacamar.IronJacamar;
+import org.jboss.jca.common.metadata.ParserException;
import java.io.File;
import java.io.FileInputStream;
@@ -36,9 +40,9 @@
import org.hamcrest.core.IsNull;
import org.junit.Test;
+import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
-
/**
*
* A IronJacamarParserTestCase.
@@ -116,4 +120,457 @@
}
}
+ /**
+ *
+ * shouldThrowExceptionWithUnexpectedAttributeOnConDef
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithUnexpectedAttributeOnConDef() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("unexpected-attribute-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldThrowExceptionWithUnexpectedAttributeOnAdminObj
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithUnexpectedAttributeOnAdminObj() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("unexpected-attribute2-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldThrowExceptionWithMissingMandatoryAttributeOnConnDef
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithMissingMandatoryAttributeOnConnDef() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("missing-attribute-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldThrowExceptionWithMissingMandatoryAttributeOnAdminObj
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithMissingMandatoryAttributeOnAdminObj() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("missing-attribute-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldParseEmptyFileAndHaveNullMDContents
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithUnexpectedElement() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("unexpected-element-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldThrowExceptionWithBothPoolAndXaPool
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionWithBothPoolAndXaPool() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("pool-xa-pool-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ //throw Exception
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /**
+ *
+ * shouldParseFileAndHaveDefaultSecurityValues
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseFileAndHaveDefaultSecurityValues() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("ironjacamar-security-defaults.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ CommonSecurity sec = ij.getConnectionDefinitions().get(0).getSecurity();
+ assertThat(sec.getPassword(), new IsNull<String>());
+ assertThat(sec.getUserName(), new IsNull<String>());
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /** shouldParseFileMissingSecurityTagAndHaveNullSecurityValues
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseFileMissingSecurityTagAndHaveNullSecurityValues() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory.listFiles(new FilenamePrefixFilter("ironjacamar-security-missed.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ CommonSecurity sec = ij.getConnectionDefinitions().get(0).getSecurity();
+ assertThat(sec, new IsNull<CommonSecurity>());
+ // Or should it be?
+ // assertThat(sec.getPassword(), new IsNull<String>());
+ // assertThat(sec.getUserName(), new IsNull<String>());
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /** shouldParseFileWithEmptyCOnnectionDeginitionAndHaveAllDefaults
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseFileWithEmptyCOnnectionDeginitionAndHaveAllDefaults() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory
+ .listFiles(new FilenamePrefixFilter("ironjacamar-connection-definition-empty.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ CommonConnDef connDef = ij.getConnectionDefinitions().get(0);
+ //attribute defaults
+ assertThat(connDef.getPoolName(), new IsNull<String>());
+ assertThat(connDef.getClassName(), new IsNull<String>());
+ assertThat(connDef.getClassName(), new IsNull<String>());
+ assertThat(connDef.isEnabled(), is(true));
+ assertThat(connDef.isUseJavaContext(), is(false));
+
+ //pool default
+ assertThat(connDef.isXa(), is(false));
+ assertThat(connDef.getPool().getMinPoolSize(), new IsNull<Integer>());
+ assertThat(connDef.getPool().getMaxPoolSize(), new IsNull<Integer>());
+ assertThat(connDef.getPool().isPrefill(), is(false));
+ assertThat(connDef.getPool().isUseStrictMin(), is(false));
+
+ //security defaults
+ CommonSecurity sec = connDef.getSecurity();
+ assertThat(sec.getPassword(), new IsNull<String>());
+ assertThat(sec.getUserName(), new IsNull<String>());
+
+ //timeout defaults
+ CommonTimeOut t = connDef.getTimeOut();
+ assertThat(t.getAllocationRetry(), new IsNull<Long>());
+ assertThat(t.getAllocationRetryWaitMillis(), new IsNull<Long>());
+ assertThat(t.getBlockingTimeoutMillis(), new IsNull<Long>());
+ assertThat(t.getIdleTimeoutMinutes(), new IsNull<Long>());
+ assertThat(t.getXaResourceTimeout(), new IsNull<Long>());
+
+ //validation default
+ CommonValidation v = connDef.getValidation();
+ assertThat(v.getBackgroundValidationMinutes(), new IsNull<Long>());
+ assertThat(v.isBackgroundValidation(), is(false));
+ assertThat(v.isUseFastFail(), is(false));
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /** shouldParseFileWithEmptyXaCOnnectionDeginitionAndHaveAllDefaults
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseFileWithEmptyXaCOnnectionDeginitionAndHaveAllDefaults() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory
+ .listFiles(new FilenamePrefixFilter("ironjacamar-connection-definition-xa-empty.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ CommonConnDef connDef = ij.getConnectionDefinitions().get(0);
+ //attribute defaults
+ assertThat(connDef.getPoolName(), new IsNull<String>());
+ assertThat(connDef.getClassName(), new IsNull<String>());
+ assertThat(connDef.getClassName(), new IsNull<String>());
+ assertThat(connDef.isEnabled(), is(true));
+ assertThat(connDef.isUseJavaContext(), is(false));
+
+ //pool default
+ assertThat(connDef.isXa(), is(true));
+ assertThat(connDef.getPool().getMinPoolSize(), new IsNull<Integer>());
+ assertThat(connDef.getPool().getMaxPoolSize(), new IsNull<Integer>());
+ assertThat(connDef.getPool().isPrefill(), is(false));
+ assertThat(connDef.getPool().isUseStrictMin(), is(false));
+
+ //security defaults
+ CommonSecurity sec = connDef.getSecurity();
+ assertThat(sec.getPassword(), new IsNull<String>());
+ assertThat(sec.getUserName(), new IsNull<String>());
+
+ //timeout defaults
+ CommonTimeOut t = connDef.getTimeOut();
+ assertThat(t.getAllocationRetry(), new IsNull<Long>());
+ assertThat(t.getAllocationRetryWaitMillis(), new IsNull<Long>());
+ assertThat(t.getBlockingTimeoutMillis(), new IsNull<Long>());
+ assertThat(t.getIdleTimeoutMinutes(), new IsNull<Long>());
+ assertThat(t.getXaResourceTimeout(), new IsNull<Long>());
+
+ //validation default
+ CommonValidation v = connDef.getValidation();
+ assertThat(v.getBackgroundValidationMinutes(), new IsNull<Long>());
+ assertThat(v.isBackgroundValidation(), is(false));
+ assertThat(v.isUseFastFail(), is(false));
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /** shouldIgnoreXaSpecificElementForNormalPool
+ * @throws Exception in case of error
+ */
+ @Test(expected = ParserException.class)
+ public void shouldThrowExceptionForXaSpecificElementForNormalPool() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory
+ .listFiles(new FilenamePrefixFilter("wrong-element-for-simple-pool-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
+ /** shouldParseXaSpecificElementForXalPool
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseXaSpecificElementForXalPool() throws Exception
+ {
+ FileInputStream is = null;
+
+ //given
+ File directory = new File(Thread.currentThread().getContextClassLoader().getResource("ironjacamar").toURI());
+ for (File xmlFile : directory
+ .listFiles(new FilenamePrefixFilter("right-element-for-xa-pool-ironjacamar.xml")))
+ {
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ IronJacamarParser parser = new IronJacamarParser();
+ //when
+ IronJacamar ij = parser.parse(is);
+ //then
+ CommonConnDef connDef = ij.getConnectionDefinitions().get(0);
+
+ //pool default
+ assertThat(connDef.isXa(), is(true));
+
+ //timeout
+ CommonTimeOut t = connDef.getTimeOut();
+ assertThat(t.getXaResourceTimeout(), is(100L));
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+ }
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java 2010-09-15 12:43:35 UTC (rev 108146)
@@ -97,29 +97,29 @@
File directory = new File(Thread.currentThread().getContextClassLoader().getResource("resource-adapter")
.toURI());
File xmlFile = directory.listFiles(new FilenamePrefixFilter("empty-ra.xml"))[0];
- try
- {
- is = new FileInputStream(xmlFile);
- ResourceAdapterParser parser = new ResourceAdapterParser();
- //when
- ResourceAdapters ra = parser.parse(is);
- //then
- assertThat(ra.getResourceAdapters().size() == 1, is(true));
- ResourceAdapter res = ra.getResourceAdapters().get(0);
+ try
+ {
+ is = new FileInputStream(xmlFile);
+ ResourceAdapterParser parser = new ResourceAdapterParser();
+ //when
+ ResourceAdapters ra = parser.parse(is);
+ //then
+ assertThat(ra.getResourceAdapters().size() == 1, is(true));
+ ResourceAdapter res = ra.getResourceAdapters().get(0);
assertThat(res.getAdminObjects(), new IsNull<List<CommonAdminObject>>());
- assertThat(res.getConfigProperties(), new IsNull<Map<String, String>>());
- assertThat(res.getBeanValidationGroups(), new IsNull<List<String>>());
+ assertThat(res.getConfigProperties(), new IsNull<Map<String, String>>());
+ assertThat(res.getBeanValidationGroups(), new IsNull<List<String>>());
assertThat(res.getConnectionDefinitions(), new IsNull<List<CommonConnDef>>());
- assertThat(res.getBootstrapContext(), new IsNull<String>());
- assertThat(res.getTransactionSupport(), new IsNull<TransactionSupportEnum>());
- assertThat(res.getArchive(), is("token"));
+ assertThat(res.getBootstrapContext(), new IsNull<String>());
+ assertThat(res.getTransactionSupport(), new IsNull<TransactionSupportEnum>());
+ assertThat(res.getArchive(), is("token"));
- }
- finally
- {
- if (is != null)
- is.close();
- }
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
}
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-empty.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-empty.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-empty.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition jndi-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <pool>
+ </pool>
+ <security>
+ </security>
+ <timeout>
+ </timeout>
+ <validation>
+ </validation>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-xa-empty.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-xa-empty.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-connection-definition-xa-empty.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition jndi-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <xa-pool>
+ </xa-pool>
+ <security>
+ </security>
+ <timeout>
+ </timeout>
+ <validation>
+ </validation>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-defaults.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-defaults.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-defaults.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-missed.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-missed.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/ironjacamar-security-missed.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute2-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute2-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/missing-attribute2-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/pool-xa-pool-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/pool-xa-pool-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/pool-xa-pool-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <pool>
+ </pool>
+ <xa-pool>
+ </xa-pool>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/right-element-for-xa-pool-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/right-element-for-xa-pool-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/right-element-for-xa-pool-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition jndi-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <xa-pool>
+ </xa-pool>
+ <security>
+ </security>
+ <timeout>
+ <xa-resource-timeout>100</xa-resource-timeout>
+ </timeout>
+ <validation>
+ </validation>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute2-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute2-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-attribute2-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-element-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-element-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/unexpected-element-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <no-xa-pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </no-xa-pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/wrong-element-for-simple-pool-ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/wrong-element-for-simple-pool-ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/ironjacamar/wrong-element-for-simple-pool-ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ironjacamar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/ironjacamar_1_0.xsd">
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition jndi-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <pool>
+ </pool>
+ <security>
+ </security>
+ <timeout>
+ <xa-resource-timeout>100</xa-resource-timeout>
+ </timeout>
+ <validation>
+ </validation>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
\ No newline at end of file
Added: projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/ra-unexpected-attribute.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/ra-unexpected-attribute.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/ra-unexpected-attribute.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- configuration for aSAPXcess SAP adapter for jboss 3.2 -->
+<!-- ==================================================================== -->
+<!-- aSAPXcess adapter configuration for SAP R3 -->
+<!-- Contact: aif_support at asapsolutions.com -->
+<!-- -->
+<!-- ==================================================================== -->
+<resource-adapters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/resource-adapter_1_0.xsd">
+ <resource-adapter>
+ <archive>token</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+ </resource-adapter>
+</resource-adapters>
\ No newline at end of file
Modified: projects/jboss-jca/trunk/deployers/src/test/resources/ra16standard303jbossra.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/ra16standard303jbossra.rar/META-INF/ironjacamar.xml 2010-09-15 12:41:43 UTC (rev 108145)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/ra16standard303jbossra.rar/META-INF/ironjacamar.xml 2010-09-15 12:43:35 UTC (rev 108146)
@@ -6,7 +6,7 @@
<bean-validation-group>org.jboss.jca.test.deployers.spec.rars.ra16standard303jbossra.SecondStep</bean-validation-group>
</bean-validation-groups>
<connection-definitions>
- <connection-definition class-name="a">
+ <connection-definition class-name="a" jndi-name="aa">
<config-property name="myStringProperty">newJCA</config-property>
</connection-definition>
</connection-definitions>
More information about the jboss-cvs-commits
mailing list