[prev in list] [next in list] [prev in thread] [next in thread]
List: tsik-dev
Subject: svn commit: r328973 -
From: hans () apache ! org
Date: 2005-10-27 23:02:50
Message-ID: 20051027230250.22394.qmail () minotaur ! apache ! org
[Download RAW message or body]
Author: hans
Date: Thu Oct 27 16:02:47 2005
New Revision: 328973
URL: http://svn.apache.org/viewcvs?rev=328973&view=rev
Log:
Fix test to work in non-PST/PDT timezones (Bradley Ward [bward@coindata.com])
Modified:
incubator/tsik/trunk/test/src/org/apache/tsik/xmlenc/test/Regress1Tests.java
Modified: incubator/tsik/trunk/test/src/org/apache/tsik/xmlenc/test/Regress1Tests.java
URL: http://svn.apache.org/viewcvs/incubator/tsik/trunk/test/src/org/apache/tsik/xmlenc/test/Regress1Tests.java?rev=328973&r1=328972&r2=328973&view=diff
==============================================================================
--- incubator/tsik/trunk/test/src/org/apache/tsik/xmlenc/test/Regress1Tests.java \
(original)
+++ incubator/tsik/trunk/test/src/org/apache/tsik/xmlenc/test/Regress1Tests.java Thu \
Oct 27 16:02:47 2005 @@ -1,45 +1,34 @@
-// $Id$
+/* $Id$ */
-//
-// (C) Copyright 2005 VeriSign, Inc. All Rights Reserved.
-//
-// VeriSign, Inc. shall have no responsibility, financial or
-// otherwise, for any consequences arising out of the use of
-// this material. The program material is provided on an "AS IS"
-// BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
-// express or implied. The user is responsible for determining
-// any necessary third party rights or authorizations that may
-// be required for the use of the materials. Users are advised
-// that they may need authorizations under certain patents from
-// Microsoft and IBM, or others. Please see notice.txt file.
-// VeriSign disclaims any obligation to notify the user of any
-// such third party rights.
-//
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
package org.apache.tsik.xmlenc.test;
-import org.apache.tsik.datatypes.Base64;
-import org.apache.tsik.resource.ResourceFactory;
-import org.apache.tsik.resource.XMLResource;
-import org.apache.tsik.xmlenc.Decryptor;
-import org.apache.tsik.xmlsig.Signer;
-import org.apache.tsik.xmlsig.Verifier;
-import org.apache.tsik.xpath.XPath;
-import org.apache.tsik.xpath.XPathException;
-import org.apache.tsik.xmlsig.test.Common;
-import org.apache.tsik.xmlsig.tools.KeyConverter;
-
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
-import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.OutputStream;
-
import java.security.Key;
import java.security.KeyStore;
import java.security.PublicKey;
@@ -47,19 +36,29 @@
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
-
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Date;
import java.util.Iterator;
-
+import java.util.TimeZone;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.apache.tsik.datatypes.Base64;
+import org.apache.tsik.resource.ResourceFactory;
+import org.apache.tsik.resource.XMLResource;
import org.apache.tsik.verifier.TrustVerificationException;
import org.apache.tsik.verifier.X509TrustVerifier;
+import org.apache.tsik.xmlenc.Decryptor;
+import org.apache.tsik.xmlsig.Signer;
+import org.apache.tsik.xmlsig.Verifier;
+import org.apache.tsik.xmlsig.test.Common;
+import org.apache.tsik.xmlsig.tools.KeyConverter;
+import org.apache.tsik.xpath.XPath;
+import org.apache.tsik.xpath.XPathException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
public class Regress1Tests extends TestCase
{
@@ -130,7 +129,16 @@
//
// Expect expiration of the cert used in the test.
//
- 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);
try {
trustVerifier.verifyTrust(chain);
fail("expected TrustVerificationException: " + msg);
---------------------------------------------------------------------
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