incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: rev 22910 - incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io
Date Wed, 14 Jul 2004 17:51:18 GMT
Author: mmay
Date: Wed Jul 14 10:51:17 2004
New Revision: 22910

Added:
   incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/ResolvedFileTest.java
Log:
Added Testcase for ResolvedFile

Added: incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/ResolvedFileTest.java
==============================================================================
--- (empty file)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io/ResolvedFileTest.java
Wed Jul 14 10:51:17 2004
@@ -0,0 +1,58 @@
+/*
+ * Created on Jul 14, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.depot.update.util.io;
+
+import java.io.File;
+
+import org.apache.depot.common.util.SystemUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * TestCase for the class ResolvedFile 
+ * 
+ * @author <a href="http://incubator.apache.org/depot">The Apache Incubator Depot Project</a>
+ */
+public class ResolvedFileTest extends TestCase {
+
+	String fileName;
+	String compareValue; 
+		
+	/**
+	 * @see junit.framework.TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+		fileName = "lib/test.jar";
+		compareValue = SystemUtils.getCWD().getAbsolutePath() + "/" + fileName;
+	}
+	
+	/**
+	 * Class under test for ResolvedFile resolve(Object)
+	 */
+	public void testResolveObject() {
+		File rf1 = ResolvedFile.resolve(fileName);
+		File rf2 = ResolvedFile.resolve(SystemUtils.getCWD().getAbsolutePath());
+		File rf3 = ResolvedFile.resolve(".");
+
+		compareValue = SystemUtils.getCWD().getAbsolutePath() + "/" + fileName; 
+		
+		assertEquals(compareValue, rf1.getAbsolutePath());
+		assertEquals(SystemUtils.getCWD().getAbsolutePath(), rf2.getAbsolutePath());
+		assertEquals(SystemUtils.getCWD().getAbsolutePath(), rf3.getAbsolutePath());		
+	}
+
+	/**
+	 * Class under test for ResolvedFile resolve(Object, Object)
+	 */
+	public void testResolveObjectObject() {
+		File rf1 = ResolvedFile.resolve(SystemUtils.getCWD().getAbsolutePath(),	fileName);
+
+		assertEquals(compareValue, rf1.getAbsolutePath());
+	}
+
+}

Mime
View raw message