package com.ricebridge.xmlman.in.test;
import com.ricebridge.xmlman.*;
import com.ricebridge.xmlman.in.*;
import org.jostraca.util.*;
import junit.framework.*;
import junit.textui.*;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
import java.util.*;
import java.io.*;
public class NameTest extends TestCase {
public NameTest( String pName ) {
super( pName );
}
public static TestSuite suite() {
return new TestSuite( NameTest.class );
}
public static void main( String[] pArgs ) {
TestRunner.run( suite() );
}
private static ArrayList sRecordSpecList = new ArrayList();
private static ArrayList sRecordDataList = new ArrayList();
static {
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/*/bar", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "bar" } ) );
sRecordSpecList.add( new RecordSpec( "/*", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/foo/*", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "bar" } ) );
sRecordSpecList.add( new RecordSpec( "/*[@name='foo']", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/node()[@name='foo']", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/node()[name()='foo']", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "name()" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/*", new String[] { "name(/foo)" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "/foo" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "/foo/text()" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "name(/foo)" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
sRecordSpecList.add( new RecordSpec( "/*[name(/foo)='foo']", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "foo" } ) );
}
public void testVariable() throws Exception {
TestUtil.testRecords( "com/ricebridge/xmlman/in/test/name.xml", sRecordSpecList, sRecordDataList, this );
}
}