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: <rga...@pr...> - 2002-11-18 17:14:57
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/db
In directory sc8-pr-cvs1:/tmp/cvs-serv12918
Modified Files:
DBException.java
Log Message:
Wrapped reporting of nested exception to prevent null pointer exception when there is no nested object
Index: DBException.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/db/DBException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DBException.java 10 Nov 2002 15:00:17 -0000 1.1
--- DBException.java 18 Nov 2002 17:14:12 -0000 1.2
***************
*** 86,91 ****
System.out.println( this.getMessage() );
! System.out.println( "Nested Exception:" );
! root.printStackTrace();
}
}
--- 86,93 ----
System.out.println( this.getMessage() );
! if ( root != null ) {
! System.out.println( "Nested Exception:" );
! root.printStackTrace();
! }
}
}
|
|
From: <rga...@us...> - 2002-11-16 21:03:05
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv9320
Modified Files:
footballEvents.xml
Log Message:
Added duplicate detectoin to remaining event types.
Index: footballEvents.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/footballEvents.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** footballEvents.xml 15 Nov 2002 20:37:00 -0000 1.10
--- footballEvents.xml 16 Nov 2002 21:03:02 -0000 1.11
***************
*** 39,43 ****
<!-- Extract the default information for this match -->
! <event type="result">
<pattern>
<sourceType>BBC Text Commentary</sourceType>
--- 39,43 ----
<!-- Extract the default information for this match -->
! <event type="result">
<pattern>
<sourceType>BBC Text Commentary</sourceType>
***************
*** 230,233 ****
--- 230,241 ----
<event type="sendingOff">
+ <duplicateDetection>
+ <part name="normalTimeMinutes"/>
+ <part name="normalTimeSeconds"/>
+ <part name="injuryTimeMinutes"/>
+ <part name="injuryTimeSeconds"/>
+ <part name="player"/>
+ </duplicateDetection>
+
<pattern>
<sourceType>BBC Text Commentary</sourceType>
***************
*** 401,404 ****
--- 409,417 ----
<event type="teamStarter">
+ <duplicateDetection>
+ <part name="team"/>
+ <part name="player"/>
+ </duplicateDetection>
+
<!-- Team 1 - Player 1 -->
<pattern>
***************
*** 693,697 ****
</event>
! <event type="substituteStarter">
<!-- Team 1 - Sub 1 -->
<pattern>
--- 706,714 ----
</event>
! <event type="substituteStarter">
! <duplicateDetection>
! <part name="team"/>
! <part name="player"/>
! </duplicateDetection>
<!-- Team 1 - Sub 1 -->
<pattern>
|
|
From: <rga...@us...> - 2002-11-16 16:45:34
|
Update of /cvsroot/csms/csms-core/src/test/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv11453
Modified Files:
BBCTestScoringConfig.xsl
Log Message:
Creates a default set of scoring events for testing pruposes
Index: BBCTestScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/test/resources/conf/BBCTestScoringConfig.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BBCTestScoringConfig.xsl 18 Oct 2002 15:05:45 -0000 1.1
--- BBCTestScoringConfig.xsl 16 Nov 2002 16:45:31 -0000 1.2
***************
*** 1,4 ****
<?xml version="1.0" encoding="UTF-8" ?>
-
<!--
Document : BBcTestScoringConfig.xsl
--- 1,3 ----
***************
*** 6,19 ****
Author : rgardler
Description:
! Transforms an Events XML document into a score XML document
! -->
!
<xsl:stylesheet version="1.0"
! xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- template rule matching source root element -->
- <xsl:template match="/">
- <score>It works!</score>
- </xsl:template>
- </xsl:stylesheet>
--- 5,480 ----
Author : rgardler
Description:
! A simple conifguration XSL for testing the Scores object. -->
<xsl:stylesheet version="1.0"
! xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
! <!-- template rule matching source root element -->
! <xsl:template match="/">
! <scores xmlns:fo="http://www.w3.org/1999/XSL/Format">
! <player playerID="964">
! <event>
! <points>4</points>
!
! <type>Goal</type>
! </event>
! </player>
!
! <player playerID="511">
! <event>
! <points>4</points>
!
! <type>Goal</type>
! </event>
! </player>
!
! <player playerID="965">
! <event>
! <points>4</points>
!
! <type>Goal</type>
! </event>
! </player>
!
! <player playerID="645">
! <event>
! <points>4</points>
!
! <type>Goal</type>
! </event>
! </player>
!
! <player playerID="965">
! <event>
! <points>4</points>
!
! <type>Goal</type>
! </event>
! </player>
!
! <player playerID="965">
! <event>
! <points>2</points>
!
! <type>Assist</type>
! </event>
! </player>
!
! <player playerID="708">
! <event>
! <points>2</points>
!
! <type>Assist</type>
! </event>
! </player>
!
! <player playerID="929">
! <event>
! <points>2</points>
!
! <type>Assist</type>
! </event>
! </player>
!
! <player playerID="114">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="223">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="224">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="648">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="639">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="645">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="644">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="926">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="929">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="134">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="808">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="456">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="252">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="455">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="699">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="708">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="705">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="964">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="965">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="706">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="511">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="514">
! <event>
! <points>1</points>
!
! <type>Appearance</type>
! </event>
! </player>
!
! <player playerID="114">
! <event>
! <points>-1</points>
!
! <type>Goalkeeper Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="224">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="511">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="514">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="134">
! <event>
! <points>-1</points>
!
! <type>Goalkeeper Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="456">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="252">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="455">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="114">
! <event>
! <points>-1</points>
!
! <type>Goalkeeper Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="224">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="511">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="514">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="114">
! <event>
! <points>-1</points>
!
! <type>Goalkeeper Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="224">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="511">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="514">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="114">
! <event>
! <points>-1</points>
!
! <type>Goalkeeper Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="224">
! <event>
! <points>-1</points>
!
! <type>Full Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="514">
! <event>
! <points>-1</points>
!
! <type>Centre Back Conceeded Goal</type>
! </event>
! </player>
!
! <player playerID="645">
! <event>
! <points>-1</points>
!
! <type>Yellow Card</type>
! </event>
! </player>
!
! <player playerID="220">
! <event>
! <points>-1</points>
!
! <type>Yellow Card</type>
! </event>
! </player>
!
! <player playerID="965">
! <event>
! <points>-1</points>
!
! <type>Yellow Card</type>
! </event>
! </player>
!
! <player playerID="705">
! <event>
! <points>-1</points>
!
! <type>Yellow Card</type>
! </event>
! </player>
! </scores>
! </xsl:template>
! </xsl:stylesheet>
|
|
From: <rga...@us...> - 2002-11-16 16:44:37
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv10720
Modified Files:
ScoringConfig.xsl
Log Message:
Record the game UID in each scoring event
Index: ScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/ScoringConfig.xsl,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ScoringConfig.xsl 10 Nov 2002 17:55:10 -0000 1.8
--- ScoringConfig.xsl 16 Nov 2002 16:44:34 -0000 1.9
***************
*** 25,28 ****
--- 25,29 ----
<xsl:template match="/">
<scores>
+
<!-- 4 points for every goal scored. -->
<xsl:call-template name="goalScorers" />
***************
*** 991,994 ****
--- 992,999 ----
<event>
+ <xsl:attribute name="gameUID">
+ <xsl:value-of select="//uid"/>
+ </xsl:attribute>
+
<points>
<xsl:value-of select="$points" />
|
|
From: <rga...@us...> - 2002-11-15 20:37:17
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv21361
Modified Files:
footballEvents.xml
Log Message:
Detect goals scored from the penalty spot
Index: footballEvents.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/footballEvents.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** footballEvents.xml 7 Nov 2002 14:11:42 -0000 1.9
--- footballEvents.xml 15 Nov 2002 20:37:00 -0000 1.10
***************
*** 76,79 ****
--- 76,96 ----
<part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
</pattern>
+
+
+ <!--Penalties -->
+ <pattern>
+ <sourceType>BBC Text Commentary</sourceType>
+ <part name="normalTimeMinutes">\d\d?</part>
+ <unwantedPart>:</unwantedPart>
+ <part name="normalTimeSeconds">\d\d</part>
+ <unwantedPart>\s*\(?</unwantedPart>
+ <part name="injuryTimeMinutes">\d?\d?</part>
+ <unwantedPart>:?</unwantedPart>
+ <part name="injuryTimeSeconds">\d?\d?</part>
+ <unwantedPart>\)?</unwantedPart>
+ <unwantedPart>[Gg]oal\s-(?:.(?!\d\d:\d\d))*[Pp]enalty(?:.(?!\d\d:\d\d))*by\s</unwantedPart>
+ <part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
+ <unwantedPart>(?:.(?!\d\d:\d\d))*scored</unwantedPart>
+ </pattern>
</event>
|
|
From: <rga...@us...> - 2002-11-10 18:42:48
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv3134
Modified Files:
Scores2HTML.xsl
Log Message:
Summary table was not sorting correctly as it was sorting text rather than numbers.
Index: Scores2HTML.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/Scores2HTML.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Scores2HTML.xsl 10 Nov 2002 18:23:45 -0000 1.4
--- Scores2HTML.xsl 10 Nov 2002 18:42:44 -0000 1.5
***************
*** 38,42 ****
</tr>
<xsl:for-each select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID">
! <xsl:sort select="."/>
<xsl:apply-templates select="." mode="summary"/>
</xsl:for-each>
--- 38,42 ----
</tr>
<xsl:for-each select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID">
! <xsl:sort select="." data-type="number"/>
<xsl:apply-templates select="." mode="summary"/>
</xsl:for-each>
|
|
From: <rga...@us...> - 2002-11-10 18:23:48
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv25685
Modified Files:
Scores2HTML.xsl
Log Message:
Put in some headings, laid out tables better.
Moved Errors to top of the page so they don't get missed.
Main summary table is now sorted by ID number
Index: Scores2HTML.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/Scores2HTML.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Scores2HTML.xsl 10 Nov 2002 17:56:38 -0000 1.3
--- Scores2HTML.xsl 10 Nov 2002 18:23:45 -0000 1.4
***************
*** 28,31 ****
--- 28,34 ----
<body>
<h1>Fanfoot Scores</h1>
+ <h2>Errors</h2>
+ <xsl:apply-templates select="scores/error"/>
+ <h3>Player Scores</h3>
<table border="1">
<tr>
***************
*** 34,46 ****
<th>Total Points</th>
</tr>
! <xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID"
! mode="summary"/>
</table>
<br/>
! <table>
! <tr><th>Errors</th></tr>
! <xsl:apply-templates select="scores/error"/>
! </table>
! <br/>
<xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID"
mode="detail"/>
--- 37,47 ----
<th>Total Points</th>
</tr>
! <xsl:for-each select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID">
! <xsl:sort select="."/>
! <xsl:apply-templates select="." mode="summary"/>
! </xsl:for-each>
</table>
<br/>
! <h3>Detailed Breakdown of Player Scores</h3>
<xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID"
mode="detail"/>
***************
*** 70,78 ****
</xsl:call-template>
</xsl:variable>
! <table>
! <tr>
! <th><xsl:value-of select="."/></th>
! <th><xsl:value-of select="$playerFullName"/></th>
! </tr>
<xsl:apply-templates select="key('players',.)" mode="detail"/>
<tr>
--- 71,76 ----
</xsl:call-template>
</xsl:variable>
! <h4><xsl:value-of select="$playerFullName"/> (<xsl:value-of select="."/>)</h4>
! <table border="1" width="100%">
<xsl:apply-templates select="key('players',.)" mode="detail"/>
<tr>
|
|
From: <rga...@us...> - 2002-11-10 18:03:26
|
Update of /cvsroot/csms/csms-core/src/resources/conf In directory usw-pr-cvs1:/tmp/cvs-serv15286 Modified Files: players.xml Log Message: Removed space from David Seamans name. Inserted some test data for recording scroing events. Index: players.xml =================================================================== RCS file: /cvsroot/csms/csms-core/src/resources/conf/players.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** players.xml 4 Nov 2002 22:11:16 -0000 1.5 --- players.xml 10 Nov 2002 18:03:21 -0000 1.6 *************** *** 2,6 **** <players> <player id="100"> ! <firstName type="main">David </firstName> <firstName type="initial">D.</firstName> <surname>Seaman</surname> --- 2,6 ---- <players> <player id="100"> ! <firstName type="main">David</firstName> <firstName type="initial">D.</firstName> <surname>Seaman</surname> *************** *** 9,12 **** --- 9,24 ---- <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> *************** *** 2842,2846 **** <player id="601"> ! <firstName type="main"> </firstName> <surname>Edu</surname> <registeredTeam>ARS</registeredTeam> --- 2854,2858 ---- <player id="601"> ! <firstName type="main"/> <surname>Edu</surname> <registeredTeam>ARS</registeredTeam> |
|
From: <rga...@us...> - 2002-11-10 17:56:41
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv12143
Modified Files:
Scores2HTML.xsl
Log Message:
Changed to accomodate scoring events being keyed by ID rather than player (cahnge in scores.xml DTD).
Also made the output show both the ID and playerName
Index: Scores2HTML.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/Scores2HTML.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Scores2HTML.xsl 10 Nov 2002 14:51:25 -0000 1.2
--- Scores2HTML.xsl 10 Nov 2002 17:56:38 -0000 1.3
***************
*** 15,21 ****
<xsl:output method="text/html"/>
<!-- Create the keys for the players -->
! <xsl:key name="players" match = "/scores/player" use="@name"/>
<!-- template rule matching source root element -->
--- 15,24 ----
<xsl:output method="text/html"/>
+ <!-- url of the players database -->
+ <xsl:variable name="playersDataSource">
+ http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/players.xml?rev=HEAD&content-type=text/xml</xsl:variable>
<!-- Create the keys for the players -->
! <xsl:key name="players" match = "/scores/player" use="@playerID"/>
<!-- template rule matching source root element -->
***************
*** 25,30 ****
<body>
<h1>Fanfoot Scores</h1>
! <table>
! <xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@name))]/@name"
mode="summary"/>
</table>
--- 28,38 ----
<body>
<h1>Fanfoot Scores</h1>
! <table border="1">
! <tr>
! <th>ID</th>
! <th>Name</th>
! <th>Total Points</th>
! </tr>
! <xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID"
mode="summary"/>
</table>
***************
*** 35,39 ****
</table>
<br/>
! <xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@name))]/@name"
mode="detail"/>
</body>
--- 43,47 ----
</table>
<br/>
! <xsl:apply-templates select="scores/player[generate-id()=generate-id(key('players',@playerID))]/@playerID"
mode="detail"/>
</body>
***************
*** 41,57 ****
</xsl:template>
! <xsl:template match="@name" mode="summary">
! <xsl:variable name="name"><xsl:value-of select="."/></xsl:variable>
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/></td>
</tr>
</xsl:template>
! <xsl:template match="@name" mode="detail">
! <xsl:variable name="name"><xsl:value-of select="."/></xsl:variable>
<table>
<tr>
! <th colspan='2'><xsl:value-of select="."/></th>
</tr>
<xsl:apply-templates select="key('players',.)" mode="detail"/>
--- 49,77 ----
</xsl:template>
! <xsl:template match="@playerID" mode="summary">
! <xsl:variable name="playerID"><xsl:value-of select="."/></xsl:variable>
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerID"><xsl:value-of select="$playerID"/></xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="$playerFullName"/></td>
! <td><xsl:value-of select="sum(/scores/player[@playerID=$playerID]/event/points)"/></td>
</tr>
</xsl:template>
! <xsl:template match="@playerID" mode="detail">
! <xsl:variable name="playerID"><xsl:value-of select="."/></xsl:variable>
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerID"><xsl:value-of select="$playerID"/></xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
<table>
<tr>
! <th><xsl:value-of select="."/></th>
! <th><xsl:value-of select="$playerFullName"/></th>
</tr>
<xsl:apply-templates select="key('players',.)" mode="detail"/>
***************
*** 59,63 ****
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/>
</th>
</tr>
--- 79,83 ----
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@playerID=$playerID]/event/points)"/>
</th>
</tr>
***************
*** 77,80 ****
--- 97,120 ----
</tr>
</xsl:template>
+
+ <!-- Return the player full name given the ID -->
+ <xsl:template name="getPlayerFullName">
+ <xsl:param name="playerID"/>
+ <xsl:variable name="firstName">
+ <xsl:value-of select="document($playersDataSource)/players/player[@id=$playerID]/firstName"/>
+ </xsl:variable>
+ <xsl:variable name="surname">
+ <xsl:value-of select="document($playersDataSource)/players/player[@id=$playerID]/surname"/>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="string-length($surname) > 0">
+ <xsl:value-of select="concat($firstName, ' ', $surname)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ERROR: Unknown player with ID ', $playerID)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
|
|
From: <rga...@us...> - 2002-11-10 17:55:14
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv11175
Modified Files:
ScoringConfig.xsl
Log Message:
Scoring events are now keyed according to player ID rather than player name
Index: ScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/ScoringConfig.xsl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ScoringConfig.xsl 10 Nov 2002 14:51:25 -0000 1.7
--- ScoringConfig.xsl 10 Nov 2002 17:55:10 -0000 1.8
***************
*** 11,17 ****
--- 11,19 ----
<xsl:output method="text/xml" />
+ <!-- URL of the players dataabse -->
<xsl:variable name="playersDataSource">
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/players.xml?rev=HEAD&content-type=text/xml</xsl:variable>
+ <!-- URL of the Teams database -->
<xsl:variable name="teamDataSource">
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core/src/resources/conf/teams.xml?rev=HEAD&content-type=text/xml</xsl:variable>
***************
*** 51,57 ****
<xsl:template name="goalScorers">
<xsl:for-each select="//event[type='goal']">
<xsl:call-template name="getPointsNode">
<xsl:with-param name="playerName">
! <xsl:value-of select="./player" />
</xsl:with-param>
--- 53,60 ----
<xsl:template name="goalScorers">
<xsl:for-each select="//event[type='goal']">
+
<xsl:call-template name="getPointsNode">
<xsl:with-param name="playerName">
! <xsl:value-of select="player" />
</xsl:with-param>
***************
*** 761,764 ****
--- 764,791 ----
</xsl:choose>
</xsl:template>
+
+ <!-- Return the player ID given the full name -->
+ <xsl:template name="getPlayerID">
+ <xsl:param name="playerFullName"/>
+ <xsl:variable name="firstName">
+ <xsl:value-of select="substring-before($playerFullName, ' ')"/>
+ </xsl:variable>
+ <xsl:variable name="surname">
+ <xsl:value-of select="substring-after($playerFullName, ' ')"/>
+ </xsl:variable>
+
+ <xsl:variable name="playerID">
+ <xsl:value-of select="document($playersDataSource)/players/player[surname=$surname and firstName=$firstName]/@id"/>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="string-length($playerID) > 0">
+ <xsl:value-of select="$playerID"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ERROR: Unknown ID for Player (', $playerFullName, ')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
<!-- Return the player position -->
***************
*** 949,955 ****
<xsl:param name="eventType" />
<player>
! <xsl:attribute name="name">
! <xsl:value-of select="$playerName" />
</xsl:attribute>
--- 976,991 ----
<xsl:param name="eventType" />
+
+ <xsl:variable name="playerID">
+ <xsl:call-template name="getPlayerID">
+ <xsl:with-param name="playerFullName">
+ <xsl:value-of select="$playerName"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
<player>
! <xsl:attribute name="playerID">
! <xsl:value-of select="$playerID" />
</xsl:attribute>
|
|
From: <rga...@us...> - 2002-11-10 17:38:33
|
Update of /cvsroot/csms/csms-core/src/documentation/xdocs/manual
In directory usw-pr-cvs1:/tmp/cvs-serv2622
Modified Files:
configuration.xml
Log Message:
Added a note about the CVS version having defaults pointing at CVS HEAD.
Index: configuration.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/src/documentation/xdocs/manual/configuration.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** configuration.xml 6 Nov 2002 22:11:15 -0000 1.2
--- configuration.xml 10 Nov 2002 17:38:29 -0000 1.3
***************
*** 68,72 ****
<th>Description</th>
! <th>Default</th>
</tr>
--- 68,72 ----
<th>Description</th>
! <th>Default <link href="#defaultsNote">*</link></th>
</tr>
***************
*** 110,114 ****
</tr>
</table>
!
<table>
<caption>Control Centre Preferences</caption>
--- 110,116 ----
</tr>
</table>
! <anchor id="defaultsNote"/>
! <p>In the CVS version of the application these defaults for the configuration files are differnet from
! those indicated here. Generally, they point at the CVS HEAD version of the config files.</p>
<table>
<caption>Control Centre Preferences</caption>
|
|
From: <rga...@us...> - 2002-11-10 15:18:37
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring
In directory usw-pr-cvs1:/tmp/cvs-serv11840
Modified Files:
EventParser.java
Log Message:
Minor clarifications in comments
Index: EventParser.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring/EventParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** EventParser.java 21 Oct 2002 22:19:31 -0000 1.4
--- EventParser.java 10 Nov 2002 15:18:34 -0000 1.5
***************
*** 64,73 ****
/** Holds value of property conf. */
private EventParserConfiguration conf;
- /** WHere to write log info */
- final Logger logger = Logger.getLogger("org.fanfoot.scoring");
/** The listeners to this parser */
private Vector listeners = new Vector();
/** The commentary document to parse */
private Document docCommentary = null;
--- 64,73 ----
/** Holds value of property conf. */
private EventParserConfiguration conf;
/** The listeners to this parser */
private Vector listeners = new Vector();
/** The commentary document to parse */
private Document docCommentary = null;
+ /** WHere to write log info */
+ final Logger logger = Logger.getLogger( "org.fanfoot.scoring" );
***************
*** 88,94 ****
*@throws EventParserConfigurationException
*/
! public EventParser(String strURL) throws EventParserConfigurationException {
super();
! conf = new EventParserConfiguration(strURL);
}
--- 88,94 ----
*@throws EventParserConfigurationException
*/
! public EventParser( String strURL ) throws EventParserConfigurationException {
super();
! conf = new EventParserConfiguration( strURL );
}
***************
*** 107,116 ****
* Exception
*/
! public Events parse(String strURL, String strType)
throws MalformedURLException, IOException,
EventParserConfigurationException {
! URL url = new URL(strURL);
! return parse(url, strType);
}
--- 107,116 ----
* Exception
*/
! public Events parse( String strURL, String strType )
throws MalformedURLException, IOException,
EventParserConfigurationException {
! URL url = new URL( strURL );
! return parse( url, strType );
}
***************
*** 128,134 ****
* Exception
*/
! public Events parse(File file, String strType) throws IOException,
EventParserConfigurationException {
! return parse(file.toURL(), strType);
}
--- 128,134 ----
* Exception
*/
! public Events parse( File file, String strType ) throws IOException,
EventParserConfigurationException {
! return parse( file.toURL(), strType );
}
***************
*** 147,173 ****
* Exception
*/
! public Events parse(URL url, String strType) throws MalformedURLException,
IOException,
EventParserConfigurationException {
! docCommentary = XMLUtils.loadTidiedHTML(url);
this.notifyRetrievedCommentary();
StringBuffer sbData = new StringBuffer();
! XMLUtils.appendAllText(docCommentary.getDocumentElement(), sbData);
String strData = sbData.toString();
! ArrayList patterns = conf.getPatternsForType(strType);
Events evtsResult = new Events();
! String strEventsUID = parseEventsUID(strData, strType);
! evtsResult.setUID(strEventsUID);
Events evtsCurrent;
EventPattern p;
! for(int i = 0; i < patterns.size(); i++) {
! p = (EventPattern) patterns.get(i);
! evtsCurrent = processEvents(p, strData);
! if(evtsCurrent != null) {
! evtsResult.addAll(evtsCurrent, this.conf);
}
}
--- 147,173 ----
* Exception
*/
! public Events parse( URL url, String strType ) throws MalformedURLException,
IOException,
EventParserConfigurationException {
! docCommentary = XMLUtils.loadTidiedHTML( url );
this.notifyRetrievedCommentary();
StringBuffer sbData = new StringBuffer();
! XMLUtils.appendAllText( docCommentary.getDocumentElement(), sbData );
String strData = sbData.toString();
! ArrayList patterns = conf.getPatternsForType( strType );
Events evtsResult = new Events();
! String strEventsUID = parseEventsUID( strData, strType );
! evtsResult.setUID( strEventsUID );
Events evtsCurrent;
EventPattern p;
! for ( int i = 0; i < patterns.size(); i++ ) {
! p = (EventPattern) patterns.get( i );
! evtsCurrent = processEvents( p, strData );
! if ( evtsCurrent != null ) {
! evtsResult.addAll( evtsCurrent, this.conf );
}
}
***************
*** 185,216 ****
*@return Events matched by the pattern
*/
! private Events processEvents(EventPattern p, String strData) {
Events evts = new Events();
! Matcher m = p.getRegexPattern().matcher(strData);
String strPartValue;
String strPartName;
! logger.finest("Looking for matches of type " + p.getType() + " (RE="
! + p.getRegexPattern().pattern() + ")");
! while(m.find()) {
! logger.fine("Matched event in: " + m.group());
! Event evt = new Event(p.getType());
// Extract the event parts and store them in the event object
! logger.finest("There are " + m.groupCount()
! + " groups in the match");
! for(int i = 1; i <= m.groupCount(); i++) {
! strPartValue = m.group(i).trim();
! strPartName = p.getPartName(i);
! evt.putPart(strPartName, strPartValue);
! logger.finest("Set " + strPartName + " to " + strPartValue
! + " (part #" + i + ")");
}
! logger.fine("Added event of type " + p.getType());
! evts.add(evt);
}
--- 185,216 ----
*@return Events matched by the pattern
*/
! private Events processEvents( EventPattern p, String strData ) {
Events evts = new Events();
! Matcher m = p.getRegexPattern().matcher( strData );
String strPartValue;
String strPartName;
! logger.finest( "Looking for matches of type " + p.getType() + " (RE="
! + p.getRegexPattern().pattern() + ")" );
! while ( m.find() ) {
! logger.fine( "Matched event in: " + m.group() );
! Event evt = new Event( p.getType() );
// Extract the event parts and store them in the event object
! logger.finest( "There are " + m.groupCount()
! + " groups in the match" );
! for ( int i = 1; i <= m.groupCount(); i++ ) {
! strPartValue = m.group( i ).trim();
! strPartName = p.getPartName( i );
! evt.putPart( strPartName, strPartValue );
! logger.finest( "Set " + strPartName + " to " + strPartValue
! + " (part #" + i + ")" );
}
! logger.fine( "Added event of type " + p.getType() );
! evts.add( evt );
}
***************
*** 231,259 ****
* cannot be generated
*/
! public String parseEventsUID(String strData, String strType)
throws EventParserConfigurationException {
StringBuffer sb = new StringBuffer();
Matcher m;
! logger.entering("org.fanfoot.scoring.EventParser",
! "parseEventUID(strData, strType");
// get the UID element
! EventPattern uidPattern = this.conf.getEventsUIDPattern(strType);
! m = uidPattern.getRegexPattern().matcher(strData);
! logger.finest("UID pattern is "
! + uidPattern.getRegexPattern().pattern());
// get the UID parts
! while(m.find()) {
// Extract the UID parts and build the UID
! for(int i = 1; i <= m.groupCount(); i++) {
! sb.append('_');
! sb.append(m.group(i).trim());
}
}
! logger.exiting("org.fanfoot.scoring.EventParser",
! "parseEventUID(strData, strType");
// concatenate the parts
--- 231,259 ----
* cannot be generated
*/
! public String parseEventsUID( String strData, String strType )
throws EventParserConfigurationException {
StringBuffer sb = new StringBuffer();
Matcher m;
! logger.entering( "org.fanfoot.scoring.EventParser",
! "parseEventUID(strData, strType" );
// get the UID element
! EventPattern uidPattern = this.conf.getEventsUIDPattern( strType );
! m = uidPattern.getRegexPattern().matcher( strData );
! logger.finest( "UID pattern is "
! + uidPattern.getRegexPattern().pattern() );
// get the UID parts
! while ( m.find() ) {
// Extract the UID parts and build the UID
! for ( int i = 1; i <= m.groupCount(); i++ ) {
! sb.append( '_' );
! sb.append( m.group( i ).trim() );
}
}
! logger.exiting( "org.fanfoot.scoring.EventParser",
! "parseEventUID(strData, strType" );
// concatenate the parts
***************
*** 277,281 ****
*@param conf New value of property conf.
*/
! public void setConfiguration(EventParserConfiguration conf) {
this.conf = conf;
}
--- 277,281 ----
*@param conf New value of property conf.
*/
! public void setConfiguration( EventParserConfiguration conf ) {
this.conf = conf;
}
***************
*** 289,296 ****
* Exception
*/
! public void loadConfiguration(String strConf)
throws EventParserConfigurationException {
! EventParserConfiguration conf = new EventParserConfiguration(strConf);
! setConfiguration(conf);
}
--- 289,296 ----
* Exception
*/
! public void loadConfiguration( String strConf )
throws EventParserConfigurationException {
! EventParserConfiguration conf = new EventParserConfiguration( strConf );
! setConfiguration( conf );
}
***************
*** 301,307 ****
*@param epl the listener to add
*/
! public synchronized void addListener(EventParserListener epl) {
Vector v = (Vector) listeners.clone();
! v.addElement(epl);
listeners = v;
}
--- 301,307 ----
*@param epl the listener to add
*/
! public synchronized void addListener( EventParserListener epl ) {
Vector v = (Vector) listeners.clone();
! v.addElement( epl );
listeners = v;
}
***************
*** 313,319 ****
*@param epl the listener to remove
*/
! public synchronized void removeListener(EventParserListener epl) {
Vector v = (Vector) listeners.clone();
! v.removeElement(epl);
listeners = v;
}
--- 313,319 ----
*@param epl the listener to remove
*/
! public synchronized void removeListener( EventParserListener epl ) {
Vector v = (Vector) listeners.clone();
! v.removeElement( epl );
listeners = v;
}
***************
*** 322,339 ****
/** Notify all listeners when the commentary has been retrieved */
protected void notifyRetrievedCommentary() {
! logger.entering("org.fanfoot.scoring.EventParser",
! "notifyRetrievedCommentary()");
Vector l;
! EventObject e = new EventObject(this);
l = listeners;
// Atomic assignment
EventParserListener epl = null;
! for(int i = 0; i < l.size(); i++) {
! epl = (EventParserListener) l.elementAt(i);
! epl.retrievedCommentary(e);
}
! logger.entering("org.fanfoot.scoring.EventParser",
! "notifyRetrievedCommentary()");
}
--- 322,339 ----
/** Notify all listeners when the commentary has been retrieved */
protected void notifyRetrievedCommentary() {
! logger.entering( "org.fanfoot.scoring.EventParser",
! "notifyRetrievedCommentary()" );
Vector l;
! EventObject e = new EventObject( this );
l = listeners;
// Atomic assignment
EventParserListener epl = null;
! for ( int i = 0; i < l.size(); i++ ) {
! epl = (EventParserListener) l.elementAt( i );
! epl.retrievedCommentary( e );
}
! logger.entering( "org.fanfoot.scoring.EventParser",
! "notifyRetrievedCommentary()" );
}
***************
*** 348,360 ****
String strCommentary;
try {
! strCommentary = XMLUtils.xmlToString(docCommentary);
! } catch(javax.xml.transform.TransformerConfigurationException tce) {
! logger.log(Level.WARNING,
! "Unable to convert commentary document to string", tce);
strCommentary = "ERROR: Unable to convert commentary document to "
+ "a string due to a Transformer Configuration problem";
! } catch(javax.xml.transform.TransformerException te) {
! logger.log(Level.WARNING,
! "Unable to convert commentary document to string", te);
strCommentary = "ERROR: Unable to convert commentary document to "
+ "a string du to a Transformer problem";
--- 348,360 ----
String strCommentary;
try {
! strCommentary = XMLUtils.xmlToString( docCommentary );
! } catch ( javax.xml.transform.TransformerConfigurationException tce ) {
! logger.log( Level.WARNING,
! "Unable to convert commentary document to string", tce );
strCommentary = "ERROR: Unable to convert commentary document to "
+ "a string due to a Transformer Configuration problem";
! } catch ( javax.xml.transform.TransformerException te ) {
! logger.log( Level.WARNING,
! "Unable to convert commentary document to string", te );
strCommentary = "ERROR: Unable to convert commentary document to "
+ "a string du to a Transformer problem";
|
|
From: <rga...@us...> - 2002-11-10 15:12:56
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring
In directory usw-pr-cvs1:/tmp/cvs-serv8618
Modified Files:
Events.java
Log Message:
Minor clarifications in comments
Index: Events.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring/Events.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Events.java 21 Oct 2002 19:55:34 -0000 1.3
--- Events.java 10 Nov 2002 15:12:53 -0000 1.4
***************
*** 67,71 ****
private Vector types = new Vector();
! /** Holds value of property uid. */
private String uid = "";
--- 67,71 ----
private Vector types = new Vector();
! /** The unique identifier for these events. */
private String uid = "";
***************
*** 74,78 ****
/** Where to write log entries */
! final Logger logger = Logger.getLogger("org.fanfoot.scoring");
--- 74,78 ----
/** Where to write log entries */
! final Logger logger = Logger.getLogger( "org.fanfoot.scoring" );
***************
*** 89,95 ****
* application unique
*/
! public Events(String strUID) {
super();
! this.setUID(strUID);
}
--- 89,95 ----
* application unique
*/
! public Events( String strUID ) {
super();
! this.setUID( strUID );
}
***************
*** 111,116 ****
*@return the collection of events
*/
! public Event getEvent(int idx) {
! return (Event) this.events.get(idx);
}
--- 111,116 ----
*@return the collection of events
*/
! public Event getEvent( int idx ) {
! return (Event) this.events.get( idx );
}
***************
*** 121,130 ****
*@param evt The event to add
*/
! public void add(Event evt) {
! if(!this.types.contains(evt.getType())) {
! this.types.add(evt.getType());
}
! this.events.add(evt);
}
--- 121,130 ----
*@param evt The event to add
*/
! public void add( Event evt ) {
! if ( !this.types.contains( evt.getType() ) ) {
! this.types.add( evt.getType() );
}
! this.events.add( evt );
}
***************
*** 145,153 ****
*@param evts the events to add
*/
! public void addAll(Events evts) {
Iterator iter = evts.getEvents().iterator();
! while(iter.hasNext()) {
! this.add((Event) iter.next());
}
}
--- 145,153 ----
*@param evts the events to add
*/
! public void addAll( Events evts ) {
Iterator iter = evts.getEvents().iterator();
! while ( iter.hasNext() ) {
! this.add( (Event) iter.next() );
}
}
***************
*** 164,176 ****
*@param conf the vonfiguration for these events
*/
! public void addAll(Events evts, EventParserConfiguration conf) {
Iterator iter = evts.getEvents().iterator();
Event evt;
! while(iter.hasNext()) {
evt = (Event) iter.next();
! if(!contains(evt, conf)) {
! this.add(evt);
}
}
--- 164,176 ----
*@param conf the vonfiguration for these events
*/
! public void addAll( Events evts, EventParserConfiguration conf ) {
Iterator iter = evts.getEvents().iterator();
Event evt;
! while ( iter.hasNext() ) {
evt = (Event) iter.next();
! if ( !contains( evt, conf ) ) {
! this.add( evt );
}
}
***************
*** 188,205 ****
* allready
*/
! public boolean contains(Event evt, EventParserConfiguration conf) {
// indicates if an element that is equal does NOT exist
boolean contains = false;
// indicates if the parts tested so far are equal
boolean partsAreEqual = true;
! Iterator events = this.getEventsByType(evt.getType()).iterator();
Event existingEvt;
Iterator parts;
String strPartName;
! while(events.hasNext() & !contains) {
! parts = conf.getDuplicateDetectionParts(evt.getType());
! if(parts.hasNext()) {
partsAreEqual = true;
} else {
--- 188,205 ----
* allready
*/
! public boolean contains( Event evt, EventParserConfiguration conf ) {
// indicates if an element that is equal does NOT exist
boolean contains = false;
// indicates if the parts tested so far are equal
boolean partsAreEqual = true;
! Iterator events = this.getEventsByType( evt.getType() ).iterator();
Event existingEvt;
Iterator parts;
String strPartName;
! while ( events.hasNext() & !contains ) {
! parts = conf.getDuplicateDetectionParts( evt.getType() );
! if ( parts.hasNext() ) {
partsAreEqual = true;
} else {
***************
*** 208,215 ****
existingEvt = (Event) events.next();
! while(parts.hasNext()) {
strPartName = (String) parts.next();
! partsAreEqual = arePartsEqual(evt.getPart(strPartName),
! existingEvt.getPart(strPartName))
& partsAreEqual;
}
--- 208,215 ----
existingEvt = (Event) events.next();
! while ( parts.hasNext() ) {
strPartName = (String) parts.next();
! partsAreEqual = arePartsEqual( evt.getPart( strPartName ),
! existingEvt.getPart( strPartName ) )
& partsAreEqual;
}
***************
*** 229,234 ****
*@return true if the parts are equal
*/
! protected boolean arePartsEqual(String partValue1, String partValue2) {
! return partValue1.equals(partValue2);
}
--- 229,234 ----
*@return true if the parts are equal
*/
! protected boolean arePartsEqual( String partValue1, String partValue2 ) {
! return partValue1.equals( partValue2 );
}
***************
*** 250,254 ****
*@return an ArrayList of all events of the supplied type
*/
! public ArrayList getEventsByType(String strType) {
ArrayList result = new ArrayList();
Event evt;
--- 250,254 ----
*@return an ArrayList of all events of the supplied type
*/
! public ArrayList getEventsByType( String strType ) {
ArrayList result = new ArrayList();
Event evt;
***************
*** 256,264 ****
Iterator li = events.iterator();
! while(li.hasNext()) {
evt = (Event) li.next();
! if(evt.getType().equals(strType)) {
! result.add(evt);
}
}
--- 256,264 ----
Iterator li = events.iterator();
! while ( li.hasNext() ) {
evt = (Event) li.next();
! if ( evt.getType().equals( strType ) ) {
! result.add( evt );
}
}
***************
*** 269,273 ****
/**
! * Getter for property UID.
*
*@return Value of property UID.
--- 269,273 ----
/**
! * Getter for the unique identifier for this groups of events
*
*@return Value of property UID.
***************
*** 279,287 ****
/**
! * Setter for property UID.
*
*@param uid New value of property UID.
*/
! public void setUID(String uid) {
this.uid = uid;
}
--- 279,287 ----
/**
! * Setter for the unique identifier for this groups of events
*
*@param uid New value of property UID.
*/
! public void setUID( String uid ) {
this.uid = uid;
}
***************
*** 303,307 ****
*@param srcData New value of property srcData.
*/
! public void setSrcData(String srcData) {
this.srcData = srcData;
}
--- 303,307 ----
*@param srcData New value of property srcData.
*/
! public void setSrcData( String srcData ) {
this.srcData = srcData;
}
***************
*** 316,330 ****
*/
public Document toXMLDoc() throws ParserConfigurationException {
! Document doc = XMLUtils.createXMLDoc("events");
Element root = doc.getDocumentElement();
! Element elem = doc.createElement("uid");
! Text text = doc.createTextNode(this.getUID());
! elem.appendChild(text);
! root.appendChild(elem);
! elem = doc.createElement("srcData");
! text = doc.createTextNode(this.getSrcData());
! elem.appendChild(text);
! root.appendChild(elem);
Enumeration evtTypes = this.getTypes();// all types of events
--- 316,330 ----
*/
public Document toXMLDoc() throws ParserConfigurationException {
! Document doc = XMLUtils.createXMLDoc( "events" );
Element root = doc.getDocumentElement();
! Element elem = doc.createElement( "uid" );
! Text text = doc.createTextNode( this.getUID() );
! elem.appendChild( text );
! root.appendChild( elem );
! elem = doc.createElement( "srcData" );
! text = doc.createTextNode( this.getSrcData() );
! elem.appendChild( text );
! root.appendChild( elem );
Enumeration evtTypes = this.getTypes();// all types of events
***************
*** 333,343 ****
Event evt;// event currently being processed
! while(evtTypes.hasMoreElements()) {
strType = (String) evtTypes.nextElement();
! typeEvts = this.getEventsByType(strType);
! for(int i = 0; i < typeEvts.size(); i++) {
! evt = (Event) typeEvts.get(i);
! evt.appendXMLTo(doc);
}
}
--- 333,343 ----
Event evt;// event currently being processed
! while ( evtTypes.hasMoreElements() ) {
strType = (String) evtTypes.nextElement();
! typeEvts = this.getEventsByType( strType );
! for ( int i = 0; i < typeEvts.size(); i++ ) {
! evt = (Event) typeEvts.get( i );
! evt.appendXMLTo( doc );
}
}
|
|
From: <rga...@us...> - 2002-11-10 15:10:53
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring
In directory usw-pr-cvs1:/tmp/cvs-serv7362
Modified Files:
TestScores.java
Log Message:
Correct error in the extending class name
Index: TestScores.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring/TestScores.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestScores.java 9 Nov 2002 20:21:42 -0000 1.2
--- TestScores.java 10 Nov 2002 15:10:47 -0000 1.3
***************
*** 64,68 ****
*@created 09 November 2002
*/
! public class TestScores extends xmlunit.XMLTestCase {
/** Instance of tested class. */
protected Scores varScores;
--- 64,68 ----
*@created 09 November 2002
*/
! public class TestScores extends XMLTestCase {
/** Instance of tested class. */
protected Scores varScores;
|
|
From: <rga...@us...> - 2002-11-10 15:07:11
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/prefs
In directory usw-pr-cvs1:/tmp/cvs-serv5225
Added Files:
TestPreferenceManager.java
Log Message:
Initial test class for the preference manager
--- NEW FILE: TestPreferenceManager.java ---
package org.fanfoot.prefs;
import java.awt.AWTEvent;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.WindowEvent;
import junit.extensions.*;
import junit.framework.*;
/*
* @author rgardler
* @created 09 November 2002
*/
public class TestPreferenceManager extends TestCase {
/** Instance of tested class. */
protected PreferenceManager varPreferenceManager;
/**
* Public constructor for creating testing class.
*
*@param name Description of the Parameter
*/
public TestPreferenceManager( String name ) {
super( name );
}// 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 );
varPreferenceManager = new org.fanfoot.prefs.PreferenceManager();
}// 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
* get(java.lang.String, java.lang.String) from tested class
*/
public void testGet() {
}// end of testGet(java.lang.String, java.lang.String)
/**
* Method for testing how works original method:
* org.saafe.ui.gui.prefs.PreferencesEditor
* getEditorDialog(java.lang.String, java.awt.Frame) from tested
* class
*/
public void testGetEditorDialog() {
}// end of testGetEditorDialog(java.lang.String, java.awt.Frame)
/**
* Method for testing how works original method: void set( ... )
* from tested class
*/
public void testSet() {
}// end of TestPreferenceManager(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( TestPreferenceManager.class );
}
}
|
|
From: <rga...@us...> - 2002-11-10 15:00:30
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/db
In directory usw-pr-cvs1:/tmp/cvs-serv1281
Added Files:
TestPlayers.java
Log Message:
Initial creation of access classes for the database
--- NEW FILE: TestPlayers.java ---
package org.fanfoot.db;
import java.awt.AWTEvent;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.WindowEvent;
import junit.extensions.*;
import junit.framework.*;
import org.custommonkey.xmlunit.XMLTestCase;
import org.custommonkey.xmlunit.XMLUnit;
import org.w3c.dom.Node;
/*
* @author rgardler
* @created 09 November 2002
*/
public class TestPlayers extends XMLTestCase {
/** Instance of tested class. */
protected Players varPlayers;
/** 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";
/** A valid game ID */
protected String validGameID =
"_Saturday, 9 November, 2002_Barclaycard Premiership_Arsenal_Newcastle United";
/**
* Public constructor for creating testing class.
*
*@param name Description of the Parameter
*/
public TestPlayers( String name ) {
super( name );
}// 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() {
XMLUnit.setIgnoreWhitespace( true );
try {
varPlayers = new org.fanfoot.db.Players();
} catch ( DBException dbe ) {
dbe.printStackTrace();
fail( "Cannot create players object" );
}
}// end of suite()
/**
* 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 );
}
/**
* 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( TestPlayers.class );
}
}
|
|
From: <rga...@us...> - 2002-11-10 15:00:19
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/db In directory usw-pr-cvs1:/tmp/cvs-serv1158 Added Files: Players.java DBException.java Log Message: Initial creation of access classes for the database --- NEW FILE: Players.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 org.saafe.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * Provides access to the player information in the database. * *@author rgardler *@created 7 November 2002 */ 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 ); } } /** * Get the player associated with the supplied id. * *@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; } /** * Get the scoring events associated with the given game and the * given player. * *@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 *@throws DBException if the player cannot be found */ public Element getPlayerScoringEvents( String playerID, String gameID ) throws DBException { Element player = getPlayer( playerID ); NodeList ndl = player.getElementsByTagName( "scoringEvents" ); Element scoringEvents = (Element) ndl.item( 0 ); ndl = scoringEvents.getElementsByTagName( "game" ); Element elem = null; for ( int i = 0; i < ndl.getLength(); i++ ) { elem = (Element) ndl.item( i ); if ( elem.getAttribute( "id" ).equals( gameID ) ) { break; } else { elem = null; } } return elem; } } --- NEW FILE: DBException.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 ***** */ /* * DBException.java * */ package org.fanfoot.db; /** *@author rgardler *@created 09 November 2002 */ public class DBException extends java.lang.Exception { /** The root exception leading to this one */ Exception root = null; /** * Message used when an attempt is made to retrieve a player with a * non-existent ID */ public static String UNRECOGNISED_ID_MESSAGE = "No player with the ID exists: ID = "; /** * Creates a new instance of <code>DBException</code> without * detail message. */ public DBException() { } /** * Constructs an instance of <code>DBException</code> with the * specified detail message. * *@param msg the detail message. */ public DBException( String msg ) { super( msg ); } /** * Constructs an instance of <code>DBExcepotion</code> with the * specified detail message and the root exception supplied * *@param msg the detail message. *@param e the root exception */ public DBException( String msg, Exception e ) { super( msg ); root = e; } /** Print the stack trace of the nested exception */ public void printStackTrace() { System.out.println( this.getMessage() ); System.out.println( "Nested Exception:" ); root.printStackTrace(); } } |
|
From: <rga...@us...> - 2002-11-10 14:56:20
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/db In directory usw-pr-cvs1:/tmp/cvs-serv31273/db Log Message: Directory /cvsroot/csms/csms-core/src/test/src/org/fanfoot/db added to the repository |
|
From: <rga...@us...> - 2002-11-10 14:56:04
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/prefs In directory usw-pr-cvs1:/tmp/cvs-serv31050/prefs Log Message: Directory /cvsroot/csms/csms-core/src/test/src/org/fanfoot/prefs added to the repository |
|
From: <rga...@us...> - 2002-11-10 14:55:00
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/db In directory usw-pr-cvs1:/tmp/cvs-serv30377/db Log Message: Directory /cvsroot/csms/csms-core/src/java/org/fanfoot/db added to the repository |
|
From: <rga...@us...> - 2002-11-10 14:51:29
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv28139
Modified Files:
ScoringConfig.xsl Scores2HTML.xsl
Log Message:
Changed the DTD of the scores.xml document to better suit later work with the data within it.
Index: ScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/ScoringConfig.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ScoringConfig.xsl 4 Nov 2002 22:49:34 -0000 1.6
--- ScoringConfig.xsl 10 Nov 2002 14:51:25 -0000 1.7
***************
*** 37,40 ****
--- 37,41 ----
<!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
<xsl:call-template name="goalsConceeded" />
+
<xsl:call-template name="ownGoalsConceeded" />
***************
*** 398,418 ****
</xsl:variable>
! <xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
</xsl:with-param>
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
!
<!-- =========================================================================== -->
<!-- FIXME: The goalsconceeded and ownGoalsConceeded templates are very similar -->
--- 399,422 ----
</xsl:variable>
! <xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes" />
</xsl:with-param>
+
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID" />
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
!
<!-- =========================================================================== -->
<!-- FIXME: The goalsconceeded and ownGoalsConceeded templates are very similar -->
***************
*** 420,424 ****
<!-- of the initial parameters needs to be different -->
<!-- =========================================================================== -->
-
<!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
<xsl:template name="ownGoalsConceeded">
--- 424,427 ----
***************
*** 455,459 ****
</xsl:choose>
</xsl:variable>
!
<xsl:variable name="scoringTeamID">
<xsl:call-template name="getTeamID">
--- 458,462 ----
</xsl:choose>
</xsl:variable>
!
<xsl:variable name="scoringTeamID">
<xsl:call-template name="getTeamID">
***************
*** 463,653 ****
</xsl:call-template>
</xsl:variable>
!
<xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
</xsl:with-param>
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
! </xsl:template>
!
<!-- Deduct points from defenders and goalkeepers who have conceeded a goal -->
! <xsl:template name="deductDefenderPoints">
! <xsl:param name="goalMinutes"/>
! <xsl:param name="scoringTeam"/>
! <xsl:param name="conceedingTeam"/>
! <xsl:param name="conceedingTeamID"/>
! <xsl:for-each
! select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="starts-with($scoringTeam, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct conceeded goal points from ', $playerFullName, ' of ', $conceedingTeam, ' because cannot identify scoring team (', $scoringTeam, ')')" />
! </error>
! </xsl:when>
! <xsl:when test="starts-with($playerFullName, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct goalkeepers/defenders conceeding points for ', $playerFullName, ' of ', $conceedingTeam)" />
! </error>
! </xsl:when>
! <xsl:otherwise>
<!-- get player start time -->
! <xsl:variable name="onMinutes">
! <xsl:choose>
<!-- if the player was a teamStarter then start time is 00:00 -->
! <xsl:when test="self::node()[type='teamStarter']">
! 00</xsl:when>
<!-- if player was a teamSubstitute and they were subbed on then start time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOn=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOn=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the player did not play at all -->
! <xsl:otherwise>Did Not Play</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- get stop time -->
! <xsl:variable name="offMinutes">
! <xsl:choose>
<!-- if the player was subbed off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOff=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOff=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- if the player was sent off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='sendingOff' and player=$playerFullName]">
! <xsl:value-of
! select="//event[type='sendingOff' and player=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the stop time was 90:00 -->
! <xsl:otherwise>90</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- test to see if the player was on the pitch when the goal was scored -->
! <xsl:if test="$onMinutes != 'Did Not Play'">
! <xsl:if
! test="$goalMinutes < $offMinutes and $goalMinutes > $onMinutes">
! <xsl:variable name="playerPosition">
! <xsl:call-template name="getPlayerPosition">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="$playerPosition = 'Goalkeeper'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Goalkeeper Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Full Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Full Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Centre Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Centre Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Midfield'">
! </xsl:when>
! <xsl:when test="$playerPosition = 'Forward'">
! </xsl:when>
! <xsl:otherwise>
! <error>
! <xsl:value-of
! select="concat('Unable to determine player position to deduct conceeded goal points (', $playerFullName, ' of ', $conceedingTeam, ')')" />
! </error>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:if>
</xsl:if>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
--- 466,662 ----
</xsl:call-template>
</xsl:variable>
!
<xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes" />
</xsl:with-param>
+
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID" />
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
! </xsl:template>
!
<!-- Deduct points from defenders and goalkeepers who have conceeded a goal -->
! <xsl:template name="deductDefenderPoints">
! <xsl:param name="goalMinutes" />
! <xsl:param name="scoringTeam" />
! <xsl:param name="conceedingTeam" />
! <xsl:param name="conceedingTeamID" />
! <xsl:for-each
! select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
!
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:choose>
! <xsl:when test="starts-with($scoringTeam, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct conceeded goal points from ', $playerFullName, ' of ', $conceedingTeam, ' because cannot identify scoring team (', $scoringTeam, ')')" />
! </error>
! </xsl:when>
!
! <xsl:when test="starts-with($playerFullName, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct goalkeepers/defenders conceeding points for ', $playerFullName, ' of ', $conceedingTeam)" />
! </error>
! </xsl:when>
!
! <xsl:otherwise>
<!-- get player start time -->
! <xsl:variable name="onMinutes">
! <xsl:choose>
<!-- if the player was a teamStarter then start time is 00:00 -->
! <xsl:when test="self::node()[type='teamStarter']">00</xsl:when>
<!-- if player was a teamSubstitute and they were subbed on then start time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOn=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOn=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the player did not play at all -->
! <xsl:otherwise>Did Not Play</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- get stop time -->
! <xsl:variable name="offMinutes">
! <xsl:choose>
<!-- if the player was subbed off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOff=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOff=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- if the player was sent off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='sendingOff' and player=$playerFullName]">
! <xsl:value-of
! select="//event[type='sendingOff' and player=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the stop time was 90:00 -->
! <xsl:otherwise>90</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- test to see if the player was on the pitch when the goal was scored -->
! <xsl:if test="$onMinutes != 'Did Not Play'">
! <xsl:if
! test="$goalMinutes < $offMinutes and $goalMinutes > $onMinutes">
! <xsl:variable name="playerPosition">
! <xsl:call-template name="getPlayerPosition">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="$playerPosition = 'Goalkeeper'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Goalkeeper Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Full Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Full Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Centre Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Centre Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Midfield'">
! </xsl:when>
! <xsl:when test="$playerPosition = 'Forward'">
! </xsl:when>
! <xsl:otherwise>
! <error>
! <xsl:value-of
! select="concat('Unable to determine player position to deduct conceeded goal points (', $playerFullName, ' of ', $conceedingTeam, ')')" />
! </error>
! </xsl:otherwise>
! </xsl:choose>
</xsl:if>
! </xsl:if>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
***************
*** 756,759 ****
--- 765,769 ----
<xsl:template name="getPlayerPosition">
<xsl:param name="playerSurname" />
+
<xsl:param name="teamID" />
***************
*** 935,940 ****
<xsl:param name="playerName" />
- <xsl:param name="playersTeam" />
-
<xsl:param name="points" />
--- 945,948 ----
***************
*** 946,958 ****
</xsl:attribute>
- <xsl:attribute name="team">
- <xsl:value-of select="$playersTeam" />
- </xsl:attribute>
-
- <points>
- <xsl:value-of select="$points" />
- </points>
-
<event>
<type>
<xsl:value-of select="$eventType" />
--- 954,962 ----
</xsl:attribute>
<event>
+ <points>
+ <xsl:value-of select="$points" />
+ </points>
+
<type>
<xsl:value-of select="$eventType" />
Index: Scores2HTML.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/Scores2HTML.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Scores2HTML.xsl 28 Oct 2002 13:54:22 -0000 1.1
--- Scores2HTML.xsl 10 Nov 2002 14:51:25 -0000 1.2
***************
*** 45,49 ****
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="sum(/scores/player[@name=$name]/points)"/></td>
</tr>
</xsl:template>
--- 45,49 ----
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/></td>
</tr>
</xsl:template>
***************
*** 59,63 ****
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@name=$name]/points)"/>
</th>
</tr>
--- 59,63 ----
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/>
</th>
</tr>
***************
*** 68,72 ****
<tr>
<td><xsl:value-of select="event/type"/></td>
! <td><xsl:value-of select="points"/></td>
</tr>
</xsl:template>
--- 68,72 ----
<tr>
<td><xsl:value-of select="event/type"/></td>
! <td><xsl:value-of select="event/points"/></td>
</tr>
</xsl:template>
|
|
From: <rga...@us...> - 2002-11-09 21:42:48
|
Update of /cvsroot/csms/csms-core
In directory usw-pr-cvs1:/tmp/cvs-serv25705
Modified Files:
build.xml
Log Message:
Made the name of the class executed in the run target a parameter so that it can be overridden in the command line
Index: build.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/build.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** build.xml 3 Nov 2002 17:42:39 -0000 1.4
--- build.xml 9 Nov 2002 21:42:45 -0000 1.5
***************
*** 41,44 ****
--- 41,45 ----
<property name="project.work.dir" value="${build.dir}/${project.name}/work" />
<property name="project.src.dir" value="${src.dir}/java" />
+ <property name="project.test.src.dir" value="${src.dir}/test/src" />
<target name="compile" description="Compile all files">
***************
*** 70,74 ****
</classpath>
</javac>
!
<!-- copy all the things that are not classes to the classes dir -->
<copy todir="${project.build.dir}/classes" filtering="off">
--- 71,75 ----
</classpath>
</javac>
!
<!-- copy all the things that are not classes to the classes dir -->
<copy todir="${project.build.dir}/classes" filtering="off">
***************
*** 83,87 ****
<target name="run" description="Run the CSMS core system" depends="compile">
! <java classname="org.fanfoot.gui.ControlCentre" fork="yes">
<classpath>
<pathelement path="${project.build.dir}/classes"/>
--- 84,89 ----
<target name="run" description="Run the CSMS core system" depends="compile">
! <property name="csms.execute.class.name" value="org.fanfoot.gui.ControlCentre"/>
! <java classname="${csms.execute.class.name}" fork="yes">
<classpath>
<pathelement path="${project.build.dir}/classes"/>
|
|
From: <rga...@us...> - 2002-11-09 20:21:45
|
Update of /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring In directory usw-pr-cvs1:/tmp/cvs-serv15578 Modified Files: TestScores.java TestEvent.java Log Message: Remove deprecated method calls and tidy up code layout Index: TestScores.java =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring/TestScores.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestScores.java 18 Oct 2002 15:06:19 -0000 1.1 --- TestScores.java 9 Nov 2002 20:21:42 -0000 1.2 *************** *** 1,14 **** /* ! * 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$ ! * $Author$ ! * $Date$ */ package org.fanfoot.scoring; --- 1,14 ---- /* ! * 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$ ! * $Author$ ! * $Date$ */ package org.fanfoot.scoring; *************** *** 18,207 **** 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 --- 18,204 ---- import java.awt.event.AWTEventListener; import java.awt.event.WindowEvent; import junit.extensions.*; import junit.framework.*; ! 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 xmlunit.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" ); ! /** ! * Public constructor for creating testing class. ! * ! *@param name Description of the Parameter ! */ ! public TestScores( String name ) { ! super( name ); ! }// 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() { ! 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 { ! varScores = new Scores( evts, sc ); ! } catch ( Exception e ) { ! fail( "Unable to set up the scores object: " + e ); ! } ! }// 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 } + } ! /** ! * 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) ! ! ! /** ! * 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( TestScores.class ); ! }// end of testSetScoresDocument9554056(org.w3c.dom.Document) ! } Index: TestEvent.java =================================================================== RCS file: /cvsroot/csms/csms-core/src/test/src/org/fanfoot/scoring/TestEvent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestEvent.java 18 Oct 2002 15:06:18 -0000 1.1 --- TestEvent.java 9 Nov 2002 20:21:42 -0000 1.2 *************** *** 1,76 **** /* ! * 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$ ! * $Author$ ! * $Date$ */ 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"; --- 1,72 ---- /* ! * 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$ ! * $Author$ ! * $Date$ */ 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.*; + import org.custommonkey.xmlunit.XMLTestCase; + import org.custommonkey.xmlunit.XMLUnit; /** ! * 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> ! * ! * ! *@author rgardler ! *@created 09 November 2002 */ ! public class TestEvent extends XMLTestCase { ! /** Instance of tested class. */ protected Event varEvent; ! // Control XML docs String strType = "test"; *************** *** 81,266 **** 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 --- 77,268 ---- 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. ! * ! *@param name Description of the Parameter */ ! public TestEvent( String name ) { ! super( name ); ! }// 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() { ! XMLUnit.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 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 TestEvent(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( TestEvent.class ); ! }// end of testToXMLDoc() ! ! } |
|
From: <rga...@us...> - 2002-11-07 14:11:47
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv20544
Modified Files:
footballEvents.xml
Log Message:
Now detects goals that are not reported in the first line of the commentary (bug 634623)
Index: footballEvents.xml
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/footballEvents.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** footballEvents.xml 4 Nov 2002 21:32:55 -0000 1.8
--- footballEvents.xml 7 Nov 2002 14:11:42 -0000 1.9
***************
*** 73,77 ****
<part name="injuryTimeSeconds">\d?\d?</part>
<unwantedPart>\)?</unwantedPart>
! <unwantedPart>[A-Za-z\d\s-]*\.(?:[^Oo](?![Oo]wn))*[Gg]oal\sby\s</unwantedPart>
<part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
</pattern>
--- 73,77 ----
<part name="injuryTimeSeconds">\d?\d?</part>
<unwantedPart>\)?</unwantedPart>
! <unwantedPart>(?:.(?!\d\d:\d\d)(?![Oo]wn\s[Gg]oal))*[Gg]oal\sby\s</unwantedPart>
<part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
</pattern>
***************
*** 98,102 ****
<part name="injuryTimeSeconds">\d?\d?</part>
<unwantedPart>\)?</unwantedPart>
! <unwantedPart>(?:[^\.]*\.)*[A-Za-z\s]*[Oo]wn\sgoal\sby\s</unwantedPart>
<part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
</pattern>
--- 98,102 ----
<part name="injuryTimeSeconds">\d?\d?</part>
<unwantedPart>\)?</unwantedPart>
! <unwantedPart>\d\d:\d\d(?:.(?!\d\d:\d\d))*[Oo]wn\s[Gg]oal\sby\s</unwantedPart>
<part name="player">(?:(?:[Mac|Mc|A-Z][a-z]*\s)(?!\d)){1,3}</part>
</pattern>
***************
*** 151,155 ****
</pattern>
</event>
!
<event type="booking">
<duplicateDetection>
--- 151,155 ----
</pattern>
</event>
! g
<event type="booking">
<duplicateDetection>
|
|
From: <rga...@us...> - 2002-11-06 22:11:51
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/prefs
In directory usw-pr-cvs1:/tmp/cvs-serv14619
Modified Files:
PreferenceManager.java
Log Message:
Making default config file settings for CVS version of the application the relevant config files in CVS. This means that unless the user has edited these settings locally they will always be pointing at the latest config files.
Index: PreferenceManager.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/prefs/PreferenceManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PreferenceManager.java 3 Nov 2002 21:02:17 -0000 1.2
--- PreferenceManager.java 6 Nov 2002 22:11:47 -0000 1.3
***************
*** 103,119 ****
private void initAutoScorerPrefs() {
Preferences prefs = userPrefs.node( AUTO_SCORER_CLASS );
if ( prefs.get( AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY, null ) == null ) {
prefs.put( AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY,
! "http://www.fanfoot.com/test/footballEvents.xml" );
}
if ( prefs.get( AUTO_SCORER_SCORES_CONFIGURATION_FILE_KEY,
null ) == null ) {
prefs.put( AUTO_SCORER_SCORES_CONFIGURATION_FILE_KEY,
! "http://www.fanfoot.com/test/ScoringConfig.xsl" );
}
if ( prefs.get( AUTO_SCORER_SCORES_TO_HTML_STYLESHEET_KEY,
null ) == null ) {
prefs.put( AUTO_SCORER_SCORES_TO_HTML_STYLESHEET_KEY,
! "http://www.fanfoot.com/test/Scores2HTML.xsl" );
}
}
--- 103,123 ----
private void initAutoScorerPrefs() {
Preferences prefs = userPrefs.node( AUTO_SCORER_CLASS );
+ /** The path from which default fiules are retrieved */
+ String strConfigPath = "http://cvs.sourceforge.net"
+ + "/cgi-bin/viewcvs.cgi/*checkout*/csms/csms-core"
+ + "/src/resources/conf/";
if ( prefs.get( AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY, null ) == null ) {
prefs.put( AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY,
! strConfigPath + "footballEvents.xml?rev=HEAD&content-type=text/xml" );
}
if ( prefs.get( AUTO_SCORER_SCORES_CONFIGURATION_FILE_KEY,
null ) == null ) {
prefs.put( AUTO_SCORER_SCORES_CONFIGURATION_FILE_KEY,
! strConfigPath + "ScoringConfig.xsl?rev=HEAD" );
}
if ( prefs.get( AUTO_SCORER_SCORES_TO_HTML_STYLESHEET_KEY,
null ) == null ) {
prefs.put( AUTO_SCORER_SCORES_TO_HTML_STYLESHEET_KEY,
! strConfigPath + "Scores2HTML.xsl?rev=HEAD" );
}
}
***************
*** 139,175 ****
String strResult = null;
strResult = userPrefs.node( strClass ).get( strName, null );
- return strResult;
- }
-
-
- /**
- * Get the default value for the preference indicated for this
- * version of the software. @ param strKey the key of the
- * preference requried
- *
- *@param strKey Description of the Parameter
- *@return The default value
- *@refactor The names of preferences should be in a hashtable or
- * something as they are duplicated here and in the
- * org.fanfoot.prefs.gui.preferenceEditor
- */
- public String getDefault( String strKey ) {
- String strResult = null;
- logger.fine( "Processing request for " + strKey );
- /** The path from which default fiules are retrieved */
- String strConfigPath = "http://www.fanfoot.com/test/";
- if ( strKey.equals( this.AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY
- + this.AUTO_SCORER_SCORES_CONFIGURATION_FILE_KEY ) ) {
- strResult = strConfigPath + "ScoringConfig.xsl";
- } else if ( strKey.equals( this.AUTO_SCORER_CLASS
- + this.AUTO_SCORER_EVENT_CONFIGURATION_FILE_KEY ) ) {
- strResult = strConfigPath + "footballEvents.xml";
- } else if ( strKey.equals( this.AUTO_SCORER_CLASS
- + this.AUTO_SCORER_SCORES_TO_HTML_STYLESHEET_KEY ) ) {
- strResult = strConfigPath + "Scores2HTML.xsl";
- } else if ( strKey.equals( "org/fanfoot/gui/ControlCentre/debug" ) ) {
- strResult = "false";
- }
- logger.fine( "Returning value: " + strResult );
return strResult;
}
--- 143,146 ----
|