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 EdgeTest extends TestCase {
public EdgeTest( String pEdge ) {
super( pEdge );
}
public static TestSuite suite() {
return new TestSuite( EdgeTest.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[] { "./bar", "bar/.", "./bar/.", "././bar", "bar/./.",
"bar/./que", "bar/que/.",
"./bar/./que", "./bar/que/.",
"bar/././que", "bar/que/./.",
} ) );
sRecordDataList.add( ListUtil.make( new String[] { "bt1qt1", "bt1qt1", "bt1qt1", "bt1qt1", "bt1qt1",
"qt1", "qt1",
"qt1", "qt1",
"qt1", "qt1" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "self::node()/bar",
"bar/self::node()",
"self::node()/bar/self::node()",
"self::node()/self::node()/bar",
"bar/self::node()/self::node()",
"bar/self::node()/que",
"bar/que/self::node()",
"self::node()/bar/self::node()/que",
"self::node()/bar/que/self::node()",
"bar/self::node()/self::node()/que",
"bar/que/self::node()/self::node()", } ) );
sRecordDataList.add( ListUtil.make( new String[] { "bt1qt1", "bt1qt1", "bt1qt1", "bt1qt1", "bt1qt1",
"qt1", "qt1",
"qt1", "qt1",
"qt1", "qt1" } ) );
sRecordSpecList.add( new RecordSpec( "/foo", new String[] { "bar/*", "*/que", "*/*" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "qt1", "qt1", "qt1" } ) );
sRecordSpecList.add( new RecordSpec( "/foo/*/que", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "q1" } ) );
sRecordSpecList.add( new RecordSpec( "/foo/child::node()/que", new String[] { "@name" } ) );
sRecordDataList.add( ListUtil.make( new String[] { "q1" } ) );
}
public void testEdges() throws Exception {
TestUtil.testRecords( "com/ricebridge/xmlman/in/test/edge.xml", sRecordSpecList, sRecordDataList, this );
}
}