001: /*
002: * Copyright 2003-2004 Michael Franken, Zilverline.
003: *
004: * The contents of this file, or the files included with this file, are subject to
005: * the current version of ZILVERLINE Collaborative Source License for the
006: * Zilverline Search Engine (the "License"); You may not use this file except in
007: * compliance with the License.
008: *
009: * You may obtain a copy of the License at
010: *
011: * http://www.zilverline.org.
012: *
013: * See the License for the rights, obligations and
014: * limitations governing use of the contents of the file.
015: *
016: * The Original and Upgraded Code is the Zilverline Search Engine. The developer of
017: * the Original and Upgraded Code is Michael Franken. Michael Franken owns the
018: * copyrights in the portions it created. All Rights Reserved.
019: *
020: */
021:
022: package org.zilverline.core;
023:
024: import java.util.Date;
025:
026: import junit.framework.TestCase;
027:
028: /**
029: * Test class for Result, self documenting.
030: *
031: * @author Michael Franken
032: *
033: * @see org.zilverline.core.Result
034: */
035: public class TestResult extends TestCase {
036: /**
037: * Creates a new TestResult object.
038: *
039: * @param arg0 DOCUMENT ME!
040: */
041: public TestResult(String arg0) {
042: super (arg0);
043: }
044:
045: /**
046: * DOCUMENT ME!
047: *
048: * @todo This methods needs documentation.
049: */
050: public void testTitle() {
051: Result res = new Result();
052:
053: assertEquals("", res.getTitle());
054: }
055:
056: /**
057: * DOCUMENT ME!
058: *
059: * @todo This methods needs documentation.
060: */
061: public void testName() {
062: Result res = new Result();
063:
064: assertEquals("", res.getName());
065: }
066:
067: /**
068: * DOCUMENT ME!
069: *
070: * @todo This methods needs documentation.
071: */
072: public void testPath() {
073: Result res = new Result();
074:
075: assertEquals("", res.getPath());
076: }
077:
078: /**
079: * DOCUMENT ME!
080: *
081: * @todo This methods needs documentation.
082: */
083: public void testSummary() {
084: Result res = new Result();
085:
086: assertEquals("", res.getSummary());
087: }
088:
089: /**
090: * DOCUMENT ME!
091: *
092: * @todo This methods needs documentation.
093: */
094: public void testScoreString() {
095: Result res = new Result();
096:
097: assertEquals("", res.getScoreString());
098: assertEquals(0f, res.getScore(), 0f);
099: res.setScore(0.13f);
100: assertEquals(0.13f, res.getScore(), 0f);
101: assertEquals("13%", res.getScoreString());
102: }
103:
104: /**
105: * DOCUMENT ME!
106: *
107: * @todo This methods needs documentation.
108: */
109: public void testModificationDate() {
110: Result res = new Result();
111:
112: assertEquals(null, res.getModificationDate());
113:
114: Date d = new Date();
115: String testString = d.toString();
116:
117: res.setModificationDate(d);
118: assertEquals(d, res.getModificationDate());
119: }
120:
121: /**
122: * DOCUMENT ME!
123: *
124: * @todo This methods needs documentation.
125: */
126: public void testType() {
127: Result res = new Result();
128:
129: assertEquals("", res.getType());
130:
131: String testString = "PDF";
132:
133: res.setType(testString);
134: assertEquals(testString, res.getType());
135: }
136:
137: /**
138: * DOCUMENT ME!
139: *
140: * @todo This methods needs documentation.
141: */
142: public void testSizeAsString() {
143: Result res = new Result();
144:
145: assertEquals("", res.getSizeAsString());
146: assertEquals("", res.getSize());
147: res.setSize("123");
148: assertEquals("123", res.getSize());
149: assertEquals("123B", res.getSizeAsString());
150: res.setSize("12345");
151: assertEquals("12KB", res.getSizeAsString());
152: res.setSize("1234567");
153: assertEquals("1MB", res.getSizeAsString());
154: res.setSize("1234567890");
155: assertEquals("1GB", res.getSizeAsString());
156: res.setSize("");
157: assertEquals("", res.getSizeAsString());
158: }
159: }
|