Author: chris.laprun(a)jboss.com
Date: 2007-05-06 20:19:29 -0400 (Sun, 06 May 2007)
New Revision: 7207
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
Log:
- Fixed ProducerConfigurationTestCase.
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-05-06
21:48:33 UTC (rev 7206)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-05-07
00:19:29 UTC (rev 7207)
@@ -28,6 +28,7 @@
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
import org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator;
import org.jboss.portal.registration.policies.RegistrationPropertyValidator;
+import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationFactory;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -103,26 +104,32 @@
assertTrue(properties.isEmpty());
}
- public void testInvalidProducerConfiguration() throws Exception
+ public void testInvalidMultipleRegistrationConfiguration() throws Exception
{
try
{
- getProducerConfiguration("invalid1.xml");
- fail("Invalid value for fullServiceDescriptionRequiresRegistration should
have caused failure");
+ getProducerConfiguration("invalid2.xml");
+ fail("Only one registration-configuration element allowed!");
}
catch (Exception expected)
{
}
+ }
+ public void testInvalidTypeValue() throws Exception
+ {
try
{
- getProducerConfiguration("invalid2.xml");
- fail("Only one registration-configuration element allowed!");
+ getProducerConfiguration("invalid-type.xml");
+ fail("Invalid type for property description should fail.");
}
catch (Exception expected)
{
}
+ }
+ public void testInvalidPropertyValidator()
+ {
try
{
getProducerConfiguration("invalid3.xml");
@@ -131,22 +138,25 @@
catch (Exception expected)
{
}
+ }
+ public void testInvalidFullServiceDescriptionValue()
+ {
try
{
- getProducerConfiguration("invalid-type.xml");
- fail("Invalid type for property description should fail.");
+ getProducerConfiguration("invalid1.xml");
+ fail("Invalid value for fullServiceDescriptionRequiresRegistration should
have caused failure");
}
- catch (IllegalArgumentException expected)
+ catch (Exception expected)
{
}
}
- private ProducerConfiguration getProducerConfiguration(String fileName)
- throws JBossXBException, IOException
+ private ProducerConfiguration getProducerConfiguration(String fileName) throws
JBossXBException, IOException
{
URL location =
Thread.currentThread().getContextClassLoader().getResource(fileName);
assertNotNull(location);
+ System.out.println("location = " + location);
Object o = unmarshaller.unmarshal(location.openStream(), factory, null);
assertNotNull(o);
@@ -159,7 +169,7 @@
RegistrationPropertyDescription desc =
requirements.getRegistrationPropertyWith("name" + index);
assertNotNull(desc);
assertEquals(new QName("name" + index), desc.getName());
- assertEquals(new QName("xsd:string"), desc.getType());
+ assertEquals(WSRPConstants.XSD_STRING, desc.getType());
LocalizedString localizedString = new LocalizedString("hint" + index,
Locale.ENGLISH);
localizedString.setResourceName("resource.hint" + index);
Modified: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml 2007-05-06
21:48:33 UTC (rev 7206)
+++
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml 2007-05-07
00:19:29 UTC (rev 7207)
@@ -29,14 +29,14 @@
<registration-property-description>
<name>name1</name>
<type>xsd:string</type>
+ <label xml:lang="en"
resourceName="resource.label1">label1</label>
<hint xml:lang="en"
resourceName="resource.hint1">hint1</hint>
- <label xml:lang="en"
resourceName="resource.label1">label1</label>
</registration-property-description>
<registration-property-description>
<name>name2</name>
<type>xsd:string</type>
+ <label xml:lang="en"
resourceName="resource.label2">label2</label>
<hint xml:lang="en"
resourceName="resource.hint2">hint2</hint>
- <label xml:lang="en"
resourceName="resource.label2">label2</label>
</registration-property-description>
</registration-configuration>
</producer-configuration>
Show replies by date