You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dg...@apache.org on 2003/09/22 02:58:25 UTC
cvs commit: jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl BasicMessageListTestCase.java
dgraham 2003/09/21 17:58:25
Modified: resources/src/test/org/apache/commons/resources/impl
BasicMessageListTestCase.java
Log:
Added test for isAccessed().
Revision Changes Path
1.3 +13 -11 jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/BasicMessageListTestCase.java
Index: BasicMessageListTestCase.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/BasicMessageListTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BasicMessageListTestCase.java 28 Feb 2003 02:54:50 -0000 1.2
+++ BasicMessageListTestCase.java 22 Sep 2003 00:58:25 -0000 1.3
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -131,13 +131,13 @@
public void testNotEmpty() {
aMsgs.add("myProp", msg1);
- assertTrue("aMsgs is empty!", aMsgs.isEmpty() == false);
+ assertTrue("aMsgs is empty!", !aMsgs.isEmpty());
}
public void testSizeWithOneProperty() {
aMsgs.add("myProp", msg1);
aMsgs.add("myProp", msg2);
- assertTrue("number of mesages is not 2", aMsgs.size("myProp") == 2);
+ assertEquals(2, aMsgs.size("myProp"));
}
public void testSizeWithManyProperties() {
@@ -146,26 +146,28 @@
aMsgs.add("myProp3", msg3);
aMsgs.add("myProp3", msg4);
aMsgs.add("myProp4", msg5);
- assertTrue("number of messages for myProp1 is not 1", aMsgs.size("myProp1") == 1);
- assertTrue("number of messages", aMsgs.size() == 5);
+ assertEquals(1, aMsgs.size("myProp1"));
+ assertEquals(5, aMsgs.size());
}
public void testSizeAndEmptyAfterClear() {
testSizeWithOneProperty();
aMsgs.clear();
testEmpty();
- assertTrue("number of meesages is not 0", aMsgs.size("myProp") == 0);
+ assertEquals(0, aMsgs.size("myProp"));
}
public void testGetWithNoProperty() {
Iterator it = aMsgs.get("myProp");
- assertTrue("iterator is not empty!", it.hasNext() == false);
+ assertTrue("iterator is not empty!", !it.hasNext());
+ assertTrue(aMsgs.isAccessed());
}
public void testGetForAProperty() {
testSizeWithOneProperty();
Iterator it = aMsgs.get("myProp");
- assertTrue("iterator is empty!", it.hasNext() == true);
+ assertTrue("iterator is empty!", it.hasNext());
+ assertTrue(aMsgs.isAccessed());
}
/**
@@ -183,8 +185,8 @@
add.add("prop3", msg3);
msgs.add(add);
- assertTrue(msgs.size() == 3);
- assertTrue(msgs.size("prop1") == 2);
+ assertEquals(3, msgs.size());
+ assertEquals(2, msgs.size("prop1"));
// test message order
Iterator props = msgs.get();
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org