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 SubDivTest extends TestCase {
public SubDivTest( String pSubDiv ) {
super( pSubDiv );
}
public static TestSuite suite() {
return new TestSuite( SubDivTest.class );
}
public static void main( String[] pArgs ) {
TestRunner.run( suite() );
}
private static ArrayList sRecordSpecList = new ArrayList();
private static ArrayList sRecordDataList = new ArrayList();
static {
ArrayList recs;
sRecordSpecList.add( new RecordSpec( "//div", new String[] { "@class" } ) );
recs = new ArrayList();
recs.add( new String[] {"t"} ); recs.add( new String[] {"i"} ); recs.add( new String[] {"c"} );
recs.add( new String[] {"t"} ); recs.add( new String[] {"i"} ); recs.add( new String[] {"c"} );
recs.add( new String[] {"t"} ); recs.add( new String[] {"i"} ); recs.add( new String[] {"c"} );
recs.add( new String[] {"03"} ); recs.add( new String[] {"02"} ); recs.add( new String[] {"01"} );
sRecordDataList.add( recs );
sRecordSpecList.add( new RecordSpec( "//div", new String[] { "rb:trim(text())" } ) );
recs = new ArrayList();
recs.add( new String[] {"t1"} ); recs.add( new String[] {"i1"} ); recs.add( new String[] {"c1"} );
recs.add( new String[] {"t2"} ); recs.add( new String[] {"i2"} ); recs.add( new String[] {"c2"} );
recs.add( new String[] {"t3"} ); recs.add( new String[] {"i3"} ); recs.add( new String[] {"c3"} );
recs.add( new String[] {""} ); recs.add( new String[] {""} ); recs.add( new String[] {""} );
sRecordDataList.add( recs );
sRecordSpecList.add( new RecordSpec( "//div[@class='t']", new String[] { "rb:trim(text())" } ) );
recs = new ArrayList();
recs.add( new String[] {"t1"} );
recs.add( new String[] {"t2"} );
recs.add( new String[] {"t3"} );
sRecordDataList.add( recs );
}
public void testVariable() throws Exception {
TestUtil.testRecords( "com/ricebridge/xmlman/in/test/subdiv.xml", sRecordSpecList, sRecordDataList, this );
}
}