Update of /cvsroot/metamorphosis/ruper2/src/test/core/org/krysalis/ruper2/files
In directory sc8-pr-cvs1:/tmp/cvs-serv14802/src/test/core/org/krysalis/ruper2/files
Modified Files:
ResourceAnalyzerTests.java
Log Message:
1) Made ResourceAnalysis extract the group (from grandparent dir)
2) Added some unit tests for this.
Index: ResourceAnalyzerTests.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/test/core/org/krysalis/ruper2/files/ResourceAnalyzerTests.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ResourceAnalyzerTests.java 1 Oct 2003 21:55:54 -0000 1.2
--- ResourceAnalyzerTests.java 8 Oct 2003 18:28:34 -0000 1.3
***************
*** 10,13 ****
--- 10,14 ----
import org.krysalis.ruper2.RuperException;
+ import org.krysalis.ruper2.log.Logger;
import org.krysalis.ruper2.protocols.VirtualResourceLocator;
import org.krysalis.ruper2.resource.Resource;
***************
*** 23,26 ****
--- 24,31 ----
private ResourceFilenameAnalyzer m_analyzer = null;
+ static {
+ Logger.testInit();
+ }
+
public ResourceAnalyzerTests(String name) {
super(name);
***************
*** 50,53 ****
--- 55,77 ----
}
+ public void testResources1() throws Exception {
+ List testPatterns = new ArrayList();
+ String filename1 = "mystuff.jar";
+ testPatterns.add(filename1);
+
+ // Ought be jsut one thing in the list...
+ List expectedResults = new ArrayList();
+ expectedResults.add(
+ new Resource(
+ "mystuff",
+ null,
+ ResourceType.JAVA_BINARY,
+ "jar",
+ filename1,
+ VirtualResourceLocator.getTestVRL()));
+
+ checkResourceList(testPatterns, expectedResults);
+ }
+
public void testResources2() throws Exception {
List testPatterns = new ArrayList();
***************
*** 92,96 ****
--- 116,140 ----
checkResourceList(testPatterns, expectedResults);
}
+
+ public void testResources4() throws Exception {
+ List testPatterns = new ArrayList();
+ String filename1 = "my-stuff.jar";
+ testPatterns.add(filename1);
+
+ // Ought be just one thing in the list...
+ List expectedResults = new ArrayList();
+ expectedResults.add(
+ new Resource(
+ "my-stuff",
+ null,
+ ResourceType.JAVA_BINARY,
+ "jar",
+ filename1,
+ VirtualResourceLocator.getTestVRL()));
+ checkResourceList(testPatterns, expectedResults);
+ }
+
+
private void checkResourceList(List patterns, List resources)
throws RuperException {
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
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.