public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: GConf Preference test small update
@ 2006-06-21 19:23 Mario Torre
  2006-06-21 20:09 ` Mario Torre
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Torre @ 2006-06-21 19:23 UTC (permalink / raw)
  To: mauve-patches


[-- Attachment #1.1: Type: text/plain, Size: 434 bytes --]

Hi have added a simple test:

2006-06-21  neugens  <neugens@limasoftware.net>

	* gnu/testlet/java/util/prefs/PreferenceTest.java (testBoolean): new
test
	method.
	(test): call to enable new test.

Mario

-- 
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/

[-- Attachment #1.2: mauve_preference_test.patch --]
[-- Type: text/x-patch, Size: 2081 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/mauve/mauve/ChangeLog,v
retrieving revision 1.1715
diff -u -r1.1715 ChangeLog
--- ChangeLog	21 Jun 2006 10:02:08 -0000	1.1715
+++ ChangeLog	21 Jun 2006 19:20:44 -0000
@@ -1,3 +1,9 @@
+2006-06-21  neugens  <neugens@limasoftware.net>
+
+	* gnu/testlet/java/util/prefs/PreferenceTest.java (testBoolean): new test
+	method.
+	(test): call to enable new test.
+
 2006-06-21  Gary Benson  <gbenson@redhat.com>
 
 	* gnu/testlet/java/lang/reflect/AccessibleObject/security.java: New test.
Index: gnu/testlet/java/util/prefs/PreferenceTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/util/prefs/PreferenceTest.java,v
retrieving revision 1.1
diff -u -r1.1 PreferenceTest.java
--- gnu/testlet/java/util/prefs/PreferenceTest.java	19 Jun 2006 09:57:34 -0000	1.1
+++ gnu/testlet/java/util/prefs/PreferenceTest.java	21 Jun 2006 19:20:49 -0000
@@ -93,6 +93,7 @@
 
        testPut();
        testByte();
+       testBoolean();
        
        testListener();
        testChildren();
@@ -319,6 +320,35 @@
        }
    }
    
+   private void testBoolean()
+   {
+	   this.harness.checkPoint("testBoolean()");
+	   
+	   String key = "boolean_key";
+	   String _true = "TrUe";
+	   
+	   // test "normal" booleans
+	   this.prefs.putBoolean(key, true);
+	   boolean result = this.prefs.getBoolean(key, false);
+	   
+	   this.harness.check(result, true);
+	   
+	   // test String as boolean
+	   this.prefs.remove(key);
+	   try {
+		   this.prefs.flush();
+		   
+	   } catch (BackingStoreException e) {
+		   print(e.getLocalizedMessage());
+           this.harness.fail("call to testBoolean() - fail to flush");
+	   }
+	   
+	   this.prefs.put(key, _true);
+	   result = this.prefs.getBoolean(key, false);
+	   
+	   this.harness.check(result, true);
+   }
+   
    private void testListener()
    {
        this.harness.checkPoint("testListener()");

[-- Attachment #2: Questa è una parte del messaggio firmata digitalmente --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: FYI: GConf Preference test small update
  2006-06-21 19:23 FYI: GConf Preference test small update Mario Torre
@ 2006-06-21 20:09 ` Mario Torre
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Torre @ 2006-06-21 20:09 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Attached the right patch without the ChangeLog in it...
Sorry for the confusion, I feel a newbie...

Mario

2006-06-21  neugens  <neugens@limasoftware.net>

	* gnu/testlet/java/util/prefs/PreferenceTest.java (testBoolean): new
test
	method.
	(test): call to enable new test.

-- 
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/

[-- Attachment #2: mauve_preference_test.patch --]
[-- Type: text/x-patch, Size: 1431 bytes --]

Index: gnu/testlet/java/util/prefs/PreferenceTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/util/prefs/PreferenceTest.java,v
retrieving revision 1.1
diff -u -r1.1 PreferenceTest.java
--- gnu/testlet/java/util/prefs/PreferenceTest.java	19 Jun 2006 09:57:34 -0000	1.1
+++ gnu/testlet/java/util/prefs/PreferenceTest.java	21 Jun 2006 19:53:02 -0000
@@ -93,6 +93,7 @@
 
        testPut();
        testByte();
+       testBoolean();
        
        testListener();
        testChildren();
@@ -319,6 +320,35 @@
        }
    }
    
+   private void testBoolean()
+   {
+	   this.harness.checkPoint("testBoolean()");
+	   
+	   String key = "boolean_key";
+	   String _true = "TrUe";
+	   
+	   // test "normal" booleans
+	   this.prefs.putBoolean(key, true);
+	   boolean result = this.prefs.getBoolean(key, false);
+	   
+	   this.harness.check(result, true);
+	   
+	   // test String as boolean
+	   this.prefs.remove(key);
+	   try {
+		   this.prefs.flush();
+		   
+	   } catch (BackingStoreException e) {
+		   print(e.getLocalizedMessage());
+           this.harness.fail("call to testBoolean() - fail to flush");
+	   }
+	   
+	   this.prefs.put(key, _true);
+	   result = this.prefs.getBoolean(key, false);
+	   
+	   this.harness.check(result, true);
+   }
+   
    private void testListener()
    {
        this.harness.checkPoint("testListener()");

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-21 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21 19:23 FYI: GConf Preference test small update Mario Torre
2006-06-21 20:09 ` Mario Torre

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).