FileDocCategorySizeDatePackage
FindInSameDirectoryTest.javaAPI DocFobs4JMF API 0.4.11451Tue Dec 19 14:17:00 GMT 2006com.moesol.bindings

FindInSameDirectoryTest

public class FindInSameDirectoryTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestComputeForFileUrl()

		FindInSameDirectory nf = new FindInSameDirectory();
		String resourceToFind = "/com/moesol/bindings/NativeLibaryFinderTest.class";
		nf.setClassAsResourcePath(resourceToFind);
		URL url = new URL("file:/c:/Program Files/yack/classes" + resourceToFind);
		String r = nf.computeDirectoryForFileUrl(url);
		String exp = new File("c:/Program Files/yack/classes").getAbsolutePath();
		assertEquals(exp, r);
	
public voidtestComputeForJarUrl()

		FindInSameDirectory nf = new FindInSameDirectory();
		String resourceToFind = "/com/moesol/bindings/NativeLibaryFinderTest.class";
		nf.setClassAsResourcePath(resourceToFind);
		URL url = new URL("jar:file:/c:/Program Files/yack/bar.jar!" + resourceToFind);
		String r = nf.computeDirectoryForJarUrl(url);
		String exp = new File("c:/Program Files/yack").getAbsolutePath();
		assertEquals(exp, r);
	
public voidtestComputePath()

		FindInSameDirectory nf = new FindInSameDirectory();
		File r = nf.computePath("c:/Program Files/yack", "/WindowsXP/", "foo.dll");
		File e = new File("c:/Program Files/yack/WindowsXP", "foo.dll");
		assertEquals(e, r);