Skip to main content
summaryrefslogtreecommitdiffstats
blob: 45e7ac970a69c8965f2c54d1412b289dfcb65ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.eclipse.wst.xml.resolver.tools.tests.internal;

import java.io.IOException;

import junit.framework.TestCase;

import org.eclipse.wst.xml.catalog.tests.internal.TestPlugin;


/**
 * To run this test need to add resolver.jar to the classpath.
 * Run as JUnit Plugin test:
 * - put resolver.jar on the boot class path
 * - add VM argument:
 * 
 * -Xbootclasspath/p:<install location>\jre\lib\ext\resolver.jar
 *
 *
 */
public class ValidatorTest extends TestCase {
	
	

	protected void setUp() throws Exception {
		super.setUp();
		
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public ValidatorTest(String name) {
		super(name);
	}
	
	
	public void testValidatingParser() throws IOException {
		String xmlFile = "/data/Personal/personal-schema.xml";
		xmlFile = TestPlugin.resolvePluginLocation(xmlFile);
		
		String catalogFile = "/data/catalog2.xml";
		catalogFile = TestPlugin.resolvePluginLocation(catalogFile);
				
		System.out.println("---------" + this.getName() + "---------");
		ResolvingXMLParser parser = new ResolvingXMLParser();
		parser.parseAndValidate(xmlFile, new String[]{catalogFile});
		assertFalse(parser.validationError);
	}

}

Back to the top