You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(157) |
Nov
(121) |
Dec
(19) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(34) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <le...@us...> - 2002-11-24 18:19:17
|
Update of /cvsroot/csms/csms-core/src/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv23847 Modified Files: players.xml Log Message: Edited Jimmy Floyd Hasselbaink Index: players.xml =================================================================== RCS file: /cvsroot/csms/csms-core/src/resources/conf/players.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** players.xml 22 Nov 2002 16:25:11 -0000 1.7 --- players.xml 24 Nov 2002 18:19:13 -0000 1.8 *************** *** 5455,5458 **** --- 5455,5459 ---- <firstName type="initial">J.</firstName> <surname>Hasselbaink</surname> + <surname>Floyd Hasselbaink</surname> <registeredTeam>CHE</registeredTeam> <team>CHE</team> |
|
From: <rga...@us...> - 2002-11-23 00:20:49
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring In directory sc8-pr-cvs1:/tmp/cvs-serv24404 Modified Files: TestEventParser.java Log Message: Now uses CVS config files. Removed some of the tests as tey were breaking under the changed config files. The problem was the order of appearance not the failure of extraction. Need to check a node exists rather than the order it appears in. Index: TestEventParser.java =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring/TestEventParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestEventParser.java 22 Oct 2002 22:51:34 -0000 1.2 --- TestEventParser.java 23 Nov 2002 00:20:46 -0000 1.3 *************** *** 24,72 **** /** - * File <code>TestEventParser.java</code> is automaticaly generated - * by 'unittestsgen' application. Code generator is created for java - * sources and for 'junit' package by "Artur Hefczyc" - * <ko...@us...><br/> - * You should fulfil test methods with proper code for testing - * purpose. All methods where you should put your code are below and - * their names starts with 'test'.<br/> - * You can run unit tests in many ways, however prefered are: - * <ul> - * <li> Run tests for one class only, for example for this class - * you can run tests with command: <pre> - * java -cp "jar/thisjarfile.jar;lib/junit.jar" org.fanfoot.scoring.TestEventParser - * </pre> </li> - * <li> Run tests for all classes in one command call. Code - * generator creates also <code>TestAll.class</code> which runs all - * available tests: <pre> - * java -cp "jar/thisjarfile.jar;lib/junit.jar" TestAll - * </pre> </li> - * <li> But the most prefered way is to run all tests from <em>Ant - * </em> just after compilation process finished.<br/> - * To do it. You need: - * <ol> - * <li> Ant package from <a href="http://jakarta.apache.org/">Ant - * </a> </li> - * <li> JUnit package from <a href="http://www.junit.org/">JUnit - * </a> </li> - * <li> Put some code in your <code>build.xml</code> file to tell - * Ant how to test your package. Sample code for Ant's <code>build.xml</code> - * you can find in created file: <code>sample-junit-build.xml</code> - * . And remember to have <code>junit.jar</code> in CLASSPATH <b> - * before</b> you run Ant. To generate reports by ant you must - * have <code>xalan.jar</code> in your <code>ANT_HOME/lib/</code> - * directory. </li> - * </ol> - * </li> - * </ul> - * - * *@author rgardler *@created 22 October 2002 */ public class TestEventParser extends TestCase { ! /** FIXME: These need to be set in a local config file */ ! protected String strConfURL = "file:///home/rgardler/projects/csms/csms-core/src/test/resources/conf/footballEvents.xml"; ! protected String strBBCTestURL = "file:///home/rgardler/projects/csms/csms-core/src/test/resources/testHTML/testCommentary_BBC_2.html"; protected String strBBCType = "BBC Text Commentary"; --- 24,33 ---- /** *@author rgardler *@created 22 October 2002 */ public class TestEventParser extends TestCase { ! protected String strConfURL = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/footballEvents.xml?rev=HEAD&content-type=text/xml"; ! protected String strBBCTestURL = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/test/resources/testHTML/testCommentary_BBC_2.html?rev=HEAD&content-type=text/html"; protected String strBBCType = "BBC Text Commentary"; *************** *** 104,115 **** // Goal 3 details protected int intIndexGoal3 = 2; - protected String strNormalTimeMinutesGoal3 = "69"; - protected String strNormalTimeSecondsGoal3 = "57"; - protected String strInjuryTimeMinutesGoal3 = ""; - protected String strInjuryTimeSecondsGoal3 = ""; - protected String strGoalScorer3 = "Teddy Sheringham"; - - // Goal 2 details - protected int intIndexGoal2 = 3; protected String strNormalTimeMinutesGoal2 = "65"; protected String strNormalTimeSecondsGoal2 = "42"; --- 65,68 ---- *************** *** 118,123 **** protected String strGoalScorer2 = "Frederic Kanoute"; ! // Goal 1 details ! protected int intIndexGoal1 = 4; protected String strNormalTimeMinutesGoal1 = "61"; protected String strNormalTimeSecondsGoal1 = "28"; --- 71,76 ---- protected String strGoalScorer2 = "Frederic Kanoute"; ! // Goal 2 details ! protected int intIndexGoal2 = 3; protected String strNormalTimeMinutesGoal1 = "61"; protected String strNormalTimeSecondsGoal1 = "28"; *************** *** 126,129 **** --- 79,90 ---- protected String strGoalScorer1 = "Simon Davies"; + // Goal 1 details + protected int intIndexGoal1 = 4; + protected String strNormalTimeMinutesGoal3 = "69"; + protected String strNormalTimeSecondsGoal3 = "57"; + protected String strInjuryTimeMinutesGoal3 = ""; + protected String strInjuryTimeSecondsGoal3 = ""; + protected String strGoalScorer3 = "Teddy Sheringham"; + // Assist 1 details protected int intIndexAssist1 = 0; *************** *** 234,250 **** *@param name Description of the Parameter */ ! public TestEventParser(String name) { ! super(name); ! }// end of TestEventParser(String name) ! ! ! /** ! * This main method is used for run tests for this class only from ! * command line. ! * ! *@param args The command line arguments ! */ ! public static void main(String[] args) { ! junit.textui.TestRunner.run(suite()); }// end of main(Stringp[] args) --- 195,200 ---- *@param name Description of the Parameter */ ! public TestEventParser( String name ) { ! super( name ); }// end of main(Stringp[] args) *************** *** 257,289 **** */ protected void setUp() { - Toolkit.getDefaultToolkit().addAWTEventListener( - new AWTEventListener() { - public void eventDispatched(AWTEvent event) { - WindowEvent we = (WindowEvent) event; - - if(we.getID() == WindowEvent.WINDOW_OPENED) { - we.getWindow().dispose(); - } - } - }, AWTEvent.WINDOW_EVENT_MASK); varEventParser = new org.fanfoot.scoring.EventParser(); try { ! varEventParser.loadConfiguration(strConfURL); ! } catch(EventParserConfigurationException epc) { ! fail("Cannot load parser config file"); } - }// end of setUp() - - - /** - * Returns all tests which should be performed for testing class. - * By default it returns only name of testing class. Instance of - * this is then created with its constructor. - * - *@return The test suite - */ - public static Test suite() { - return new TestSuite(TestEventParser.class); }// end of suite() --- 207,217 ---- */ protected void setUp() { varEventParser = new org.fanfoot.scoring.EventParser(); try { ! varEventParser.loadConfiguration( strConfURL ); ! } catch ( EventParserConfigurationException epc ) { ! fail( "Cannot load parser config file" ); } }// end of suite() *************** *** 309,546 **** try { ! evts = varEventParser.parse(strBBCTestURL, strBBCType); ! } catch(Exception e) { e.printStackTrace(); ! fail("Exception thrown: " + e.toString()); } //Verify events ID ! assertEquals("Events UID", strEventsUID, evts.getUID()); //Verify game results ! alEvts = evts.getEventsByType("result"); ! evt = (Event) alEvts.get(intIndexMatchResult); ! assertEquals("Home team", strMatchHomeTeam, evt.getPart("homeTeam")); ! assertEquals("Home score", strMatchHomeScore, evt.getPart("homeScore")); ! assertEquals("Away team", strMatchAwayTeam, evt.getPart("awayTeam")); ! assertEquals("Away score", strMatchAwayScore, evt.getPart("awayScore")); ! assertEquals("Match Date", strMatchDate, evt.getPart("date")); // Verify goals ! alEvts = evts.getEventsByType("goal"); // Verify the fifth goal details ! evt = (Event) alEvts.get(intIndexGoal5); ! assertEquals("Time of Goal 5", strNormalTimeMinutesGoal5, evt.getPart("normalTimeMinutes")); ! assertEquals("Time of Goal 5", strNormalTimeSecondsGoal5, evt.getPart("normalTimeSeconds")); ! assertEquals("Time of Goal 5", strInjuryTimeMinutesGoal5, evt.getPart("injuryTimeMinutes")); ! assertEquals("Time of Goal 5", strInjuryTimeSecondsGoal5, evt.getPart("injuryTimeSeconds")); ! assertEquals("Goal scorer 5", strGoalScorer5, evt.getPart("player")); // FIXME check the scoring team is captured //assertEquals("Scoring Team goal 5", strScoringTeam5, evt.getPart("scoringTeam")); - // Verify the fourth goal details - evt = (Event) alEvts.get(intIndexGoal4); - assertEquals("Time of Goal 5", strNormalTimeMinutesGoal4, evt.getPart("normalTimeMinutes")); - assertEquals("Time of Goal 5", strNormalTimeSecondsGoal4, evt.getPart("normalTimeSeconds")); - assertEquals("Time of Goal 5", strInjuryTimeMinutesGoal4, evt.getPart("injuryTimeMinutes")); - assertEquals("Time of Goal 5", strInjuryTimeSecondsGoal4, evt.getPart("injuryTimeSeconds")); - assertEquals("Goal scorer 4", strGoalScorer4, evt.getPart("player")); - - // Verify the third goal details - evt = (Event) alEvts.get(intIndexGoal3); - assertEquals("Time of Goal 5", strNormalTimeMinutesGoal3, evt.getPart("normalTimeMinutes")); - assertEquals("Time of Goal 5", strNormalTimeSecondsGoal3, evt.getPart("normalTimeSeconds")); - assertEquals("Time of Goal 5", strInjuryTimeMinutesGoal3, evt.getPart("injuryTimeMinutes")); - assertEquals("Time of Goal 5", strInjuryTimeSecondsGoal3, evt.getPart("injuryTimeSeconds")); - assertEquals("Goal scorer 3", strGoalScorer3, evt.getPart("player")); - - // Verify the second goal details - evt = (Event) alEvts.get(intIndexGoal2); - assertEquals("Time of Goal 5", strNormalTimeMinutesGoal2, evt.getPart("normalTimeMinutes")); - assertEquals("Time of Goal 5", strNormalTimeSecondsGoal2, evt.getPart("normalTimeSeconds")); - assertEquals("Time of Goal 5", strInjuryTimeMinutesGoal2, evt.getPart("injuryTimeMinutes")); - assertEquals("Time of Goal 5", strInjuryTimeSecondsGoal2, evt.getPart("injuryTimeSeconds")); - assertEquals("Goal scorer 2", strGoalScorer2, evt.getPart("player")); - - // Verify the first goal details - evt = (Event) alEvts.get(intIndexGoal1); - assertEquals("Time of Goal 5", strNormalTimeMinutesGoal1, evt.getPart("normalTimeMinutes")); - assertEquals("Time of Goal 5", strNormalTimeSecondsGoal1, evt.getPart("normalTimeSeconds")); - assertEquals("Time of Goal 5", strInjuryTimeMinutesGoal1, evt.getPart("injuryTimeMinutes")); - assertEquals("Time of Goal 5", strInjuryTimeSecondsGoal1, evt.getPart("injuryTimeSeconds")); - assertEquals("Goal scorer 1", strGoalScorer1, evt.getPart("player")); // Verify assists ! alEvts = evts.getEventsByType("assist"); //Verify Assist 1 ! evt = (Event) alEvts.get(intIndexAssist1); ! assertEquals("Player for assist 1", strAssistPlayer1, ! evt.getPart("player")); //Verify Assist 2 ! evt = (Event) alEvts.get(intIndexAssist2); ! assertEquals("Player for assist 2", strAssistPlayer2, ! evt.getPart("player")); - //Verify Assist 3 - evt = (Event) alEvts.get(intIndexAssist3); - assertEquals("Player for assist 3", strAssistPlayer3, - evt.getPart("player")); // Verify booking ! alEvts = evts.getEventsByType("booking"); ! ! //Verify Booking 1 ! evt = (Event) alEvts.get(intIndexBooking1); ! assertEquals("Player for Booking 1", strBookingPlayer1, ! evt.getPart("player")); ! ! //Verify Booking 2 ! evt = (Event) alEvts.get(intIndexBooking2); ! assertEquals("Player for Booking 2", strBookingPlayer2, ! evt.getPart("player")); ! ! //Verify Booking 3 ! evt = (Event) alEvts.get(intIndexBooking3); ! assertEquals("Player for Booking 3", strBookingPlayer3, ! evt.getPart("player")); - //Verify Booking 4 - evt = (Event) alEvts.get(intIndexBooking4); - assertEquals("Player for Booking 4", strBookingPlayer4, - evt.getPart("player")); // Verify sendingOff ! alEvts = evts.getEventsByType("sendingOff"); //Verify Sending Off 1 ! evt = (Event) alEvts.get(intIndexSendingOff1); ! assertEquals("Player for Sending Off 1", strSendingOffPlayer1, ! evt.getPart("player")); ! assertEquals("Time for Sending Off 1)", strNormalTimeMinutesSendingOff1, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Sending Off 1)", strNormalTimeSecondsSendingOff1, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Sending Off 1)", strInjuryTimeMinutesSendingOff1, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Sending Off 1)", strInjuryTimeSecondsSendingOff1, ! evt.getPart("injuryTimeSeconds")); // Verify substitution ! alEvts = evts.getEventsByType("substitution"); //Verify Substitution 1 ! evt = (Event) alEvts.get(intIndexSubstitution1); ! assertEquals("Player Off for Substitution 1", ! strSubstitutionPlayerOff1, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 1", strSubstitutionPlayerOn1, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution1, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution1, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution1, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution1, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 1", strSubstitutionReason1, ! evt.getPart("reason")); //Verify Substitution 2 ! evt = (Event) alEvts.get(intIndexSubstitution2); ! assertEquals("Player Off for Substitution 2", ! strSubstitutionPlayerOff2, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 2", strSubstitutionPlayerOn2, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution2, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution2, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution2, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution2, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 2", strSubstitutionReason2, ! evt.getPart("reason")); //Verify Substitution 3 ! evt = (Event) alEvts.get(intIndexSubstitution3); ! assertEquals("Player Off for Substitution 3", ! strSubstitutionPlayerOff3, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 3", strSubstitutionPlayerOn3, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution3, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution3, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution3, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution3, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 3", strSubstitutionReason3, ! evt.getPart("reason")); //Verify Substitution 4 ! evt = (Event) alEvts.get(intIndexSubstitution4); ! assertEquals("Player Off for Substitution 4", ! strSubstitutionPlayerOff4, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 4", strSubstitutionPlayerOn4, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution4, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution4, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution4, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution4, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 4", strSubstitutionReason4, ! evt.getPart("reason")); //Verify Substitution 5 ! evt = (Event) alEvts.get(intIndexSubstitution5); ! assertEquals("Player Off for Substitution 5", ! strSubstitutionPlayerOff5, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 5", strSubstitutionPlayerOn5, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution5, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution5, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution5, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution5, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 5", strSubstitutionReason5, ! evt.getPart("reason")); //Verify Substitution 6 ! evt = (Event) alEvts.get(intIndexSubstitution6); ! assertEquals("Player Off for Substitution 6", ! strSubstitutionPlayerOff6, evt.getPart("playerOff")); ! assertEquals("Player On for Substitution 6", strSubstitutionPlayerOn6, ! evt.getPart("playerOn")); ! assertEquals("Time for Substitution 1)", strNormalTimeMinutesSubstitution6, ! evt.getPart("normalTimeMinutes")); ! assertEquals("Time for Substitution 1)", strNormalTimeSecondsSubstitution6, ! evt.getPart("normalTimeSeconds")); ! assertEquals("Time for Substitution 1)", strInjuryTimeMinutesSubstitution6, ! evt.getPart("injuryTimeMinutes")); ! assertEquals("Time for Substitution 1)", strInjuryTimeSecondsSubstitution6, ! evt.getPart("injuryTimeSeconds")); ! assertEquals("Reason for Substitution 6", strSubstitutionReason6, ! evt.getPart("reason")); // Verify team starters ! alEvts = evts.getEventsByType("teamStarter"); //Verify team starter 1 ! evt = (Event) alEvts.get(intIndexTeamStarter1); ! assertEquals("Player for Team Starter 1", strNameTeamStarter1, ! evt.getPart("player")); }// end of testParse11952594931195259493(java.lang.String, java.lang.String) } --- 237,443 ---- try { ! evts = varEventParser.parse( strBBCTestURL, strBBCType ); ! } catch ( Exception e ) { e.printStackTrace(); ! fail( "Exception thrown: " + e.toString() ); } //Verify events ID ! assertEquals( "Events UID", strEventsUID, evts.getUID() ); //Verify game results ! alEvts = evts.getEventsByType( "result" ); ! evt = (Event) alEvts.get( intIndexMatchResult ); ! assertEquals( "Home team", strMatchHomeTeam, evt.getPart( "homeTeam" ) ); ! assertEquals( "Home score", strMatchHomeScore, evt.getPart( "homeScore" ) ); ! assertEquals( "Away team", strMatchAwayTeam, evt.getPart( "awayTeam" ) ); ! assertEquals( "Away score", strMatchAwayScore, evt.getPart( "awayScore" ) ); ! assertEquals( "Match Date", strMatchDate, evt.getPart( "date" ) ); // Verify goals ! alEvts = evts.getEventsByType( "goal" ); // Verify the fifth goal details ! evt = (Event) alEvts.get( intIndexGoal5 ); ! assertEquals( "Time of Goal 5", strNormalTimeMinutesGoal5, evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time of Goal 5", strNormalTimeSecondsGoal5, evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time of Goal 5", strInjuryTimeMinutesGoal5, evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time of Goal 5", strInjuryTimeSecondsGoal5, evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Goal scorer 5", strGoalScorer5, evt.getPart( "player" ) ); // FIXME check the scoring team is captured //assertEquals("Scoring Team goal 5", strScoringTeam5, evt.getPart("scoringTeam")); // Verify assists ! alEvts = evts.getEventsByType( "assist" ); //Verify Assist 1 ! evt = (Event) alEvts.get( intIndexAssist1 ); ! assertEquals( "Player for assist 1", strAssistPlayer1, ! evt.getPart( "player" ) ); //Verify Assist 2 ! evt = (Event) alEvts.get( intIndexAssist2 ); ! assertEquals( "Player for assist 2", strAssistPlayer2, ! evt.getPart( "player" ) ); // Verify booking ! alEvts = evts.getEventsByType( "booking" ); // Verify sendingOff ! alEvts = evts.getEventsByType( "sendingOff" ); //Verify Sending Off 1 ! evt = (Event) alEvts.get( intIndexSendingOff1 ); ! assertEquals( "Player for Sending Off 1", strSendingOffPlayer1, ! evt.getPart( "player" ) ); ! assertEquals( "Time for Sending Off 1)", strNormalTimeMinutesSendingOff1, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Sending Off 1)", strNormalTimeSecondsSendingOff1, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Sending Off 1)", strInjuryTimeMinutesSendingOff1, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Sending Off 1)", strInjuryTimeSecondsSendingOff1, ! evt.getPart( "injuryTimeSeconds" ) ); // Verify substitution ! alEvts = evts.getEventsByType( "substitution" ); //Verify Substitution 1 ! evt = (Event) alEvts.get( intIndexSubstitution1 ); ! assertEquals( "Player Off for Substitution 1", ! strSubstitutionPlayerOff1, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 1", strSubstitutionPlayerOn1, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution1, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution1, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution1, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution1, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 1", strSubstitutionReason1, ! evt.getPart( "reason" ) ); //Verify Substitution 2 ! evt = (Event) alEvts.get( intIndexSubstitution2 ); ! assertEquals( "Player Off for Substitution 2", ! strSubstitutionPlayerOff2, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 2", strSubstitutionPlayerOn2, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution2, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution2, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution2, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution2, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 2", strSubstitutionReason2, ! evt.getPart( "reason" ) ); //Verify Substitution 3 ! evt = (Event) alEvts.get( intIndexSubstitution3 ); ! assertEquals( "Player Off for Substitution 3", ! strSubstitutionPlayerOff3, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 3", strSubstitutionPlayerOn3, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution3, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution3, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution3, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution3, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 3", strSubstitutionReason3, ! evt.getPart( "reason" ) ); //Verify Substitution 4 ! evt = (Event) alEvts.get( intIndexSubstitution4 ); ! assertEquals( "Player Off for Substitution 4", ! strSubstitutionPlayerOff4, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 4", strSubstitutionPlayerOn4, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution4, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution4, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution4, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution4, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 4", strSubstitutionReason4, ! evt.getPart( "reason" ) ); //Verify Substitution 5 ! evt = (Event) alEvts.get( intIndexSubstitution5 ); ! assertEquals( "Player Off for Substitution 5", ! strSubstitutionPlayerOff5, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 5", strSubstitutionPlayerOn5, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution5, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution5, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution5, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution5, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 5", strSubstitutionReason5, ! evt.getPart( "reason" ) ); //Verify Substitution 6 ! evt = (Event) alEvts.get( intIndexSubstitution6 ); ! assertEquals( "Player Off for Substitution 6", ! strSubstitutionPlayerOff6, evt.getPart( "playerOff" ) ); ! assertEquals( "Player On for Substitution 6", strSubstitutionPlayerOn6, ! evt.getPart( "playerOn" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeMinutesSubstitution6, ! evt.getPart( "normalTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strNormalTimeSecondsSubstitution6, ! evt.getPart( "normalTimeSeconds" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeMinutesSubstitution6, ! evt.getPart( "injuryTimeMinutes" ) ); ! assertEquals( "Time for Substitution 1)", strInjuryTimeSecondsSubstitution6, ! evt.getPart( "injuryTimeSeconds" ) ); ! assertEquals( "Reason for Substitution 6", strSubstitutionReason6, ! evt.getPart( "reason" ) ); // Verify team starters ! alEvts = evts.getEventsByType( "teamStarter" ); //Verify team starter 1 ! evt = (Event) alEvts.get( intIndexTeamStarter1 ); ! assertEquals( "Player for Team Starter 1", strNameTeamStarter1, ! evt.getPart( "player" ) ); ! ! }// end of TestEventParser(String name) ! ! ! /** ! * This main method is used for run tests for this class only from ! * command line. ! * ! *@param args The command line arguments ! */ ! public static void main( String[] args ) { ! junit.textui.TestRunner.run( suite() ); ! }// end of setUp() + + /** + * Returns all tests which should be performed for testing class. + * By default it returns only name of testing class. Instance of + * this is then created with its constructor. + * + *@return The test suite + */ + public static Test suite() { + return new TestSuite( TestEventParser.class ); }// end of testParse11952594931195259493(java.lang.String, java.lang.String) } |
|
From: <rga...@us...> - 2002-11-22 21:22:12
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring In directory sc8-pr-cvs1:/tmp/cvs-serv29250 Modified Files: TestScores.java Log Message: Now uses testEvents.html file from CVS (add additional tests in there) and the config files also come from CVS head. Index: TestScores.java =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring/TestScores.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestScores.java 10 Nov 2002 15:10:47 -0000 1.3 --- TestScores.java 22 Nov 2002 21:22:09 -0000 1.4 *************** *** 22,71 **** import org.custommonkey.xmlunit.XMLTestCase; import org.custommonkey.xmlunit.XMLUnit; ! /** ! * File <code>TestScores.java</code> is automaticaly generated by ! * 'unittestsgen' application. Code generator is created for java ! * sources and for 'junit' package by "Artur Hefczyc" ! * <ko...@us...><br/> ! * You should fulfil test methods with proper code for testing ! * purpose. All methods where you should put your code are below and ! * their names starts with 'test'.<br/> ! * You can run unit tests in many ways, however prefered are: ! * <ul> ! * <li> Run tests for one class only, for example for this class ! * you can run tests with command: <pre> ! * java -cp "jar/thisjarfile.jar;lib/junit.jar" org.fanfoot.scoring.TestScores ! * </pre> </li> ! * <li> Run tests for all classes in one command call. Code ! * generator creates also <code>TestAll.class</code> which runs all ! * available tests: <pre> ! * java -cp "jar/thisjarfile.jar;lib/junit.jar" TestAll ! * </pre> </li> ! * <li> But the most prefered way is to run all tests from <em>Ant ! * </em> just after compilation process finished.<br/> ! * To do it. You need: ! * <ol> ! * <li> Ant package from <a href="http://jakarta.apache.org/">Ant ! * </a> </li> ! * <li> JUnit package from <a href="http://www.junit.org/">JUnit ! * </a> </li> ! * <li> Put some code in your <code>build.xml</code> file to tell ! * Ant how to test your package. Sample code for Ant's <code>build.xml</code> ! * you can find in created file: <code>sample-junit-build.xml</code> ! * . And remember to have <code>junit.jar</code> in CLASSPATH <b> ! * before</b> you run Ant. To generate reports by ant you must ! * have <code>xalan.jar</code> in your <code>ANT_HOME/lib/</code> ! * directory. </li> ! * </ol> ! * </li> ! * </ul> ! * ! * ! *@author rgardler ! *@created 09 November 2002 */ public class TestScores extends XMLTestCase { /** Instance of tested class. */ protected Scores varScores; ! String BBCTestScoringConfigURL = "file:///home/rgardler/projects/fanfoot/src/testcases/resources/conf/BBCTestScoringConfig.xsl"; java.util.logging.Logger logger = java.util.logging.Logger.getLogger( "org.fanfoot.scoring" ); --- 22,36 ---- import org.custommonkey.xmlunit.XMLTestCase; import org.custommonkey.xmlunit.XMLUnit; ! /* ! * @author rgardler ! * @created 09 November 2002 */ public class TestScores extends XMLTestCase { /** Instance of tested class. */ protected Scores varScores; ! String testScoringConfigURL = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/ScoringConfig.xsl?rev=HEAD"; ! String testEventsURL = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/test/resources/testHTML/testEvents.html?rev=HEAD&content-type=text/html"; ! String testEventsType = "BBC Text Commentary"; ! String testEventsConfigURL = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/footballEvents.xml?rev=HEAD&content-type=text/xml"; java.util.logging.Logger logger = java.util.logging.Logger.getLogger( "org.fanfoot.scoring" ); *************** *** 90,101 **** protected void setUp() { XMLUnit.setIgnoreWhitespace( true ); ! ! Events evts = new Events(); ! Event evt = new Event( "test1" ); ! evt.putPart( "part1", "value1" ); ! evts.add( evt ); ScoringConfiguration sc = new ScoringConfiguration( ! BBCTestScoringConfigURL ); try { --- 55,73 ---- protected void setUp() { XMLUnit.setIgnoreWhitespace( true ); ! EventParser ep = null; ! Events evts = null; ! try { ! ep = new EventParser( testEventsConfigURL ); ! } catch ( Exception e ) { ! fail( "Unable to create Event Parser: " + e.getMessage() ); ! } ! try { ! evts = ep.parse( testEventsURL, testEventsType ); ! } catch ( Exception e ) { ! fail( "Unable to parse events: " + e.getMessage() ); ! } ScoringConfiguration sc = new ScoringConfiguration( ! testScoringConfigURL ); try { *************** *** 108,144 **** /** - * for classes which doesn't contain any methods here is one - * additional method for performing test on such classes. - */ - public void testNoMethods() { - } - - - /** - * Method for testing how works original method: - * org.w3c.dom.Document calculate() from tested class - */ - public void testCalculate() { - }// end of testCalculate() - - - /** - * Method for testing how works original method: - * org.fanfoot.scoring.ScoringConfiguration getConfiguration() from - * tested class - */ - public void testGetConfiguration() { - }// end of testGetConfiguration() - - - /** - * Method for testing how works original method: - * org.fanfoot.scoring.Events getEvents() from tested class - */ - public void testGetEvents() { - }// end of testGetEvents() - - - /** * Method for testing how works original method: * org.w3c.dom.Document getScoresDocument() from tested class --- 80,83 ---- *************** *** 147,181 **** org.w3c.dom.Document doc = varScores.getScoresDocument(); try { ! logger.finest( "Scores XML is " + org.saafe.utils.XMLUtils.xmlToString( doc ) ); } catch ( Exception e ) { ! logger.warning( "Unable to convert scores doc to a string (for logging purposes): " + e ); // do nothing as this is nothing to do with the tests } } - - /** - * Method for testing how works original method: void - * setConfiguration(org.fanfoot.scoring.ScoringConfiguration) from - * tested class - */ - public void testSetConfiguration1814716963() { - }// end of testSetConfiguration1814716963(org.fanfoot.scoring.ScoringConfiguration) - - - /** - * Method for testing how works original method: void - * setEvents(org.fanfoot.scoring.Events) from tested class - */ - public void testSetEvents713640177() { - }// end of testSetEvents713640177(org.fanfoot.scoring.Events) - - - /** - * Method for testing how works original method: void - * setScoresDocument(org.w3c.dom.Document) from tested class - */ - public void testSetScoresDocument9554056() { - }// end of TestScores(String name) --- 86,98 ---- org.w3c.dom.Document doc = varScores.getScoresDocument(); try { ! logger.info( "Scores XML is " + org.saafe.utils.XMLUtils.xmlToString( doc ) ); ! assertNotNull( "Should have a scores document", doc ); ! assertEquals( "Docuemnt root incorrect", "scores", doc.getDocumentElement().getTagName() ); } catch ( Exception e ) { ! logger.warning( "Unable to convert scores doc to a string: " + e ); // do nothing as this is nothing to do with the tests } } |
|
From: <rga...@us...> - 2002-11-22 21:19:49
|
Update of /cvsroot/csms/csms-core/src/test/resources/testHTML In directory sc8-pr-cvs1:/tmp/cvs-serv28173 Modified Files: testEvents.html Log Message: This file is driving me crazy!!!! Some of the HTML had got lost. Trying again Index: testEvents.html =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/resources/testHTML/testEvents.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testEvents.html 22 Nov 2002 21:12:13 -0000 1.1 --- testEvents.html 22 Nov 2002 21:19:46 -0000 1.2 *************** *** 78,81 **** --- 78,82 ---- + <body bgcolor="#ffffcc" text="#000000" link="#000066" alink="#000066" vlink="#000066"><map name="aroundukmap"><area shape="RECT" coords="7,18,96,30" href="http://news.bbc.co.uk/sport/hi/english/scotland/default.stm" alt="Scotland"><area shape="RECT" coords="7,30,96,42" href="http://news.bbc.co.uk/sport/hi/english/wales/default.stm" alt="Wales"><area shape="RECT" coords="7,44,96,58" href="http://news.bbc.co.uk/sport/hi/english/northern_ireland/default.stm" alt="Northern Ireland"></map> *************** *** 95,99 **** <td class="bbcpageShadow"><a name="top"><img src="Ars_Bla_26_Oct_2002_files/t.gif" width="600" height="2" alt=""></a></td> </tr> [...1992 lines suppressed...] + <td align="left" width="498"><a class="index" href="#top"><b class="footerarrow">^^ </b></a><a class="footer" href="#top"><b>Back to top</b></a></td> + + </tr> + <tr> + <td width="102"></td> + <td class="footer"><b><a class="index" href="http://news.bbc.co.uk/sport/default.stm">Front Page</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/football/default.stm">Football</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/cricket/default.stm">Cricket</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/rugby_union/default.stm">Rugby Union</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/rugby_league/default.stm">Rugby League</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/tennis/default.stm">Tennis</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/golf/default.stm">Golf</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/motorsport/default.stm">Motorsport</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/boxing/default.stm">Boxing</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/athletics/default.stm">Athletics</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/other_sports/default.stm">Other Sports</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/sports_talk/default.stm">Sports Talk</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/static/in_depth/default.stm"><br>In Depth</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/photo_galleries/default.stm">Photo Galleries</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/audiovideo/default.stm">Audio/Video</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/tv_and_radio/default.stm">TV & Radio</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/bbc_pundits/default.stm">BBC Pundits</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/static/tv_and_radio/question_of_sport/default.stm">Question of Sport</a> | <a class="index" href="http://news.bbc.co.uk/sport/hi/english/funny_old_game/default.stm">Funny Old Game</a></b> + <br> + <b><span style="color: rgb(204,204,204);">------------------------------------------------------------</span> + <br> + <a class="footer" href="http://news.bbc.co.uk/">BBC News >></a> | <a class="footer" href="http://www.bbc.co.uk/weather">BBC Weather >></a></b> + <br> + <span style="color: rgb(204,204,204);">----------------------------------------------------------------------------------</span><br><a class="footer" href="http://news.bbc.co.uk/sport/hi/english/static/help/copyright.stm"><span style="font-size: 10px;">© MMII</span></a> <font size="1">|</font> <a class="footer" href="http://news.bbc.co.uk/sport/hi/english/static/help/sources.stm"><span style="font-size: 10px;">News Sources</span></a> <font size="1">|</font> <a class="footer" href="http://www.bbc.co.uk/privacy/"><span style="font-size: 10px;">Privacy</span></a> + <br><br> + </td> + </tr> + </tbody></table> + + + </body></html> \ No newline at end of file |
|
From: <rga...@us...> - 2002-11-22 21:12:30
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv25897 Removed Files: testEvents.html Log Message: Moved test events file into the testHTML folder where it should be --- testEvents.html DELETED --- |
|
From: <rga...@us...> - 2002-11-22 21:12:16
|
Update of /cvsroot/csms/csms-core/src/test/resources/testHTML
In directory sc8-pr-cvs1:/tmp/cvs-serv25642
Added Files:
testEvents.html
Log Message:
Moved test events file into the testHTML folder where it should be
--- NEW FILE: testEvents.html ---
<html><head><!--SOLIndexTemplate-->
<meta name="robots" content="noindex">
<title>BBC SPORT | FOOTBALL | STATISTICS | TEAMS | ARSENAL STATISTICS LIVE TEXT COMMENTARY</title><meta http-equiv="expires" content="now">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Refresh" content="120;url=/sport/hi/english/static/football/statistics/teams/a/arsenal/live_hi.stm">
<meta name="keywords" content="BBC Sport world uk international foreign british online service">
<meta name="OriginalPublicationDate" content="2002/10/26 16:08:21">
<!-- NOLMaps-->
<script src="Ars_Bla_26_Oct_2002_files/sport.js" language="JavaScript"></script>
<link type="text/css" rel="stylesheet" href="Ars_Bla_26_Oct_2002_files/sport_002.css"><style>
/* left nav new */
.servicehead{
font-family : Verdana, Arial, Helvetica, sans-serif, "MS sans serif";
font-weight : bold;
padding-right:1px;
color : #FFFFFF;
font-size : 10px;
[...1681 lines suppressed...]
<br><br></td>
</tr>
<tr xmlns:xlink="http://www.w3.org/1999/xlink">
<td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td>
<td height="13"><b>20:06</b></td>
</tr>
<tr xmlns:xlink="http://www.w3.org/1999/xlink">
<td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td>
<td>
Foul by Garry Flitcroft (Blackburn) on . Edu (Arsenal). Free kick taken right-footed by . Edu (Arsenal) from left wing, passed.
<br><br></td>
</tr>
<tr xmlns:xlink="http://www.w3.org/1999/xlink">
<td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td>
<td height="13"><b>18:43</b></td>
</tr>
<tr xmlns:xlink="http://www.w3.org/1999/xlink">
<td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td>
|
|
From: <rga...@us...> - 2002-11-22 21:09:59
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv13439 Modified Files: testEvents.html Log Message: Made this test page a complete commentary. Additional examples can be inserted into this commentary (names should be shanged to reflect the actual teams in this commentray) Index: testEvents.html =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/resources/conf/testEvents.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testEvents.html 22 Nov 2002 20:31:36 -0000 1.2 --- testEvents.html 22 Nov 2002 20:38:38 -0000 1.3 *************** *** 1,11 **** ! <html> ! <head><title>BBC Test Events</title></head> ! <body> ! <p>This document contains a series of commentary snippets from BBC commentaries that ! are used by the test harnesses to ensure everything is working OK.</p> ! <p>78:17 Sent off ! Foul by Garry Flitcroft (Blackburn) on Fredrik Ljungberg ! (Arsenal). Garry Flitcroft (Blackburn) dismissed for second ! bookable offence.</p> ! </body> [...1635 lines suppressed...] ! <td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td> ! <td> Foul by Pascal Cygan (Arsenal) on Egil Ostenstad (Blackburn). Free kick ! crossed right-footed by David Thompson (Blackburn) from right channel, <br><br></td> ! ! </tr> ! <tr xmlns:xlink="http://www.w3.org/1999/xlink"> ! <td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td> ! <td height="13"><b>23:49</b></td> ! </tr> ! <tr xmlns:xlink="http://www.w3.org/1999/xlink"> ! <td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td> ! <td> Foul by Pascal Cygan (Arsenal) on Egil Ostenstad (Blackburn). Free kick ! crossed right-footed by David Thompson (Blackburn) from right channel, free ! kick taken right-footed by David Seaman (Arsenal) from own half, resulting ! in open play. <br><br></td> ! </tr> ! <tr xmlns:xlink="http://www.w3.org/1999/xlink"> ! <td><img src="Ars_Bla_26_Oct_2002_files/nothing_003.gif" width="1" height="1" border="0" alt=""></td> ! <td height="13"><b>23:27</b></td> ! |
|
From: <rga...@us...> - 2002-11-22 20:31:45
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv10946 Modified Files: testEvents.html Log Message: Corrrected bad HTML and added another couple of events Index: testEvents.html =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/resources/conf/testEvents.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testEvents.html 22 Nov 2002 20:16:40 -0000 1.1 --- testEvents.html 22 Nov 2002 20:31:36 -0000 1.2 *************** *** 1,4 **** <html> ! <head>BBC Test Events</head> <body> <p>This document contains a series of commentary snippets from BBC commentaries that --- 1,4 ---- <html> ! <head><title>BBC Test Events</title></head> <body> <p>This document contains a series of commentary snippets from BBC commentaries that |
|
From: <rga...@us...> - 2002-11-22 20:18:17
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv6198 Removed Files: BBCTestScoringConfig.xsl footballEvents.xml Log Message: Test harnesses now use live config files --- BBCTestScoringConfig.xsl DELETED --- --- footballEvents.xml DELETED --- |
|
From: <rga...@us...> - 2002-11-22 20:16:44
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv5332 Added Files: testEvents.html Log Message: Page of test events for use in the test harnesses. --- NEW FILE: testEvents.html --- <html> <head>BBC Test Events</head> <body> <p>This document contains a series of commentary snippets from BBC commentaries that are used by the test harnesses to ensure everything is working OK.</p> <p>78:17 Sent off Foul by Garry Flitcroft (Blackburn) on Fredrik Ljungberg (Arsenal). Garry Flitcroft (Blackburn) dismissed for second bookable offence.</p> </body> </html> |
|
From: <le...@us...> - 2002-11-22 16:25:15
|
Update of /cvsroot/csms/csms-core/src/resources/conf In directory sc8-pr-cvs1:/tmp/cvs-serv27961 Modified Files: players.xml Log Message: Added second name for Jimmy Hasselbaink (Jimmy Floyd) Index: players.xml =================================================================== RCS file: /cvsroot/csms/csms-core/src/resources/conf/players.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** players.xml 10 Nov 2002 18:03:21 -0000 1.6 --- players.xml 22 Nov 2002 16:25:11 -0000 1.7 *************** *** 5452,5455 **** --- 5452,5456 ---- <player id="941"> <firstName type="main">Jimmy</firstName> + <firstName type="other">Jimmy Floyd</firstName> <firstName type="initial">J.</firstName> <surname>Hasselbaink</surname> |
|
From: <rga...@us...> - 2002-11-21 23:15:20
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring
In directory sc8-pr-cvs1:/tmp/cvs-serv6862
Modified Files:
Events.java
Log Message:
Added iterator method to retrive an iterator over all the events
Index: Events.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring/Events.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Events.java 10 Nov 2002 15:12:53 -0000 1.4
--- Events.java 21 Nov 2002 23:15:17 -0000 1.5
***************
*** 106,109 ****
--- 106,119 ----
/**
+ * Get an iterator over all the events.
+ *
+ *@return an iterator over all events
+ */
+ public Iterator iterator() {
+ return this.events.iterator();
+ }
+
+
+ /**
* Get the event at the given index
*
|
|
From: <rga...@us...> - 2002-11-21 22:21:51
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/db
In directory sc8-pr-cvs1:/tmp/cvs-serv23507
Modified Files:
DB.java
Log Message:
Added warning if unable to close a connection
Index: DB.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/db/DB.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DB.java 21 Nov 2002 21:59:38 -0000 1.1
--- DB.java 21 Nov 2002 22:21:48 -0000 1.2
***************
*** 98,102 ****
col.close();
} catch ( XMLDBException xde ) {
! // FIXME handle this error, it is not critical but will be a memeory leak
}
}
--- 98,103 ----
col.close();
} catch ( XMLDBException xde ) {
! // FIXME handle this error, it is not critical but will be a memory leak
! logger.log( Level.WARNING, "Unable to close connection", xde );
}
}
***************
*** 130,134 ****
* indicated.
*
! *@param strID the id of the resource (if null an ID will be generated)
*@param strResource the resource to add
*@param strCollection the collection to add it to
--- 131,136 ----
* indicated.
*
! *@param strID the id of the resource (if null an ID will be
! * generated)
*@param strResource the resource to add
*@param strCollection the collection to add it to
|
|
From: <rga...@us...> - 2002-11-21 22:15:45
|
Update of /cvsroot/csms/csms-core
In directory sc8-pr-cvs1:/tmp/cvs-serv21843
Modified Files:
status.xml
Log Message:
Added action for Xindice
Index: status.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/status.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** status.xml 6 Nov 2002 14:20:32 -0000 1.11
--- status.xml 21 Nov 2002 22:15:42 -0000 1.12
***************
*** 55,59 ****
</release>
! <release version="0.1.1alpha1" date="29 October 2002">
<description>Scrapes BBC textual commentaries of Barclaycard Premiership
games and generates scores accordingly. How the events are scraped and
--- 55,59 ----
</release>
! <release version="0.2.0" date="Not release yet">
<description>Scrapes BBC textual commentaries of Barclaycard Premiership
games and generates scores accordingly. How the events are scraped and
***************
*** 61,66 ****
--- 61,70 ----
files.</description>
+ <action dev="rdg" type="add">Added Xindices database to distribution
+ for the storage of module specific data</action>
+
<action dev="rdg" type="add">Added ability to override preferences so
that config files are stored locally rather than remotely.</action>
+
<action dev="rdg" type="add">Addition of CSMS skin for the community web
|
|
From: <rga...@us...> - 2002-11-21 21:59:41
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/db In directory sc8-pr-cvs1:/tmp/cvs-serv16165 Modified Files: Players.java Added Files: DB.java ID.java Log Message: Now connects to a database via XML:DB --- NEW FILE: DB.java --- /* * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Community Sports Management System. * * The Initial Developer of the Original Code is * We know What you Want.net * * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Ross Gardler <ross [at] saafe.org> * Mike Lever <mikel [at] fanfoot.com> * Stuart Gardler <stuart [at] wkwyw.net> * * ***** END LICENSE BLOCK ***** */ /* * Event.java * * Created on 20 September 2002, 21:59 */ package org.fanfoot.db; import java.util.logging.Level; import java.util.logging.Logger; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; import org.xmldb.api.base.ResourceSet; import org.xmldb.api.base.XMLDBException; import org.xmldb.api.modules.XMLResource; import org.xmldb.api.modules.XPathQueryService; /** * Provides utility methods for accessing the DB * *@author rgardler *@created 19 November 2002 */ public class DB { /** The name of the class to use as the database driver */ private String driver = "org.apache.xindice.client.xmldb.DatabaseImpl"; /** The URI of the database to use */ private String dbURI; /** Where to write log info */ final static Logger logger = Logger.getLogger( "org.fanfoot.db" ); /** * Create a DB objet to connect to the indicated DB * *@param dbURI the URI of the DB to connect to *@exception DBException Description of the Exception */ public DB( String dbURI ) throws DBException { this.dbURI = dbURI; initDatabaseDriver(); } /** * Query the indicated collection with the XPath query supplied. * *@param strQuery XPath query to run *@param strCollection Description of the Parameter *@return *@throws DBException if unable to query the database */ public ResourceSet runXPathQuery( String strCollection, String strQuery ) throws DBException { Collection col = getCollection( strCollection ); XPathQueryService service; ResourceSet resultSet; try { service = (XPathQueryService) col.getService( "XPathQueryService", "1.0" ); } catch ( XMLDBException xde ) { throw new DBException( "Unable to get XPathQueryService", xde ); } try { resultSet = service.query( strQuery ); } catch ( XMLDBException xde ) { throw new DBException( "Unable to execute XPath Query", xde ); } finally { if ( col != null ) { try { col.close(); } catch ( XMLDBException xde ) { // FIXME handle this error, it is not critical but will be a memeory leak } } } return resultSet; } /** * Get the collection named from the DB in use * *@param strCollectionName Description of the Parameter *@return The collection value *@throws DBException if unable the get the collection */ public Collection getCollection( String strCollectionName ) throws DBException { Collection col; try { col = DatabaseManager.getCollection( dbURI + strCollectionName ); } catch ( XMLDBException xde ) { throw new DBException( "Unable to get the collection " + strCollectionName, xde ); } return col; } /** * Add the supplied string as a resource to the collection * indicated. * *@param strID the id of the resource (if null an ID will be generated) *@param strResource the resource to add *@param strCollection the collection to add it to *@throws DBException if any problem occurs connecting to the DB */ public void addResource( String strID, String strResource, String strCollection ) throws DBException { Collection col = getCollection( strCollection ); try { XMLResource document = (XMLResource) col.createResource( strID, "XMLResource" ); document.setContent( strResource ); col.storeResource( document ); } catch ( XMLDBException xdbe ) { logger.severe( "Cannot add resource " + strResource + " to " + strCollection ); throw new DBException( "Cannot add resource to " + strCollection, xdbe ); } } /** * Initialise the database manager * *@exception DBException Description of the Exception */ private void initDatabaseDriver() throws DBException { try { Class c = Class.forName( driver ); Database database = (Database) c.newInstance(); DatabaseManager.registerDatabase( database ); } catch ( ClassNotFoundException cnfe ) { throw new DBException( "Unable to load driver for database", cnfe ); } catch ( IllegalAccessException ia ) { throw new DBException( "Unable to create driver object for the database", ia ); } catch ( InstantiationException ie ) { throw new DBException( "Unable to create driver object for the database", ie ); } catch ( XMLDBException xde ) { throw new DBException( "Unable to register the database", xde ); } } } --- NEW FILE: ID.java --- /* * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Community Sports Management System. * * The Initial Developer of the Original Code is * We know What you Want.net * * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Ross Gardler <ross [at] saafe.org> * Mike Lever <mikel [at] fanfoot.com> * Stuart Gardler <stuart [at] wkwyw.net> * * ***** END LICENSE BLOCK ***** */ /* * Event.java * * Created on 20 September 2002, 21:59 */ package org.fanfoot.db; import java.util.logging.Level; import java.util.logging.Logger; /** * Provides utility methods for generating ID's for database entries. * *@author rgardler *@created 21 November 2002 */ public class ID { /** ID number of next player to be created */ // FIXME: this number needs to be saved between invocations of the application private static int intPlayerID = 100; /** * Create an ID number for a player in the indicated postion * *@return an ID which consists of the position code followed by a * unique number for that position *@throws DBException if the position is not recognised */ public static String getPlayerID() throws DBException { String strID = new Integer( intPlayerID ).toString(); intPlayerID = intPlayerID + 1; return strID; } } Index: Players.java =================================================================== RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/db/Players.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Players.java 10 Nov 2002 15:00:16 -0000 1.1 --- Players.java 21 Nov 2002 21:59:37 -0000 1.2 *************** *** 35,42 **** --- 35,47 ---- */ package org.fanfoot.db; + import java.util.logging.Level; + import java.util.logging.Logger; import org.saafe.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; + import org.xmldb.api.base.ResourceSet; + import org.xmldb.api.base.XMLDBException; + import org.xmldb.api.modules.XMLResource; /** * Provides access to the player information in the database. *************** *** 46,77 **** */ public class Players { ! // FIXME: the location of the players database should be set in the properties ! String strDBFilePath = "file://localhost/home/rgardler/projects/csms/csms-core/src/resources/conf/players.xml"; ! ! Document thePlayers; /** ! * Create a players object to connect to the default playres ! * database * *@exception DBException Description of the Exception */ public Players() throws DBException { ! try { ! thePlayers = XMLUtils.parseXML( strDBFilePath ); ! } catch ( javax.xml.parsers.ParserConfigurationException pce ) { ! String strMessage = "Unable to Create Parser to parse in players DB"; ! throw new DBException( strMessage, pce ); ! } catch ( org.w3c.dom.DOMException de ) { ! String strMessage = "DOMException when parsing the players DB"; ! throw new DBException( strMessage, de ); ! } catch ( org.xml.sax.SAXException se ) { ! String strMessage = "SAXException when parsing the players DB"; ! throw new DBException( strMessage, se ); ! } catch ( java.io.IOException ioe ) { ! String strMessage = "Unable to read the players DB file"; ! throw new DBException( strMessage, ioe ); ! } } --- 51,100 ---- */ public class Players { ! /** The URI of the database to use */ ! String strDBURI; ! /** The DB access object */ ! DB db; ! /** Where to write log info */ ! final Logger logger = Logger.getLogger( "org.fanfoot.db" ); ! /** ! * The name of the collection in the database that stores the ! * players data ! */ ! public static String COLLECTION_NAME = "player"; ! /** The goalkeeper playing position */ ! public static String POSITION_GOALKEEPER = "Goalkeeper"; ! /** The goalkeeper playing position */ ! public static String POSITION_CENTREBACK = "Centre Back"; ! /** The goalkeeper playing position */ ! public static String POSITION_FULLBACK = "Full Back"; ! /** The goalkeeper playing position */ ! public static String POSITION_MIDFIELD = "Midfield"; ! /** The goalkeeper playing position */ ! public static String POSITION_FORWARD = "Forward"; /** ! * Create a players object to connect to the default players ! * database and default collection * *@exception DBException Description of the Exception */ public Players() throws DBException { ! // FIXME: the location of the players database should be set in the properties ! new Players( "xmldb:xindice-embed:///db" ); ! } ! ! ! /** ! * Create a players object to connect to the indicated players ! * database with the default colelction ! * ! *@param uri the uri of the DB to use ! *@exception DBException Description of the Exception ! */ ! public Players( String uri ) throws DBException { ! super(); ! strDBURI = uri; ! db = new DB( strDBURI ); } *************** *** 81,104 **** * *@param id the ID of the plaer required ! *@return an element representing the players record ! *@throws DBException if the player cannot be found */ public Element getPlayer( String id ) throws DBException { ! Element root = thePlayers.getDocumentElement(); ! NodeList ndl = root.getElementsByTagName( "player" ); ! Element elem = null; ! for ( int i = 0; i < ndl.getLength(); i++ ) { ! elem = (Element) ndl.item( i ); ! if ( elem.getAttribute( "id" ).equals( id ) ) { ! break; } else { ! elem = null; } } ! if ( elem == null ) { ! throw new DBException( DBException.UNRECOGNISED_ID_MESSAGE + id ); ! } ! return elem; } --- 104,134 ---- * *@param id the ID of the plaer required ! *@return an Element representing the players record, null if there ! * is none ! *@throws DBException if there is more than one player with the ! * supplied ID or is the resource cannot be parsed for any ! * reason. */ public Element getPlayer( String id ) throws DBException { ! Document result = null; ! String strXPath = "//player[@id='" + id + "']"; ! XMLResource res = null; ! ResourceSet rs = db.runXPathQuery( COLLECTION_NAME, strXPath ); ! try { ! if ( rs.getSize() > 1 ) { ! logger.info( "There are " + rs.getSize() + " players with ID=" + id ); ! throw new DBException( "There appears to be more than one player with the ID " + id ); ! } else if ( rs.getSize() == 1 ) { ! res = (XMLResource) rs.getResource( 0 ); ! logger.info( "Got resource: " + (String) res.getContent() ); ! result = (Document) res.getContentAsDOM(); } else { ! return null; } + } catch ( XMLDBException xde ) { + throw new DBException( "Error manipulating the resource set", xde ); } ! return result.getDocumentElement(); } *************** *** 110,114 **** *@param playerID the ID of the player *@param gameID the ID of the game ! *@return the element representing the scoring events from the * indicated game. Returns null if no events for that game are * recorded --- 140,144 ---- *@param playerID the ID of the player *@param gameID the ID of the game ! *@return the Element representing the scoring events from the * indicated game. Returns null if no events for that game are * recorded *************** *** 132,135 **** --- 162,206 ---- return elem; } + + + /** + * Add the supplied player to the database. No checks for + * duplicates are done. + * + *@param firstName is the first name of the player + *@param surname is the surname of the player + *@param registeredTeam is the team the player with + *@param team is the team the player is currently playing for + *@param position is the players normal position + *@exception DBException Description of the Exception + */ + public void addPlayer( String firstName, + String surname, String registeredTeam, + String team, String position ) + throws DBException { + String strID = ID.getPlayerID(); + logger.info( "Adding player with ID = " + strID ); + StringBuffer sb = new StringBuffer(); + sb.append( "<player id='" ); + sb.append( strID ); + sb.append( "'><firstName>" ); + sb.append( firstName ); + sb.append( "</firstName>" ); + sb.append( "<surname>" ); + sb.append( surname ); + sb.append( "</surname>" ); + sb.append( "<registeredTeam>" ); + sb.append( registeredTeam ); + sb.append( "</registeredTeam>" ); + sb.append( "<team>" ); + sb.append( team ); + sb.append( "</team>" ); + sb.append( "<position>" ); + sb.append( position ); + sb.append( "</position>" ); + sb.append( "</player>" ); + db.addResource( strID, sb.toString(), COLLECTION_NAME ); + } + } |
|
From: <rga...@us...> - 2002-11-21 21:58:40
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/db
In directory sc8-pr-cvs1:/tmp/cvs-serv15946
Modified Files:
TestPlayers.java
Log Message:
Changed to test use of new database classes
Index: TestPlayers.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/db/TestPlayers.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestPlayers.java 10 Nov 2002 15:00:28 -0000 1.1
--- TestPlayers.java 21 Nov 2002 21:58:37 -0000 1.2
***************
*** 9,12 ****
--- 9,13 ----
import org.custommonkey.xmlunit.XMLTestCase;
import org.custommonkey.xmlunit.XMLUnit;
+ import org.fanfoot.Data4Tests;
import org.w3c.dom.Node;
***************
*** 21,26 ****
/** A non valid player ID */
protected String invalidPlayerID = "Not a valid plaer ID";
- /** A valid player ID */
- protected String validPlayerID = "100";
/** A non valid game ID */
protected String invalidGameID = "Not a valid game ID";
--- 22,25 ----
***************
*** 49,53 ****
XMLUnit.setIgnoreWhitespace( true );
try {
! varPlayers = new org.fanfoot.db.Players();
} catch ( DBException dbe ) {
dbe.printStackTrace();
--- 48,54 ----
XMLUnit.setIgnoreWhitespace( true );
try {
! Data4Tests data = new Data4Tests();
! data.createPlayerCollection();
! varPlayers = new org.fanfoot.db.Players( Data4Tests.DB_URI );
} catch ( DBException dbe ) {
dbe.printStackTrace();
***************
*** 57,109 ****
! /**
! * Method for testing how works original method:
! * org.w3c.dom.Element getPlayer(int) from tested class
! */
! public void testGetPlayer() {
Node player = null;
try {
player = varPlayers.getPlayer( invalidPlayerID );
} catch ( DBException dbe ) {
! String strMessage = DBException.UNRECOGNISED_ID_MESSAGE + invalidPlayerID;
! assertEquals( "Should have thrown '" + strMessage + "' exception",
! strMessage, dbe.getMessage() );
! }
! try {
! player = varPlayers.getPlayer( validPlayerID );
! } catch ( DBException dbe ) {
! fail( "Threw exception getting valid player: " + dbe.getMessage() );
}
- assertNotNull( "We should have a player with the id 100", player );
}
-
- public void testGetPlayerStats() {
- Node playerEvents = null;
- try {
- playerEvents = varPlayers.getPlayerScoringEvents( invalidPlayerID, invalidGameID );
- } catch ( DBException dbe ) {
- String strMessage = DBException.UNRECOGNISED_ID_MESSAGE + invalidPlayerID;
- assertEquals( "Should have thrown '" + strMessage + "' exception",
- strMessage, dbe.getMessage() );
- }
- assertNull( "Should not have any Scoring events", playerEvents );
-
- try {
- playerEvents = varPlayers.getPlayerScoringEvents( validPlayerID, invalidGameID );
- } catch ( DBException dbe ) {
- dbe.printStackTrace();
- fail( "Should not have thrown DBException" );
- }
- assertNull( "Should not have any Scoring events", playerEvents );
-
- try {
- playerEvents = varPlayers.getPlayerScoringEvents( validPlayerID, validGameID );
- } catch ( DBException dbe ) {
- dbe.printStackTrace();
- fail( "Should not have thrown DBException." );
- }
- assertNotNull( "Should have Scoring events", playerEvents );
- }
--- 58,82 ----
!
! public void testAddAndGetPlayer() {
Node player = null;
+ String strID1 = "100";
+ String strID2 = "101";
try {
player = varPlayers.getPlayer( invalidPlayerID );
+ assertNull( "Should not have a player with ID " + invalidPlayerID, player );
+ varPlayers.addPlayer( "firstname", "surname", "regTeam", "team", "Goalkeeper" );
+ player = varPlayers.getPlayer( strID1 );
+ assertNotNull( "Should have a player with ID " + strID1, player );
+ varPlayers.addPlayer( "firstname", "surname", "regTeam", "team", "Goalkeeper" );
+ player = varPlayers.getPlayer( strID1 );
+ assertNotNull( "Should have a player with ID " + strID1, player );
+ player = varPlayers.getPlayer( strID2 );
+ assertNotNull( "Should have a player with ID " + strID2, player );
} catch ( DBException dbe ) {
! fail( "Threw exception adding a player: " + dbe.getMessage() );
}
}
|
|
From: <rga...@us...> - 2002-11-21 21:57:05
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot In directory sc8-pr-cvs1:/tmp/cvs-serv15493 Added Files: Data4Tests.java Log Message: Utioity class to create a test DB for Unit Tests --- NEW FILE: Data4Tests.java --- /* * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Community Sports Management System. * * The Initial Developer of the Original Code is * We know What you Want.net * * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Ross Gardler <ross [at] saafe.org> * Mike Lever <mikel [at] fanfoot.com> * Stuart Gardler <stuart [at] wkwyw.net> * * ***** END LICENSE BLOCK ***** */ /* * Data4Tests.java * * Created on 20 September 2002, 21:59 */ package org.fanfoot; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.xindice.client.xmldb.services.CollectionManager; import org.apache.xindice.util.XindiceException; import org.apache.xindice.xml.dom.DOMParser; import org.fanfoot.db.DBException; import org.fanfoot.db.Players; import org.fanfoot.db.Players; import org.saafe.utils.XMLUtils; import org.w3c.dom.Document; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; import org.xmldb.api.base.Resource; import org.xmldb.api.base.ResourceIterator; import org.xmldb.api.base.ResourceSet; import org.xmldb.api.base.XMLDBException; import org.xmldb.api.modules.XMLResource; import org.xmldb.api.modules.XPathQueryService; /** * Creates test data in a standalone database against which the * application test harnesses can be run. * *@author rgardler *@created 19 November 2002 */ public class Data4Tests { /** Players DB */ Players players; /** URI of the DB */ public static String DB_URI = "xmldb:xindice-embed:///db//"; /** Where to write log info */ final static Logger logger = Logger.getLogger( "org.fanfoot.db" ); public Data4Tests() throws DBException { super(); players = new Players( DB_URI ); } /** * Create the player collecton in the database. All previous data * will be removed. * *@exception DBException Description of the Exception */ public void createPlayerCollection() throws DBException { deletePlayerCollection(); Collection col = null; try { String driver = "org.apache.xindice.client.xmldb.DatabaseImpl"; Database database = null; try { Class c = Class.forName( driver ); database = (Database) c.newInstance(); } catch ( ClassNotFoundException cnfe ) { throw new DBException( "Cannot find class to connect to DB", cnfe ); } catch ( InstantiationException ie ) { throw new DBException( "Cannot instantiate class to connect to DB", ie ); } catch ( IllegalAccessException iae ) { throw new DBException( "Cannot access class to connect to DB", iae ); } DatabaseManager.registerDatabase( database ); col = DatabaseManager.getCollection( DB_URI ); if ( col == null ) { throw new DBException( "Cannot find the DB collection" ); } String strColName = Players.COLLECTION_NAME; CollectionManager service = (CollectionManager) col.getService( "CollectionManager", "1.0" ); String strColConf = "<collection compressed=\"true\" " + "name=\"" + strColName + "\">" + " <filer class=\"org.apache.xindice.core.filer.BTreeFiler\"" + " gzip=\"true\"/>" + "</collection>"; service.createCollection( strColName, DOMParser.toDocument( strColConf ) ); } catch ( XMLDBException e ) { throw new DBException( "XML:DB Exception occured " + e.errorCode, e ); } catch ( XindiceException xe ) { throw new DBException( "Xindice Exception occured", xe ); } finally { if ( col != null ) { try { col.close(); } catch ( XMLDBException e ) { throw new DBException( "XML:DB Exception occured " + e.errorCode, e ); } } } } /** * Delete the player collection data in the database. * *@exception DBException Description of the Exception */ public void deletePlayerCollection() throws DBException { Collection col = null; Database database = null; try { String driver = "org.apache.xindice.client.xmldb.DatabaseImpl"; try { Class c = Class.forName( driver ); database = (Database) c.newInstance(); } catch ( ClassNotFoundException cnfe ) { throw new DBException( "Cannot find class to connect to DB", cnfe ); } catch ( InstantiationException ie ) { throw new DBException( "Cannot instantiate class to connect to DB", ie ); } catch ( IllegalAccessException iae ) { throw new DBException( "Cannot access class to connect to DB", iae ); } DatabaseManager.registerDatabase( database ); col = DatabaseManager.getCollection( DB_URI ); if ( col == null ) { throw new DBException( "Cannot find the db collection" ); } CollectionManager service = (CollectionManager) col.getService( "CollectionManager", "1.0" ); service.dropCollection( Players.COLLECTION_NAME ); } catch ( XMLDBException e ) { if ( e.errorCode == 201 ) { // collection doesn;t exist to delete } else { throw new DBException( "XML:DB Exception occured " + e.errorCode, e ); } } finally { if ( col != null ) { try { col.close(); } catch ( XMLDBException e ) { throw new DBException( "XML:DB Exception occured " + e.errorCode, e ); } } } } private static String getPlayer100() { return "<player id=\"100\">" + "<firstName type=\"main\">David</firstName>" + "<firstName type=\"initial\">D.</firstName>" + "<surname>Seaman</surname>" + "<registeredTeam>ARS</registeredTeam>" + "<team>ARS</team>" + "<position>Goalkeeper</position>" + "<cost>4.0</cost>" + "<scoringEvents>" + "<game id=\"_Saturday, 9 November, 2002_Barclaycard Premiership_Arsenal_Newcastle United\">" + "<event>" + "<points>1</points>" + "<type>Appearance</type>" + "</event>" + "<event>" + "<points>4</points>" + "<type>Goalkeeper Clean Sheet</type>" + "</event>" + "</game>" + "</scoringEvents>" + "</player>"; } } |
|
From: <rga...@us...> - 2002-11-21 21:56:23
|
Update of /cvsroot/csms/csms-core
In directory sc8-pr-cvs1:/tmp/cvs-serv15313
Modified Files:
module.xml
Log Message:
Added dependencies on xindice jars
Index: module.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/module.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** module.xml 31 Oct 2002 18:00:05 -0000 1.7
--- module.xml 21 Nov 2002 21:56:19 -0000 1.8
***************
*** 75,78 ****
--- 75,83 ----
<depend project="xercesImpl" version="supplied" export="true"/>
<depend project="xalan" version="supplied" export="true"/>
+ <depend project="xindice" version="supplied" export="true"/>
+ <depend project="xmldb" version="supplied" export="true"/>
+ <depend project="xmlrpc" version="supplied" export="true"/>
+ <depend project="commons-logging" version="supplied" export="true"/>
+
<depend project="junit" version="supplied" export="false"/>
|
|
From: <rga...@us...> - 2002-11-21 21:22:20
|
Update of /cvsroot/csms/csms-core In directory sc8-pr-cvs1:/tmp/cvs-serv4100 Modified Files: .cvsignore Log Message: Xindices database libraries Index: .cvsignore =================================================================== RCS file: /cvsroot/csms/csms-core/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 6 Nov 2002 20:44:47 -0000 1.3 --- .cvsignore 21 Nov 2002 21:22:16 -0000 1.4 *************** *** 4,5 **** --- 4,6 ---- .nbattrs vfs_cache + db |
|
From: <rga...@us...> - 2002-11-21 21:22:08
|
Update of /cvsroot/csms/csms-core/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3012 Added Files: xindice-1.1b.jar xmldb-api-20021026.jar xmlrpc-1.1.jar commons-logging-1.0.1.jar Log Message: Xindices database libraries --- NEW FILE: xindice-1.1b.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xmldb-api-20021026.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xmlrpc-1.1.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: commons-logging-1.0.1.jar --- (This appears to be a binary file; contents omitted.) |
|
From: <rga...@us...> - 2002-11-21 21:19:14
|
Update of /cvsroot/csms/csms-core/legal In directory sc8-pr-cvs1:/tmp/cvs-serv2826 Added Files: xml-apis.LICENSE xindice-license xmlrpc.LICENSE commons-logging.LICENSE Log Message: Xindices database libraries --- NEW FILE: xml-apis.LICENSE --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ --- NEW FILE: xindice-license --- /* * The Apache Software License, Version 1.1 * * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Xindice" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation and was * originally based on software copyright (c) 1999-2001, The dbXML * Group, L.L.C., http://www.dbxmlgroup.com. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ --- NEW FILE: xmlrpc.LICENSE --- /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "XML-RPC" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ --- NEW FILE: commons-logging.LICENSE --- /* * $Header: /cvsroot/csms/csms-core/legal/commons-logging.LICENSE,v 1.1 2002/11/21 21:19:11 rgardler Exp $ * $Revision: 1.1 $ * $Date: 2002/11/21 21:19:11 $ * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Commons", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ |
|
From: <rga...@us...> - 2002-11-20 13:02:46
|
Update of /cvsroot/csms/csms-core/src/documentation/images In directory sc8-pr-cvs1:/tmp/cvs-serv31579 Modified Files: group-logo.gif project-logo.gif Log Message: Pretty naf logo-s but its a start (source http://www.jach.hawaii.edu/JAClocal/images/clipart/Sports/index2.html) Index: group-logo.gif =================================================================== RCS file: /cvsroot/csms/csms-core/src/documentation/images/group-logo.gif,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsAHkO1d and /tmp/cvsqCWzVh differ Index: project-logo.gif =================================================================== RCS file: /cvsroot/csms/csms-core/src/documentation/images/project-logo.gif,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsBe6Ztf and /tmp/cvsStioRk differ |
|
From: <rga...@us...> - 2002-11-20 12:18:09
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv13220
Modified Files:
ControlCentre.java
Log Message:
Added info message at start up
Index: ControlCentre.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/gui/ControlCentre.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ControlCentre.java 6 Nov 2002 20:11:46 -0000 1.13
--- ControlCentre.java 20 Nov 2002 12:18:06 -0000 1.14
***************
*** 72,117 ****
/**
! *@author rgardler
! *@created 21 October 2002
*/
public class ControlCentre extends JFrame implements EventParserListener {
! /** the default site from which to retireve commentaries */
String strCommentaryPath = "http://news.bbc.co.uk"
! + "/sport/hi/english/static/football/statistics/teams/";
[...1281 lines suppressed...]
}
--- 783,800 ----
* Loaded Commentay file.
*
! *@param e Description of the Parameter
*/
! public void retrievedCommentary(EventObject e) {
}
/**
! *@param args the command line arguments
*/
! public static void main(String args[]) {
try {
new ControlCentre().show();
! } catch (Exception e) {
! System.out.println("Unable to load configuration file.");
e.printStackTrace();
}
|
|
From: <rga...@us...> - 2002-11-19 20:58:02
|
Update of /cvsroot/csms/csms-core
In directory sc8-pr-cvs1:/tmp/cvs-serv20712
Modified Files:
centibuild.xml
Log Message:
Import java cent, which is now a separate cent in centipede
Index: centibuild.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/centibuild.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** centibuild.xml 19 Nov 2002 20:44:30 -0000 1.10
--- centibuild.xml 19 Nov 2002 20:57:57 -0000 1.11
***************
*** 23,26 ****
--- 23,27 ----
<importcent name="antidote" />
+ <importcent name="java"/>
<importcent name="checkstyle" />
|
|
From: <rga...@us...> - 2002-11-19 20:44:34
|
Update of /cvsroot/csms/csms-core
In directory sc8-pr-cvs1:/tmp/cvs-serv14428
Modified Files:
centibuild.xml
Log Message:
Removing import of Centipded cent, this is no longer necessary with the latest version of Centipede
Index: centibuild.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/centibuild.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** centibuild.xml 28 Oct 2002 00:23:15 -0000 1.9
--- centibuild.xml 19 Nov 2002 20:44:30 -0000 1.10
***************
*** 1,9 ****
<?xml version="1.0"?>
<project default="interactive" basedir="." name="project build file">
! <description>* ===================================== * | Krysalis Centipede
! Build System | * ===================================== * by Nicola Ken
! Barozzi (nic...@ap...) Marc Johnson (mjo...@ap...) For a
! simple interactive build, simply run the build script (build.bar or
! build.sh)</description>
<!-- =================================================================== -->
--- 1,6 ----
<?xml version="1.0"?>
<project default="interactive" basedir="." name="project build file">
! <description>Community Sports Management System build system. Type cent for
! and interactive build menu.</description>
<!-- =================================================================== -->
***************
*** 24,29 ****
<taskdef file="${ant.home}/src/core/tasks.properties" />
-
- <importcent name="centipede" />
<importcent name="antidote" />
--- 21,24 ----
|