* patches to ensure names w/ extra spaces are recognized
@ 2006-01-01 23:11 Raif S. Naffah
2006-01-02 12:29 ` Mark Wielaard
0 siblings, 1 reply; 3+ messages in thread
From: Raif S. Naffah @ 2006-01-01 23:11 UTC (permalink / raw)
To: mauve-discuss
[-- Attachment #1.1: Type: text/plain, Size: 658 bytes --]
hello there,
pls find attached a patch to existing MessageDigest.getInstance14.java
and a new Engine.getInstance file to ensure that Provider, Service and
Algorithm names should be recognized even when they contain extra space
characters.
the corresponding ChangeLog entry follows:
2006-01-02 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/testlet/java/security/MessageDigest/getInstance14.java (test):
Corrected string literal used in harness.checkPoint().
Added 2 new testcases to test passing Provider and Algorithm names with
extra spaces.
* gnu/testlet/java/security/Engine/getInstance.java: new file.
--
cheers;
rsn
[-- Attachment #1.2: mauve-20060102.patch --]
[-- Type: text/x-diff, Size: 5054 bytes --]
Index: getInstance14.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/security/MessageDigest/getInstance14.java,v
retrieving revision 1.2
diff -u -r1.2 getInstance14.java
--- getInstance14.java 7 Apr 2003 15:42:11 -0000 1.2
+++ getInstance14.java 1 Jan 2006 22:50:50 -0000
@@ -25,6 +25,8 @@
package gnu.testlet.java.security.MessageDigest;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
+
+import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.Provider;
import java.security.NoSuchAlgorithmException;
@@ -43,7 +45,7 @@
public void test (TestHarness harness)
{
- harness.checkPoint ("KeyPairGenerator");
+ harness.checkPoint ("MessageDigest");
MessageDigest spi;
Provider provider = this;
@@ -51,6 +53,19 @@
String signature;
spi = null;
+ signature = "getInstance(\"foo\", \" MessageDigest \")";
+ try
+ {
+ spi = MessageDigest.getInstance("foo", " MessageDigest ");
+ harness.check(spi != null, signature);
+ }
+ catch (GeneralSecurityException x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+
+ spi = null;
signature = "getInstance(\"foo\", provider)";
try
{
@@ -64,6 +79,19 @@
}
spi = null;
+ signature = "getInstance(\" foo \", provider)";
+ try
+ {
+ spi = MessageDigest.getInstance(" foo ", provider);
+ harness.check(spi != null, signature);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+
+ spi = null;
signature = "getInstance(\"FOO\", provider)";
try
{
Index: gnu/testlet/java/security/Engine/getInstance.java
===================================================================
RCS file: gnu/testlet/java/security/Engine/getInstance.java
diff -N gnu/testlet/java/security/Engine/getInstance.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/testlet/java/security/Engine/getInstance.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,106 @@
+/* getInstance.java -- Ensure names with extra spaces are recognized
+ Copyright (C) 2006 Free Software Foundation, Inc.
+This file is part of Mauve.
+
+Mauve is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+Mauve is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mauve; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+*/
+
+// Tags: JDK1.4
+// Uses: MauveDigest
+
+package gnu.testlet.java.security.Engine;
+
+import gnu.java.security.Engine;
+import gnu.testlet.TestHarness;
+import gnu.testlet.Testlet;
+
+import java.security.Provider;
+import java.security.Security;
+
+public class getInstance extends Provider implements Testlet
+{
+ public getInstance()
+ {
+ super("FakeProvider", 1.0, "");
+
+ put("MessageDigest.foo",
+ "gnu.testlet.java.security.MessageDigest.MauveDigest");
+ put("Alg.Alias.MessageDigest.bar", "foo");
+ }
+
+ public void test (TestHarness harness)
+ {
+ harness.checkPoint ("Engine");
+
+ Provider provider = this;
+ Security.addProvider(provider);
+ String signature;
+
+ signature = "getInstance(\"MessageDigest\", \"foo\", provider)";
+ try
+ {
+ harness.check(
+ Engine.getInstance("MessageDigest", "foo", provider) != null,
+ signature);
+ }
+ catch (Exception x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+
+ signature = "getInstance(\" MessageDigest \", \"foo\", provider)";
+ try
+ {
+ harness.check(
+ Engine.getInstance(" MessageDigest ", "foo", provider) != null,
+ signature);
+ }
+ catch (Exception x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+
+ signature = "getInstance(\"MessageDigest\", \" foo \", provider)";
+ try
+ {
+ harness.check(
+ Engine.getInstance("MessageDigest", " foo ", provider) != null,
+ signature);
+ }
+ catch (Exception x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+
+ signature = "getInstance(\" MessageDigest \", \" foo \", provider)";
+ try
+ {
+ harness.check(
+ Engine.getInstance(" MessageDigest ", " foo ", provider) != null,
+ signature);
+ }
+ catch (Exception x)
+ {
+ harness.fail(signature);
+ harness.debug(x);
+ }
+ }
+}
+
[-- Attachment #2: Type: application/pgp-signature, Size: 216 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-02 14:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-01 23:11 patches to ensure names w/ extra spaces are recognized Raif S. Naffah
2006-01-02 12:29 ` Mark Wielaard
2006-01-02 14:10 ` Raif S. Naffah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).