001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: *
017: * Based on code generated by Agitar build: Agitator Version 1.0.2.000071 (Build date: Jan 12, 2007) [1.0.2.000071]
018: */package org.jamwiki.utils;
019:
020: import java.util.Vector;
021: import junit.framework.TestCase;
022:
023: /**
024: *
025: */
026: public class DiffUtilTest extends TestCase {
027:
028: /**
029: *
030: */
031: public void testDiff() throws Throwable {
032: Vector result = DiffUtil.diff("", "testDiffUtilOldVersion");
033: assertEquals("result.size()", 1, result.size());
034: }
035:
036: /**
037: *
038: */
039: public void testDiff1() throws Throwable {
040: Vector result = DiffUtil.diff(null, "testDiffUtilOldVersion");
041: assertEquals("result.size()", 1, result.size());
042: }
043:
044: /**
045: *
046: */
047: public void testDiff2() throws Throwable {
048: Vector result = DiffUtil.diff("testDiffUtilNewVersion",
049: "testDiffUtil\nOldVersion");
050: assertEquals("result.size()", 2, result.size());
051: }
052:
053: /**
054: *
055: */
056: public void testDiff3() throws Throwable {
057: Vector result = DiffUtil.diff("testDiffUtilNewVersion", "");
058: assertEquals("result.size()", 1, result.size());
059: }
060:
061: /**
062: *
063: */
064: public void testDiff4() throws Throwable {
065: Vector result = DiffUtil.diff("testDiffUtil\nNewVersion", null);
066: assertEquals("result.size()", 2, result.size());
067: }
068:
069: /**
070: *
071: */
072: public void testDiff5() throws Throwable {
073: Vector result = DiffUtil.diff("testDiffUtil\nNewVersion",
074: "testDiffUtilOldVersion");
075: assertEquals("result.size()", 2, result.size());
076: }
077:
078: /**
079: *
080: */
081: public void testDiff6() throws Throwable {
082: Vector result = DiffUtil.diff("testDiffUtilNewVersion",
083: "testDiffUtilOldVersion");
084: assertEquals("result.size()", 1, result.size());
085: }
086:
087: /**
088: *
089: */
090: public void testDiff7() throws Throwable {
091: Vector result = DiffUtil.diff("foo\n", null);
092: assertEquals("result.size()", 1, result.size());
093: }
094:
095: /**
096: *
097: */
098: public void testDiff8() throws Throwable {
099: Vector result = DiffUtil.diff(null, null);
100: assertEquals("result.size()", 0, result.size());
101: }
102:
103: /**
104: *
105: */
106: public void testDiff9() throws Throwable {
107: Vector result = DiffUtil.diff("", null);
108: assertEquals("result.size()", 0, result.size());
109: }
110:
111: /**
112: *
113: */
114: public void testDiff10() throws Throwable {
115: Vector result = DiffUtil.diff(null, "");
116: assertEquals("result.size()", 0, result.size());
117: }
118:
119: /**
120: *
121: */
122: public void testDiff11() throws Throwable {
123: Vector result = DiffUtil.diff("\n", "");
124: assertEquals("result.size()", 1, result.size());
125: }
126:
127: /**
128: *
129: */
130: public void testDiff12() throws Throwable {
131: Vector result = DiffUtil.diff("testString", "testString");
132: assertEquals("result.size()", 0, result.size());
133: }
134: }
|