incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r778063 - in /incubator/kato/branches/experimental/maven_restructure/org.apache.kato: kato.hprof.reader/src/test/java/org/apache/kato/hprof/ kato.hprof.reader/src/test/java/test/apache/kato/hprof/ plugins/kato.hprof.reader.plugin/
Date Sat, 23 May 2009 23:25:40 GMT
Author: spoole
Date: Sat May 23 23:25:40 2009
New Revision: 778063

URL: http://svn.apache.org/viewvc?rev=778063&view=rev
Log:
updated experimental build of  hprof reader to read testdata from resources dir

Modified:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/org/apache/kato/hprof/HProfViewTest.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/plugins/kato.hprof.reader.plugin/pom.xml

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/org/apache/kato/hprof/HProfViewTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/org/apache/kato/hprof/HProfViewTest.java?rev=778063&r1=778062&r2=778063&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/org/apache/kato/hprof/HProfViewTest.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/org/apache/kato/hprof/HProfViewTest.java
Sat May 23 23:25:40 2009
@@ -14,6 +14,8 @@
 package org.apache.kato.hprof;
 
 import java.io.File;
+import java.net.URL;
+import java.net.URI;
 import java.util.Collection;
 import java.util.Vector;
 
@@ -27,7 +29,10 @@
 	HProfView view;
 	
 	public void setUp() throws Exception {
-		file = HProfFactory.createReader(new File("data/java.hprof"));
+		URL datafile=getClass().getResource("/data/java.hprof");
+		URI i=datafile.toURI();
+		File file2=new File(i);
+		file = HProfFactory.createReader(file2);
 		view = new HProfView(file);
 		view.open(null);
 	}

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java?rev=778063&r1=778062&r2=778063&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
Sat May 23 23:25:40 2009
@@ -15,6 +15,8 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
 
 import junit.framework.TestCase;
 
@@ -25,10 +27,11 @@
 public class TestHProf extends TestCase {
 
 	
-	private static final String DUMP = "data/java.hprof";
-	public void testHeader() throws IOException {
-		
-		File dump=new File(DUMP);
+	private static final String DUMP = "/data/java.hprof";
+	public void testHeader() throws IOException,java.net.URISyntaxException {
+		URL datafile=getClass().getResource(DUMP);
+		URI i=datafile.toURI();
+		File dump=new File(i);
 		HProfFile h=HProfFactory.createReader(dump);
 		
 		h.open();
@@ -44,9 +47,11 @@
 		h.close();
 		
 	}
-	public void testRead() throws IOException {
+	public void testRead() throws IOException,java.net.URISyntaxException {
 		
-		File dump=new File(DUMP);
+		URL datafile=getClass().getResource(DUMP);
+		URI i=datafile.toURI();
+		File dump=new File(i);
 		HProfFile h=HProfFactory.createReader(dump);
 		
 		h.open();
@@ -56,9 +61,11 @@
 		
 		
 	}
-	public void testReadTwice() throws IOException {
+	public void testReadTwice() throws IOException,java.net.URISyntaxException {
 		
-		File dump=new File(DUMP);
+		URL datafile=getClass().getResource(DUMP);
+		URI uri=datafile.toURI();
+		File dump=new File(uri);
 		HProfFile h=HProfFactory.createReader(dump);
 		
 		h.open();

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/plugins/kato.hprof.reader.plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/plugins/kato.hprof.reader.plugin/pom.xml?rev=778063&r1=778062&r2=778063&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/plugins/kato.hprof.reader.plugin/pom.xml
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/plugins/kato.hprof.reader.plugin/pom.xml
Sat May 23 23:25:40 2009
@@ -34,7 +34,35 @@
 					<source>1.6</source>
 					<target>1.6</target>
 				</configuration>
-		</plugin>
+		</plugin>
+		<plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy</id>
+            <phase>package</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.apache.kato</groupId>
+                  <artifactId>kato.hprof.reader</artifactId>
+                  <version>0.0.1-SNAPSHOT</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>lib</outputDirectory>
+                  <destFileName>hprofreader.jar</destFileName>
+                </artifactItem>
+              </artifactItems>
+              <!-- other configurations here -->
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+		
 	</plugins>
   </build>
 </project>
\ No newline at end of file



Mime
View raw message