|
From: <rga...@us...> - 2002-10-18 15:06:22
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring In directory usw-pr-cvs1:/tmp/cvs-serv10867/test/src/org/fanfoot/scoring Added Files: TestEvent.java TestEventParser.java TestEventParserConfiguration.java TestEventParserConfigurationException.java TestEventPattern.java TestEvents.java TestScores.java TestScoringConfiguration.java TestScoringConfigurationException.java Log Message: Initial test code for scoring application --- NEW FILE: TestEvent.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEvent.java,v 1.1 2002/10/18 15:06:18 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:18 $ */ package org.fanfoot.scoring; import junit.framework.*; import junit.extensions.*; import java.awt.Toolkit; import java.awt.AWTEvent; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; /** * File <code>TestEvent.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.TestEvent * </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> */ public class TestEvent extends org.custommonkey.xmlunit.XMLTestCase { /** * Instance of tested class. */ protected Event varEvent; // Control XML docs String strType = "test"; String strPart1Name = "part1"; String strPart1Value = "valuePart1"; String strPart2Name = "part2"; String strPart2Value = "valuePart2"; String strPart3Name = "part3"; String strPart3Value = ""; String strControl1 = "<event>" + "<uid/>" + "<type>" + strType + "</type>" + "<src/>" + "<" + strPart1Name + ">" + strPart1Value + "</" + strPart1Name + ">" + "<" + strPart2Name + ">" + strPart2Value + "</" + strPart2Name + ">" + "<" + strPart3Name + ">" + strPart3Value + "</" + strPart3Name + ">" + "</event>"; org.w3c.dom.Document docControl1; /** * Public constructor for creating testing class. */ public TestEvent(String name) { super(name); } // end of TestEvent(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ protected void setUp() { setIgnoreWhitespace(true); varEvent = new Event(strType); varEvent.putPart(strPart1Name, strPart1Value); varEvent.putPart(strPart2Name, strPart2Value); varEvent.putPart(strPart3Name, strPart3Value); try { docControl1 = org.saafe.utils.XMLUtils.stringToXML(strControl1); } catch (Exception e) { e.printStackTrace(); fail("Failed to create control documents"); } } // 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. */ public static Test suite() { return new TestSuite(TestEvent.class); } // end of suite() /** * 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: * void appendXMLTo(org.w3c.dom.Document) * from tested class */ public void testAppendXMLTo9554056() { } // end of testAppendXMLTo9554056(org.w3c.dom.Document) /** * Method for testing how works original method: * java.lang.String getPart(java.lang.String) * from tested class */ public void testGetPart1195259493() { } // end of testGetPart1195259493(java.lang.String) /** * Method for testing how works original method: * java.util.Enumeration getPartNames() * from tested class */ public void testGetPartNames() { } // end of testGetPartNames() /** * Method for testing how works original method: * java.util.Hashtable getParts() * from tested class */ public void testGetParts() { } // end of testGetParts() /** * Method for testing how works original method: * java.lang.String getSrc() * from tested class */ public void testGetSrc() { } // end of testGetSrc() /** * Method for testing how works original method: * java.lang.String getType() * from tested class */ public void testGetType() { } // end of testGetType() /** * Method for testing how works original method: * java.lang.String getUID() * from tested class */ public void testGetUID() { } // end of testGetUID() /** * Method for testing how works original method: * void putPart(java.lang.String, java.lang.String) * from tested class */ public void testPutPart11952594931195259493() { } // end of testPutPart11952594931195259493(java.lang.String, java.lang.String) /** * Method for testing how works original method: * void setSrc(java.lang.String) * from tested class */ public void testSetSrc1195259493() { } // end of testSetSrc1195259493(java.lang.String) /** * Method for testing how works original method: * void setType(java.lang.String) * from tested class */ public void testSetType1195259493() { } // end of testSetType1195259493(java.lang.String) /** * Method for testing how works original method: * void setUID(java.lang.String) * from tested class */ public void testSetUID1195259493() { } // end of testSetUID1195259493(java.lang.String) /** * Method for testing how works original method: * org.w3c.dom.Document toXMLDoc() * from tested class */ public void testToXMLDoc() { try { assertXMLEqual("Testing to XML", docControl1, varEvent.toXMLDoc()); } catch (Exception e) { e.printStackTrace(); fail("Failed to convert event to XML Document"); } } // end of testToXMLDoc() } // end of TestEvent --- NEW FILE: TestEventParser.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEventParser.java,v 1.1 2002/10/18 15:06:18 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:18 $ */ package org.fanfoot.scoring; import java.awt.AWTEvent; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; import junit.extensions.*; import junit.framework.*; /** * 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> */ public class TestEventParser extends TestCase { protected String strConfURL = "file:///home/rgardler/projects/fanfoot/src/testcases/resources/conf/footballEvents.xml"; protected String strBBCTestURL = "file:///home/rgardler/projects/fanfoot/src/testcases/resources/testHTML/testCommentary_BBC_2.html"; protected String strBBCType = "BBC Text Commentary"; // Events details String strEventsUID="_Sunday, 15 September, 2002" + "_Barclaycard Premiership" + "_Tottenham Hotspur" + "_West Ham Utd"; // Match Details protected int intIndexMatchResult = 0; protected String strMatchHomeTeam = "Tottenham Hotspur"; protected String strMatchHomeScore = "3"; protected String strMatchDate = "Sunday, 15 September, 2002"; protected String strMatchAwayTeam = "West Ham Utd"; protected String strMatchAwayScore = "2"; // Goal 5 details protected int intIndexGoal5 = 0; protected String strNormalTimeMinutesGoal5 = "88"; protected String strNormalTimeSecondsGoal5 = "17"; protected String strInjuryTimeMinutesGoal5 = ""; protected String strInjuryTimeSecondsGoal5 = ""; protected String strGoalScorer5 = "Anthony Gardner"; protected String strScoringTeam5 = "Tottenham"; // Goal 4 details protected int intIndexGoal4 = 1; protected String strNormalTimeMinutesGoal4 = "75"; protected String strNormalTimeSecondsGoal4 = "43"; protected String strInjuryTimeMinutesGoal4 = ""; protected String strInjuryTimeSecondsGoal4 = ""; protected String strGoalScorer4 = "Trevor Sinclair"; // 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"; protected String strInjuryTimeMinutesGoal2 = ""; protected String strInjuryTimeSecondsGoal2 = ""; protected String strGoalScorer2 = "Frederic Kanoute"; // Goal 1 details protected int intIndexGoal1 = 4; protected String strNormalTimeMinutesGoal1 = "61"; protected String strNormalTimeSecondsGoal1 = "28"; protected String strInjuryTimeMinutesGoal1 = ""; protected String strInjuryTimeSecondsGoal1 = ""; protected String strGoalScorer1 = "Simon Davies"; // Assist 1 details protected int intIndexAssist1 = 0; protected String strAssistPlayer1 = "Paolo Di Canio"; // Assist 2 details protected int intIndexAssist2 = 1; protected String strAssistPlayer2 = "Paolo Di Canio"; // Assist 3 details protected int intIndexAssist3 = 2; protected String strAssistPlayer3 = "Matthew Etherington"; // Booking 1 details protected int intIndexBooking1 = 0; protected String strBookingPlayer1 = "Jamie Redknapp"; // Booking 2 details protected int intIndexBooking2 = 1; protected String strBookingPlayer2 = "Frederic Kanoute"; // Booking 3 details protected int intIndexBooking3 = 2; protected String strBookingPlayer3 = "Trevor Sinclair"; // Booking 4 details protected int intIndexBooking4 = 3; protected String strBookingPlayer4 = "Goran Bunjevcevic"; // Sending Off 1 details protected int intIndexSendingOff1 = 0; protected String strSendingOffPlayer1 = "Ian Pearce"; protected String strNormalTimeMinutesSendingOff1 = "69"; protected String strNormalTimeSecondsSendingOff1 = "15"; protected String strInjuryTimeMinutesSendingOff1 = ""; protected String strInjuryTimeSecondsSendingOff1 = ""; // Substitution 1 details protected int intIndexSubstitution1 = 0; protected String strSubstitutionPlayerOff1 = "Matthew Etherington"; protected String strSubstitutionPlayerOn1 = "Steffen Iversen"; protected String strNormalTimeMinutesSubstitution1 = "84"; protected String strNormalTimeSecondsSubstitution1 = "25"; protected String strInjuryTimeMinutesSubstitution1 = ""; protected String strInjuryTimeSecondsSubstitution1 = ""; protected String strSubstitutionReason1 = "tactical"; // Substitution 2 details protected int intIndexSubstitution2 = 1; protected String strSubstitutionPlayerOff2 = "Paolo Di Canio"; protected String strSubstitutionPlayerOn2 = "Michael Carrick"; protected String strNormalTimeMinutesSubstitution2 = "78"; protected String strNormalTimeSecondsSubstitution2 = "45"; protected String strInjuryTimeMinutesSubstitution2 = ""; protected String strInjuryTimeSecondsSubstitution2 = ""; protected String strSubstitutionReason2 = "tactical"; // Substitution 3 details protected int intIndexSubstitution3 = 2; protected String strSubstitutionPlayerOff3 = "Mauricio Taricco"; protected String strSubstitutionPlayerOn3 = "Ben Thatcher"; protected String strNormalTimeMinutesSubstitution3 = "45"; protected String strNormalTimeSecondsSubstitution3 = "00"; protected String strInjuryTimeMinutesSubstitution3 = ""; protected String strInjuryTimeSecondsSubstitution3 = ""; protected String strSubstitutionReason3 = "injury"; // Substitution 4 details protected int intIndexSubstitution4 = 3; protected String strSubstitutionPlayerOff4 = "Chris Perry"; protected String strSubstitutionPlayerOn4 = "Gary Doherty"; protected String strNormalTimeMinutesSubstitution4 = "31"; protected String strNormalTimeSecondsSubstitution4 = "47"; protected String strInjuryTimeMinutesSubstitution4 = ""; protected String strInjuryTimeSecondsSubstitution4 = ""; protected String strSubstitutionReason4 = "serious injury"; // Substitution 5 details protected int intIndexSubstitution5 = 4; protected String strSubstitutionPlayerOff5 = "Tomas Repka"; protected String strSubstitutionPlayerOn5 = "Nigel Winterburn"; protected String strNormalTimeMinutesSubstitution5 = "9"; protected String strNormalTimeSecondsSubstitution5 = "20"; protected String strInjuryTimeMinutesSubstitution5 = ""; protected String strInjuryTimeSecondsSubstitution5 = ""; protected String strSubstitutionReason5 = "serious injury"; // Substitution 6 details protected int intIndexSubstitution6 = 5; protected String strSubstitutionPlayerOff6 = "Frederic Kanoute"; protected String strSubstitutionPlayerOn6 = "Jermain Defoe"; protected String strNormalTimeMinutesSubstitution6 = "84"; protected String strNormalTimeSecondsSubstitution6 = "25"; protected String strInjuryTimeMinutesSubstitution6 = ""; protected String strInjuryTimeSecondsSubstitution6 = ""; protected String strSubstitutionReason6 = "tactical"; // TeamStarter Team 1 - Player 1 protected int intIndexTeamStarter1 = 0; protected String strNameTeamStarter1 = "Keller"; /** * Instance of tested class. */ protected EventParser varEventParser; /** * Public constructor for creating testing class. */ 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. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ 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. */ public static Test suite() { return new TestSuite(TestEventParser.class); } // end of suite() /** * 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.fanfoot.scoring.Events parse(java.lang.String, java.lang.String) * from tested class */ public void testParse11952594931195259493() { Events evts = null; // all the events java.util.ArrayList alEvts; // all the events of a given type Event evt = null; // a single event we are processing 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) } // end of TestEventParser --- NEW FILE: TestEventParserConfiguration.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEventParserConfiguration.java,v 1.1 2002/10/18 15:06:18 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:18 $ */ package org.fanfoot.scoring; import java.util.ArrayList; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.w3c.dom.Node; /** * File <code>TestEventParserConfiguration.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.TestEventParserConfiguration * </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> */ public class TestEventParserConfiguration extends TestCase { /** * Instance of tested class. */ protected EventParserConfiguration varEventParserConfiguration; protected String strURL = "file:///home/rgardler/projects/fanfoot/src/testcases/resources/conf/footballEvents.xml"; protected String strBBCCommentaryType = "BBC Text Commentary"; /** * Public constructor for creating testing class. */ public TestEventParserConfiguration(String name) { super(name); } // end of TestEventParserConfiguration(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ protected void setUp() { try { varEventParserConfiguration = new EventParserConfiguration(strURL); } catch (Exception e) { e.printStackTrace(); fail(); } } // 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. */ public static Test suite() { return new TestSuite(TestEventParserConfiguration.class); } // end of suite() /** * for classes which doesn't contain any methods here is one additional * method for performing test on such classes. */ public void testNoMethods() { } public void testGetPatternsForType() { ArrayList al = varEventParserConfiguration.getPatternsForType(strBBCCommentaryType); org.fanfoot.scoring.EventPattern p = (org.fanfoot.scoring.EventPattern)al.get(0); this.assertNotNull("Should have event pattern", p); } public void testGetDuplicateDetectionParts() { java.util.Iterator it = varEventParserConfiguration.getDuplicateDetectionParts("goal"); this.assertTrue("There should be a list of parts to use for duplicate detection on goal events", it.hasNext()); this.assertEquals("First part should be normalTimeMinutes", ("normalTimeMinutes"), (String)it.next()); } public void testGetEventsUIDPattern() { EventPattern pattern = null; try { pattern = varEventParserConfiguration.getEventsUIDPattern(strBBCCommentaryType); } catch (Exception e) { e.printStackTrace(); fail("Threw an exception whilst retrieving Events UID Pattern"); } this.assertNotNull("Should have Events UID node", pattern); } } // end of TestEventParserConfiguration --- NEW FILE: TestEventParserConfigurationException.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEventParserConfigurationException.java,v 1.1 2002/10/18 15:06:19 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:19 $ */ package org.fanfoot.scoring; import junit.framework.*; import junit.extensions.*; import java.awt.Toolkit; import java.awt.AWTEvent; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; /** * File <code>TestEventParserConfigurationException.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.TestEventParserConfigurationException * </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> */ public class TestEventParserConfigurationException extends TestCase { /** * Instance of tested class. */ protected EventParserConfigurationException varEventParserConfigurationException; /** * Public constructor for creating testing class. */ public TestEventParserConfigurationException(String name) { super(name); } // end of TestEventParserConfigurationException(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ 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); varEventParserConfigurationException = new org.fanfoot.scoring.EventParserConfigurationException(); } // 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. */ public static Test suite() { return new TestSuite(TestEventParserConfigurationException.class); } // end of suite() /** * for classes which doesn't contain any methods here is one additional * method for performing test on such classes. */ public void testNoMethods() { } public void testGetMatchersForType() { } } // end of TestEventParserConfigurationException --- NEW FILE: TestEventPattern.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEventPattern.java,v 1.1 2002/10/18 15:06:19 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:19 $ */ package org.fanfoot.scoring; import junit.framework.*; import junit.extensions.*; import java.awt.Toolkit; import java.awt.AWTEvent; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; /** * File <code>TestEventPattern.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.TestEventPattern * </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> */ public class TestEventPattern extends TestCase { /** * Instance of tested class. */ protected EventPattern varEventPattern; /** * Public constructor for creating testing class. */ public TestEventPattern(String name) { super(name); } // end of TestEventPattern(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ protected void setUp() { // Initialize your variable(s) here // for example: // varEventPattern = new EventPattern(...); // But note that there is no default constructor in EventPattern } // 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. */ public static Test suite() { return new TestSuite(TestEventPattern.class); } // end of suite() /** * 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: * java.lang.String getCapturingGroup(int) * from tested class */ public void testGetCapturingGroup104431() { } // end of testGetCapturingGroup104431(int) /** * Method for testing how works original method: * java.lang.String getPartName(int) * from tested class */ public void testGetPartName104431() { } // end of testGetPartName104431(int) /** * Method for testing how works original method: * java.util.regex.Pattern getRegexPattern() * from tested class */ public void testGetRegexPattern() { } // end of testGetRegexPattern() /** * Method for testing how works original method: * java.lang.String getType() * from tested class */ public void testGetType() { } // end of testGetType() /** * Method for testing how works original method: * void setCapturingGroup(int, java.lang.String) * from tested class */ public void testSetCapturingGroup1044311195259493() { } // end of testSetCapturingGroup1044311195259493(int, java.lang.String) /** * Method for testing how works original method: * void setRegexPattern(java.util.regex.Pattern) * from tested class */ public void testSetRegexPattern2037224663() { } // end of testSetRegexPattern2037224663(java.util.regex.Pattern) /** * Method for testing how works original method: * void setType(java.lang.String) * from tested class */ public void testSetType1195259493() { } // end of testSetType1195259493(java.lang.String) } // end of TestEventPattern --- NEW FILE: TestEvents.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestEvents.java,v 1.1 2002/10/18 15:06:19 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:19 $ */ package org.fanfoot.scoring; import junit.framework.*; import junit.extensions.*; import java.awt.Toolkit; import java.awt.AWTEvent; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; /** * File <code>TestEvents.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.TestEvents * </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> */ public class TestEvents extends TestCase { /** * Instance of tested class. */ protected Events varEvents; /** * Public constructor for creating testing class. */ public TestEvents(String name) { super(name); } // end of TestEvents(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ protected void setUp() { } // 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. */ public static Test suite() { return new TestSuite(TestEvents.class); } // end of suite() /** * 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.fanfoot.scoring.Event getEvent(int) * from tested class */ public void testGetEvent104431() { } // end of testGetEvent104431(int) /** * Method for testing how works original method: * java.util.List getEvents() * from tested class */ public void testGetEvents() { } // end of testGetEvents() /** * Method for testing how works original method: * void putEvent(org.fanfoot.scoring.Event) * from tested class */ public void testPutEvent1547041308() { } // end of testPutEvent1547041308(org.fanfoot.scoring.Event) /** * Method for testing how works original method: * int size() * from tested class */ public void testSize() { } // end of testSize() } // end of TestEvents --- NEW FILE: TestScores.java --- /* * File is generated by 'Unit Tests Generator' developed under * 'Web Test Tools' project at http://sf.net/projects/wttools/ * Copyright (C) 2001 "Artur Hefczyc" <ko...@us...> * to all 'Web Test Tools' subprojects. * * No rigths to files and no responsibility for code generated * by this tool are belonged to author of 'unittestsgen' utility. * * $Id: TestScores.java,v 1.1 2002/10/18 15:06:19 rgardler Exp $ * $Author: rgardler $ * $Date: 2002/10/18 15:06:19 $ */ package org.fanfoot.scoring; import java.awt.AWTEvent; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; import junit.extensions.*; import junit.framework.*; /** * 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> */ public class TestScores extends org.custommonkey.xmlunit.XMLTestCase { /** * Instance of tested class. */ protected Scores varScores; String BBCTestScoringConfigURL = "file:///home/rgardler/projects/fanfoot/src/testcases/resources/conf/BBCTestScoringConfig.xsl"; org.w3c.dom.Document docControl1; String strControl1 = "<score>" + "It works!" + "</score>"; java.util.logging.Logger logger = java.util.logging.Logger.getLogger("org.fanfoot.scoring"); /** * Public constructor for creating testing class. */ public TestScores(String name) { super(name); } // end of TestScores(String name) /** * This main method is used for run tests for this class only * from command line. */ public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } // end of main(Stringp[] args) /** * This method is called every time before particular test execution. * It creates new instance of tested class and it can perform some more * actions which are necessary for performs tests. */ protected void setUp() { setIgnoreWhitespace(true); Events evts = new Events(); Event evt = new Event("test1"); evt.putPart("part1", "value1"); evts.add(evt); try { docControl1 = org.saafe.utils.XMLUtils.stringToXML(strControl1); } catch (Exception e) { e.printStackTrace(); fail("Failed to create control documents: " + e); } ScoringConfiguration sc = new ScoringConfiguration( BBCTestScoringConfigURL); try { varScores = new Scores(evts, sc); } catch (Exception e) { fail("Unable to set up the scores object: " + e); } } // 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. */ public static Test suite() { return new TestSuite(TestScores.class); } // end of suite() /** * 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 */ public void testGetScoresDocument() { 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 } assertXMLEqual("Generated scores document", docControl1, doc); } // end of testGetScoresDocument() /** * 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 testSetScoresDocument9554056(org.w3c.dom.Document) } // end of TestScores --- NEW ... [truncated message content] |