You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/10/28 09:38:57 UTC
DO NOT REPLY [Bug 24174] New: -
[PACTH]/home/cvspublic/jakarta-tomcat-4.0/catalina/src/test/org/apache/naming/resources/BaseDirContextTestCase.java
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24174>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24174
[PACTH]/home/cvspublic/jakarta-tomcat-4.0/catalina/src/test/org/apache/naming/resources/BaseDirContextTestCase.java
Summary: [PACTH]/home/cvspublic/jakarta-tomcat-
4.0/catalina/src/test/org/apache/naming/resources/BaseDi
rContextTestCase.java
Product: Tomcat 4
Version: Nightly Build
Platform: All
OS/Version: Other
Status: UNCONFIRMED
Severity: Enhancement
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: liujiboy@hotmail.com
This may be a bug.I used junit3.8.1 to compile this source,but failed.Because
there is no "assert" in junit3.8.1 ,but "assertTrue" can be used.
Index: BaseDirContextTestCase.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-
4.0/catalina/src/test/org/apache/naming/resources/BaseDirContextTestCase.java,v
retrieving revision 1.3
diff -u -r1.3 BaseDirContextTestCase.java
--- BaseDirContextTestCase.java 21 Oct 2001 22:03:34 -0000 1.3
+++ BaseDirContextTestCase.java 28 Oct 2003 08:29:49 -0000
@@ -247,7 +247,7 @@
// Look up the WEB-INF entry
Object webInfEntry = context.lookup("WEB-INF");
assertNotNull("Found WEB-INF entry", webInfEntry);
- assert("WEB-INF entry is a DirContext",
+ assertTrue("WEB-INF entry is a DirContext",
webInfEntry instanceof DirContext);
DirContext webInfContext = (DirContext) webInfEntry;
@@ -303,7 +303,7 @@
// Look up the WEB-INF entry
Object webInfEntry = context.lookup("WEB-INF");
assertNotNull("Found WEB-INF entry", webInfEntry);
- assert("WEB-INF entry is a DirContext",
+ assertTrue("WEB-INF entry is a DirContext",
webInfEntry instanceof DirContext);
DirContext webInfContext = (DirContext) webInfEntry;
@@ -353,20 +353,20 @@
while (ne.hasMore()) {
Object next = ne.next();
- assert("list() returns NameClassPair instances",
+ assertTrue("list() returns NameClassPair instances",
next instanceof NameClassPair);
NameClassPair ncp = (NameClassPair) next;
- assert("Name '" + ncp.getName() + "' is expected",
+ assertTrue("Name '" + ncp.getName() + "' is expected",
isListed(ncp.getName(), list));
if (isDirContext(ncp.getName())) {
- assert("Class '" + ncp.getClassName() + "' is '" +
+ assertTrue("Class '" + ncp.getClassName() + "'
is '" +
contextClassName + "'",
contextClassName.equals(ncp.getClassName()));
}
- assert("Relative is 'true'", ncp.isRelative());
+ assertTrue("Relative is 'true'", ncp.isRelative());
}
@@ -391,29 +391,29 @@
while (ne.hasMore()) {
Object next = ne.next();
- assert("listBindings() returns Binding instances",
+ assertTrue("listBindings() returns Binding instances",
next instanceof Binding);
Binding b = (Binding) next;
- assert("Name '" + b.getName() + "' is expected",
+ assertTrue("Name '" + b.getName() + "' is expected",
isListed(b.getName(), list));
if (isDirContext(b.getName())) {
- assert("Class '" + b.getClassName() + "' is '" +
+ assertTrue("Class '" + b.getClassName() + "'
is '" +
contextClassName + "'",
contextClassName.equals(b.getClassName()));
}
- assert("Relative is 'true'", b.isRelative());
+ assertTrue("Relative is 'true'", b.isRelative());
Object object = b.getObject();
assertNotNull("Name '" + b.getName() + "' has a non-null object",
object);
if (b.getName().equals("web.xml")) {
- assert("Entry '" + b.getName() + "' is a Resource",
+ assertTrue("Entry '" + b.getName() + "' is a
Resource",
object instanceof Resource);
} else {
- assert("Entry '" + b.getName() + "' is a DirContext",
+ assertTrue("Entry '" + b.getName() + "' is a
DirContext",
object instanceof DirContext);
}
@@ -445,35 +445,35 @@
while (ne.hasMore()) {
Object next = ne.next();
- assert("getAll() returns Attribute instances",
+ assertTrue("getAll() returns Attribute instances",
next instanceof Attribute);
Attribute attr = (Attribute) next;
String name = attr.getID();
int index = getIndex(name, webInfAttrs);
- assert("WEB-INF attribute '" + name + "' is expected",
+ assertTrue("WEB-INF attribute '" + name + "' is
expected",
index >= 0);
Object value = attr.get();
assertNotNull("get() returned non-null", value);
if (name.equals("creationdate")) {
- assert("Creation date is a date",
+ assertTrue("Creation date is a date",
value instanceof Date);
- assert("Creation date equals " + creationDate,
+ assertTrue("Creation date equals " +
creationDate,
creationDate.equals((Date) value));
} else if (name.equals("displayname")) {
- assert("Display name is a string",
+ assertTrue("Display name is a string",
value instanceof String);
- assert("Display name equals " + displayName,
+ assertTrue("Display name equals " + displayName,
displayName.equals((String) value));
} else if (name.equals("getcontentlength")) {
- assert("Content length is a long",
+ assertTrue("Content length is a long",
value instanceof Long);
- assert("Content length equals " + contentLength,
+ assertTrue("Content length equals " +
contentLength,
contentLength == ((Long) value).longValue());
} else if (name.equals("getlastmodified")) {
- assert("Last modified date is a date",
+ assertTrue("Last modified date is a date",
value instanceof Date);
- assert("Last modified date is " + lastModifiedDate,
+ assertTrue("Last modified date is " +
lastModifiedDate,
lastModifiedDate.equals((Date) value));
}
@@ -505,35 +505,35 @@
while (ne.hasMore()) {
Object next = ne.next();
- assert("getAll() returns Attribute instances",
+ assertTrue("getAll() returns Attribute instances",
next instanceof Attribute);
Attribute attr = (Attribute) next;
String name = attr.getID();
int index = getIndex(name, webXmlAttrs);
- assert("WEB-INF/web.xml attribute '" + name + "' is expected",
+ assertTrue("WEB-INF/web.xml attribute '" + name + "' is
expected",
index >= 0);
Object value = attr.get();
assertNotNull("get() returned non-null", value);
if (name.equals("creationdate")) {
- assert("Creation date is a date",
+ assertTrue("Creation date is a date",
value instanceof Date);
- assert("Creation date equals " + creationDate,
+ assertTrue("Creation date equals " +
creationDate,
creationDate.equals((Date) value));
} else if (name.equals("displayname")) {
- assert("Display name is a string",
+ assertTrue("Display name is a string",
value instanceof String);
- assert("Display name equals " + displayName,
+ assertTrue("Display name equals " + displayName,
displayName.equals((String) value));
} else if (name.equals("getcontentlength")) {
- assert("Content length is a long",
+ assertTrue("Content length is a long",
value instanceof Long);
- assert("Content length equals " + contentLength,
+ assertTrue("Content length equals " +
contentLength,
contentLength == ((Long) value).longValue());
} else if (name.equals("getlastmodified")) {
- assert("Last modified date is a date",
+ assertTrue("Last modified date is a date",
value instanceof Date);
- assert("Last modified date is " + lastModifiedDate,
+ assertTrue("Last modified date is " +
lastModifiedDate,
lastModifiedDate.equals((Date) value));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org