ruper2/src/test/core/org/krysalis/ruper2/resource ResourceTests.java,NONE,1.1

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/test/core/org/krysalis/ruper2/resource
In directory sc8-pr-cvs1:/tmp/cvs-serv25526/src/test/core/org/krysalis/ruper2/resource

Added Files:
	ResourceTests.java 
Log Message:
1) Copied over Ruper1 documentation to work on
2) Worked on RepositoryTool [command line] to list groups/resoruces
3) Ignore .* files, and associate .MD5 w/ original. [Later check hash]

--- NEW FILE: ResourceTests.java ---
/*
 * Created on Aug 27, 2003
 */
package org.krysalis.ruper2.resource;

import junit.framework.TestCase;

import org.krysalis.ruper2.log.Logger;

/**
 * @author arb_jack
 */
public class ResourceTests extends TestCase {

	static {
		Logger.testInit();
	}

	public ResourceTests(String name) {
		super(name);
	}

	public void setUp() throws Exception {

	}

	public void testResourceEquality1() throws Exception {
		Resource r1 = Resource.getTestResource();
		Resource r2 = Resource.getTestResource();

		assertEquals("Same are equal", r1, r2);
		assertTrue("Same are equal", r1.equals(r2));
		assertEquals("Same are same hash", r1.hashCode(), r2.hashCode());
	}

	public void testResourceEquality2() throws Exception {
		Resource r1 = Resource.getTestResource();
		Resource r2 = Resource.getTestResource("bogus");

		assertFalse("Different are NOT equal", r1.equals(r2));
		assertFalse(
			"Different are NOT equal hash",
			r1.hashCode() == r2.hashCode());
	}

	public void testResourceEquality3() throws Exception {
		Resource r1 = Resource.getTestResource();
		Resource r2 = new Resource(r1);

		assertEquals("Clones are equal", r1, r2);
		assertTrue("Clones are equal", r1.equals(r2));
		assertEquals("Clones are same hash", r1.hashCode(), r2.hashCode());
	}

	public void testResourceEquality4() throws Exception {
		Resource r1 = Resource.getTestResource();
		Resource r2 = new Resource(r1); r2.setExtension("bogus");

		assertFalse("Different are NOT equal", r1.equals(r2));
		assertFalse(
			"Different are NOT equal hash",
			r1.hashCode() == r2.hashCode());
	}

	public static void main(String[] args) {
		junit.textui.TestRunner.run(ResourceTests.class);
	}
}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.