[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tsik-dev
Subject:    Fixed unit test failure
From:       "Bradley Ward" <bward () coindata ! com>
Date:       2005-10-20 17:39:46
Message-ID: 678B83CDCB41394F910C0FDAFC42AE3E019CEA69 () SERVER ! webbizcorp ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


OK, while waiting on Visual Studio to load (ugh), I took a look at a
unit test that was failing on my machine. It was the
Regress1Tests.verifySignature method in the
trunk\test\src\org\apache\tsik\xmlenc\test package. It was failing
because it expected to get an error message that contained an expiration
time in PST, but since I'm in Atlanta, it was getting an expiration time
in EST.

 

I took the expected failure date (a fixed string in PST), ran it through
SimpleDateFormatter and adjusted the time to the local time zone, then
produced the message we expect to see (instead of hard codeing the
expected message text as before). I ran the unit tests and they now all
pass.

 

The modified source file and the diff output is attached.

 

Thanks,

 

Brad

 

Bradley Ward

Coin Data, LLC

 

 


[Attachment #5 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:st1="urn:schemas-microsoft-com:office:smarttags" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>OK, while waiting on Visual Studio to load (ugh), I took a
look at a unit test that was failing on my machine. It was the \
Regress1Tests.verifySignature method in the \
trunk\test\src\org\apache\tsik\xmlenc\test package. It was failing because it \
expected to get an error message that contained an expiration time in PST, but since \
I&#8217;m in <st1:City w:st="on"><st1:place  \
w:st="on">Atlanta</st1:place></st1:City>, it was getting an expiration time in \
EST.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I took the expected failure date (a fixed string in PST),
ran it through SimpleDateFormatter and adjusted the time to the local time
zone, then produced the message we expect to see (instead of hard codeing the
expected message text as before). I ran the unit tests and they now all \
pass.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The modified source file and the diff output is \
attached.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks,</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Brad</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Bradley Ward</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Coin Data, LLC</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span><o:p></o:p></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>


["diff.txt" (text/plain)]

49a50
> import java.text.SimpleDateFormat;
52a54
> import java.util.Date;
53a56
> import java.util.TimeZone;
128a132
>         
133c137,145
<         String msg = "NotAfter: Thu Feb 20 15:59:59 PST 2003";
---
>         // Construct the message we expect to get, taking
>         // different time zones into consideration:
>         //
>         String expectedDate = "Thu Feb 20 15:59:59 PST 2003";
>         SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
>         Date d = df.parse(expectedDate);
>         df.setTimeZone(TimeZone.getDefault());
>         
>         String msg = "NotAfter: " + df.format(d);

["Regress1Tests.java" (application/octet-stream)]

---------------------------------------------------------------------
To unsubscribe, e-mail: tsik-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tsik-dev-help@ws.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic