You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@depot.apache.org by mm...@apache.org on 2004/07/14 17:51:18 UTC

svn commit: rev 22910 - incubator/depot/trunk/update/src/test/org/apache/depot/update/util/io

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());
+	}
+
+}