Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1319 - development/main/metro/composition/test/src/test/net/dpml/composition/util

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: pneubauer AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1319 - development/main/metro/composition/test/src/test/net/dpml/composition/util
  • Date: Tue, 28 Dec 2004 22:58:54 +0100

Author: pneubauer
Date: Tue Dec 28 22:58:54 2004
New Revision: 1319

Modified:

development/main/metro/composition/test/src/test/net/dpml/composition/util/SchemaValidationTestCase.java
Log:
now using the right directory for the test


Modified:
development/main/metro/composition/test/src/test/net/dpml/composition/util/SchemaValidationTestCase.java
==============================================================================
---
development/main/metro/composition/test/src/test/net/dpml/composition/util/SchemaValidationTestCase.java
(original)
+++
development/main/metro/composition/test/src/test/net/dpml/composition/util/SchemaValidationTestCase.java
Tue Dec 28 22:58:54 2004
@@ -68,8 +68,7 @@
private XercesSchemaValidator m_validator;

private static final String XML_CONFIGURATION = "<?xml
version=\"1.0\"?>" +
- "<configuration
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""; +
-
"xsi:noNamespaceSchemaLocation=\"ConfigurableB.xschema\" attr1=\"foo\">" +
+ "<configuration attr1=\"foo\">" +
"<child1/>" +
"</configuration>";

@@ -80,43 +79,17 @@

}

- public void _testSimpleParseWithOkConfigXML() throws Exception
- {
- String xmlDocumentUrl = System.getProperty( "project.dir" )
- + "/ConfigurableB.xml";
- TypeBuilder builder = new TypeBuilder();
- Type type = builder.buildType( ConfigurableB.class );
- Configuration config = ConfigurationBuilder.build( xmlDocumentUrl );
- m_validator.validate( config, type );
-
- }

- public void _testSimpleParseWithNonExistentSchemaUrl() throws Exception
- {
- String xmlDocumentUrl = System.getProperty( "project.dir" )
- + "/ConfigurableB.xml";
- TypeBuilder builder = new TypeBuilder();
- Type type = builder.buildType( ConfigurableA.class );
- Configuration config = ConfigurationBuilder.build( xmlDocumentUrl );
- try
- {
- m_validator.validate( config, type );
- }
- catch ( ModelException e )
- {
- //expected
- assertTrue( true );
- }
- }

- public void testParsingOfValidatingXMLNotOKWhenUsingFiles() throws
Exception
+ public void testParsingOfValidatingXMLOKWhenUsingFiles() throws Exception
{
SAXParser saxParser = new SAXParser();
- System.out.println("XML parser: " + saxParser);
+ String projectDir = System.getProperty("project.dir");
+ String schemaLocation = new File(projectDir +
"/ConfigurableB.xschema").getAbsolutePath();
+ System.out.println("schema: " + schemaLocation);
try
{
saxParser.setProperty( JAXP_SCHEMA_LANGUAGE,
W3C_XML_SCHEMA );
- String schemaLocation = "ConfigurableB.xschema";

saxParser.setFeature("http://xml.org/sax/features/validation";, true);

saxParser.setFeature("http://apache.org/xml/features/validation/schema";,
true);
@@ -131,14 +104,14 @@
}
TestHandler testHandler = new TestHandler();
saxParser.setErrorHandler(testHandler);
- saxParser.parse( "target/test/ConfigurableB.xml" );
+ saxParser.parse( new InputSource(new
ByteArrayInputStream(XML_CONFIGURATION.getBytes())));
assertEquals(0, testHandler.m_errors.size());



}

- public void _testDummyAlwaysTrue()
+ public void testDummyAlwaysTrue()
{
//System.out.println(System.getProperties());
assertTrue( true );



  • svn commit: r1319 - development/main/metro/composition/test/src/test/net/dpml/composition/util, pneubauer, 12/28/2004

Archive powered by MHonArc 2.6.24.

Top of Page