incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r823514 - in /incubator/kato/branches/experimental/kato.javaview: ./ src/main/java/org/apache/kato/javaview/ src/main/java/org/apache/kato/javaview/api/ src/main/java/org/apache/kato/javaview/impl/ src/test/java/test/apache/kato/javaview/
Date Fri, 09 Oct 2009 11:31:23 GMT
Author: spoole
Date: Fri Oct  9 11:31:22 2009
New Revision: 823514

URL: http://svn.apache.org/viewvc?rev=823514&view=rev
Log:
addition of a persistent store experiment based on derby

Added:
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchy.java
      - copied, changed from r820986, incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchy.java
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchyBuilder.java
      - copied, changed from r820986, incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchyBuilder.java
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java
  (with props)
    incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java
  (with props)
Removed:
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchy.java
    incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchyBuilder.java
Modified:
    incubator/kato/branches/experimental/kato.javaview/   (props changed)
    incubator/kato/branches/experimental/kato.javaview/pom.xml
    incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestJavaClassLoaderHierarchyBuilder.java

Propchange: incubator/kato/branches/experimental/kato.javaview/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct  9 11:31:22 2009
@@ -0,0 +1 @@
+target

Modified: incubator/kato/branches/experimental/kato.javaview/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/pom.xml?rev=823514&r1=823513&r2=823514&view=diff
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/pom.xml (original)
+++ incubator/kato/branches/experimental/kato.javaview/pom.xml Fri Oct  9 11:31:22 2009
@@ -7,7 +7,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.kato</groupId>
   <artifactId>kato.javaview</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
+  <version>0.0.1-SNAPSHOT</version> 
   <description>		</description>
   <dependencies>
   	<dependency>
@@ -16,9 +16,9 @@
   		<version>0.0.1-SNAPSHOT</version>
   	</dependency>
   	<dependency>
-  		<groupId>org.apache.kato</groupId>
-  		<artifactId>kato.hprof.api</artifactId>
-  		<version>0.0.1-SNAPSHOT</version>
+  		<groupId>org.apache.derby</groupId>
+		<artifactId>derby</artifactId>
+		<version>10.5.3.0</version>
   	</dependency>
   	<dependency>
 		<groupId>junit</groupId>

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.api;
+
+public interface Group<T> {
+
+	public T get(long index);
+	
+	public void release();
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/Group.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.api;
+
+import javax.tools.diagnostics.runtime.java.JavaField;
+
+public interface JavaInstance {
+
+
+	 public Group<JavaField> getFields();
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaInstance.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+package org.apache.kato.javaview.api;
+
+public interface JavaView {
+
+	 public Group<JavaInstance> getInstances();
+	 
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/JavaView.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.api;
+
+import java.util.Set;
+
+public interface VJavaClassLoader {
+
+	public Set<VJavaClassLoader> getParents();
+	public Set<VJavaClassLoader> getChildren();
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/api/VJavaClassLoader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchy.java
(from r820986, incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchy.java)
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchy.java?p2=incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchy.java&p1=incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchy.java&r1=820986&r2=823514&rev=823514&view=diff
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchy.java
(original)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchy.java
Fri Oct  9 11:31:22 2009
@@ -12,12 +12,12 @@
  * limitations under the License.
  ******************************************************************************/
 
-package org.apache.kato.javaview;
+package org.apache.kato.javaview.impl;
 
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.kato.javaview.JavaClassLoaderHierarchyBuilder.Loader;
+import org.apache.kato.javaview.impl.JavaClassLoaderHierarchyBuilder.Loader;
 
 /**
  * Inferred class loader hierarchy determined by the Hierarchy Builder

Copied: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchyBuilder.java
(from r820986, incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchyBuilder.java)
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchyBuilder.java?p2=incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchyBuilder.java&p1=incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchyBuilder.java&r1=820986&r2=823514&rev=823514&view=diff
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/JavaClassLoaderHierarchyBuilder.java
(original)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaClassLoaderHierarchyBuilder.java
Fri Oct  9 11:31:22 2009
@@ -11,7 +11,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
-package org.apache.kato.javaview;
+package org.apache.kato.javaview.impl;
 
 import java.util.HashSet;
 import java.util.List;
@@ -21,7 +21,7 @@
 import javax.tools.diagnostics.runtime.java.JavaClass;
 import javax.tools.diagnostics.runtime.java.JavaClassLoader;
 
-import org.apache.xerces.impl.dtd.models.DFAContentModel;
+import org.apache.kato.javaview.api.VJavaClassLoader;
 
 
 
@@ -93,12 +93,12 @@
 
 	
 
-	public class Loader {
-
+	public class Loader implements VJavaClassLoader {
+	
 		private JavaClassLoader definingLoader=null;
 		private Set<JavaClass> inheritedClasses=new HashSet<JavaClass>();
-		private Set<Loader> kids=new HashSet<Loader>();
-		private Set<Loader> parents=new HashSet<Loader>();
+		private Set<VJavaClassLoader> kids=new HashSet<VJavaClassLoader>();
+		private Set<VJavaClassLoader> parents=new HashSet<VJavaClassLoader>();
 		
 		
 		public String toString() {
@@ -136,15 +136,15 @@
 			inheritedClasses.addAll(definingloader.getCachedClasses());
 			if(inheritedClasses.isEmpty()==false) 	inheritedClasses.removeAll(definingloader.getDefinedClasses());
 		}
-
+	
 		
-
+	
 		
-		public Set<Loader> getParents() {
+		public Set<VJavaClassLoader> getParents() {
 			
 			return parents;
 		}
-
+	
 		public boolean hasParents() {
 			return parents.isEmpty()==false;
 		}
@@ -153,13 +153,17 @@
 			kids.add(child);
 			child.parents.add(this);
 		}
-
+	
 		public boolean hasChildren() {
 			return kids.isEmpty()==false;
 		}
 		public JavaClassLoader getDefiningLoader() {
 			return definingLoader;
 		}
+		@Override
+		public Set<VJavaClassLoader> getChildren() {
+			return kids;
+		}
 		
 		
 	}

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+package org.apache.kato.javaview.impl;
+
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+import org.apache.kato.javaview.api.Group;
+import org.apache.kato.javaview.api.JavaInstance;
+import org.apache.kato.javaview.api.JavaView;
+
+public class JavaViewImpl implements JavaView {
+
+	private JavaRuntime runtime=null;
+	private JavaClassLoaderHierarchy loaderHierarchy=null;
+	
+	public JavaViewImpl(JavaRuntime runtime) {
+		if(runtime==null)  throw new IllegalArgumentException("runtime is null");
+		this.runtime=runtime;
+	}
+
+	@Override
+	public Group<JavaInstance> getInstances() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	
+	
+	
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/JavaViewImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.kato.javaview.api.Group;
+import org.apache.kato.javaview.api.JavaInstance;
+
+public class PersistentStore {
+
+	private File location=null;
+	private Class driver=null;
+	private Connection connection=null;
+	private static String CLASS2INSTANCE= "C2I";
+	private TableImpl class2instanceTable=null;
+	
+	public PersistentStore(File location) throws IOException {
+		this.location=location;
+		// create database to ensure we catch errors fast
+		openConnection();
+		
+		
+	}
+
+
+
+public void close() throws IOException {
+	if(class2instanceTable!=null) {
+		class2instanceTable.close();
+	}
+}
+	
+	
+	
+	
+	 
+
+	private TableImpl buildIDToIDDatabase(String tableName) throws IOException {
+		try {
+			Statement s=connection.createStatement();
+			s.execute("create table "+tableName+"(id bigint, to_id bigint)");
+			return new TableImpl(tableName,s);
+
+		} catch (SQLException e) {
+			throw new IOException(e);
+		}
+		
+		
+	}
+
+	
+	
+		
+	
+
+	private void openConnection() throws IOException  {
+		
+		if(driver==null) {
+			loadDriver();
+		}
+		
+		Properties p=new Properties();
+		
+		try {
+			String filename=location.getAbsolutePath();
+			connection = DriverManager.getConnection("jdbc:derby:"+filename+";create=true", p);
+		} catch (SQLException e) {
+			throw new IOException(e);
+		}
+		
+		
+		
+		
+	}
+
+
+	private void loadDriver() throws IOException {
+		try {
+			driver=Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+			driver.newInstance();
+		
+		} catch (Exception e) {
+			throw new IOException(e);
+		
+		}
+		
+	}
+
+
+
+
+	public Table getClassObjectTable() throws IOException {
+		if(class2instanceTable==null) {
+			class2instanceTable=buildIDToIDDatabase(CLASS2INSTANCE);
+		}
+		 
+		return class2instanceTable;
+	}
+	}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.impl;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+public class PersistentStoreBuilder {
+
+	File baseDir=null;
+	public PersistentStoreBuilder(File basedirectory) {
+		baseDir=basedirectory;
+	}
+	public PersistentStore buildStore(JavaRuntime jrt) throws IOException {
+		
+		File source=jrt.getSource();
+		
+		String flatName=source.getName();
+		File storeDir=new File(baseDir,flatName);
+		PersistentStore store=new PersistentStore(storeDir);
+		return store;
+	}
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/PersistentStoreBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.impl;
+
+import java.io.IOException;
+
+public interface Table {
+	public void put(long parent, long child) throws IOException;
+
+	public long setSize() throws IOException;
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/Table.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.javaview.impl;
+
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class TableImpl implements Table{
+
+	private Statement statement=null;
+	private String insertPrefix=null;
+	private String sizePrefix=null;
+	public TableImpl(String name,Statement s) {
+		this.statement=s;
+		insertPrefix="INSERT INTO "+name+" VALUES(";
+		sizePrefix="select count(*) from "+name;
+	}
+	public void close() throws IOException {
+		try {
+			statement.close();
+		} catch (SQLException e) {
+			throw new IOException(e);
+		}
+	}
+	public void put(long parent, long child) throws IOException {
+		try {
+			statement.execute(insertPrefix+parent+","+child+")");
+		} catch (SQLException e) {
+			throw new IOException(e);
+		}
+	}
+	@Override
+	public long setSize() throws IOException {
+		
+		try {
+			ResultSet rs=statement.executeQuery(sizePrefix);
+			rs.next();
+			return rs.getLong(1); 
+		} catch (SQLException e) {
+			throw new IOException(e);
+		}
+		
+	
+	}
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/main/java/org/apache/kato/javaview/impl/TableImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package test.apache.kato.javaview;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+import org.apache.kato.javaview.impl.PersistentStore;
+import org.apache.kato.javaview.impl.PersistentStoreBuilder;
+
+import junit.framework.TestCase;
+
+public abstract class AbstractPersistentStoreTestCase  extends TestCase{
+
+	protected void deleteFile(File dir) {
+		File[] kids=dir.listFiles();
+		if(kids!=null) {
+			for(File kid:kids) {
+				deleteFile(kid);
+			}
+		}
+		boolean deleted=dir.delete();
+		if(!deleted) throw new RuntimeException("Unable to delete test file "+dir.getAbsolutePath());
+	}
+
+	protected PersistentStore getStore(JavaRuntime jrt) throws IOException {
+		File storeTempDir = getStoreDir();
+		PersistentStoreBuilder builder=new PersistentStoreBuilder(storeTempDir); 
+		return builder.buildStore(jrt);
+		
+	}
+
+	protected File getStoreDir() {
+		String tempDirName=System.getProperty("java.io.tmpdir");
+		File tempDir=new File(tempDirName);
+		File storeTempDir=new File(tempDir,"kato.javaview.tests");
+		return storeTempDir;
+	}
+
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/AbstractPersistentStoreTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestJavaClassLoaderHierarchyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestJavaClassLoaderHierarchyBuilder.java?rev=823514&r1=823513&r2=823514&view=diff
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestJavaClassLoaderHierarchyBuilder.java
(original)
+++ incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestJavaClassLoaderHierarchyBuilder.java
Fri Oct  9 11:31:22 2009
@@ -15,9 +15,9 @@
 
 import junit.framework.TestCase;
 
-import org.apache.kato.javaview.JavaClassLoaderHierarchy;
-import org.apache.kato.javaview.JavaClassLoaderHierarchyBuilder;
-import org.apache.kato.javaview.JavaClassLoaderHierarchyBuilder.Loader;
+import org.apache.kato.javaview.impl.JavaClassLoaderHierarchy;
+import org.apache.kato.javaview.impl.JavaClassLoaderHierarchyBuilder;
+import org.apache.kato.javaview.impl.JavaClassLoaderHierarchyBuilder.Loader;
 
 
 public class TestJavaClassLoaderHierarchyBuilder extends TestCase {

Added: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package test.apache.kato.javaview;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.tools.diagnostics.FactoryRegistry;
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+
+import org.apache.kato.javaview.impl.PersistentStore;
+import org.apache.kato.javaview.impl.Table;
+
+import com.ibm.katoblue.java.j9.JavaRuntimeImpl;
+
+import junit.framework.TestCase;
+
+public class TestPersistanceStoreScale extends AbstractPersistentStoreTestCase {
+
+	
+	public void testLoadPersistentStore() throws IOException {
+		
+		File base=new File("C:\\Documents and Settings\\spoole\\Desktop\\core.core");
+		
+		JavaRuntime jrt=FactoryRegistry.getDefaultRegistry().getJavaRuntime(base);
+		assertNotNull(jrt);
+		JavaRuntimeImpl jri=(JavaRuntimeImpl) jrt;
+	
+		PersistentStore store=getStore(jrt);
+		
+		int count=0;
+		int cycle=0;
+		int cdeCount=0;
+		// add in class object data
+		
+		Table table=store.getClassObjectTable();
+		
+		for(JavaHeap heap:jrt.getHeaps()) {
+			for(JavaObject object:heap.getObjects()) {
+				try {
+					JavaClass clazz=object.getJavaClass();
+					if(clazz!=null) {
+						long clazz_addr=clazz.getID().getAddress();
+						long obj_addr=object.getID().getAddress();
+						table.put(clazz_addr,obj_addr);
+						count++;
+						cycle++;
+						if(cycle>1000) {
+							cycle=0;
+							System.out.print("Count "+count+" errs="+cdeCount);
+						}
+					}
+				} catch (CorruptDataException e) {
+					cdeCount++;
+				}
+				
+			}
+		}
+		
+		long records=table.setSize();
+		store.close();
+		
+		assertEquals(3,records);
+		
+		
+	}
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistanceStoreScale.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java?rev=823514&view=auto
==============================================================================
--- incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java
(added)
+++ incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java
Fri Oct  9 11:31:22 2009
@@ -0,0 +1,491 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package test.apache.kato.javaview;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImagePointer;
+import javax.tools.diagnostics.image.ImageSection;
+import javax.tools.diagnostics.image.MemoryAccessException;
+import javax.tools.diagnostics.runtime.java.JavaClass;
+import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaField;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
+import javax.tools.diagnostics.runtime.java.JavaMethod;
+import javax.tools.diagnostics.runtime.java.JavaMonitor;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+import javax.tools.diagnostics.runtime.java.JavaReference;
+import javax.tools.diagnostics.runtime.java.JavaRuntime;
+import javax.tools.diagnostics.runtime.java.JavaThread;
+import javax.tools.diagnostics.runtime.java.JavaVMInitArgs;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.javaview.impl.PersistentStore;
+import org.apache.kato.javaview.impl.Table;
+
+public class TestPersistentStore extends AbstractPersistentStoreTestCase {
+
+	private static long lastaddr=0;
+	
+	private final class MockPointer implements ImagePointer {
+		
+		private long addr=0;
+		public MockPointer(long addr) {
+			this.addr=addr;
+		}
+
+		@Override
+		public ImagePointer add(long offset) {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public long getAddress() {
+			return addr;
+		}
+
+		@Override
+		public ImageAddressSpace getAddressSpace() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public byte getByteAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public double getDoubleAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public float getFloatAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public int getIntAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public long getLongAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public ImagePointer getPointerAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public short getShortAt(long index)
+				throws MemoryAccessException, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public boolean isExecutable() throws DataUnavailable {
+			// TODO Auto-generated method stub
+			return false;
+		}
+
+		@Override
+		public boolean isReadOnly() throws DataUnavailable {
+			// TODO Auto-generated method stub
+			return false;
+		}
+
+		@Override
+		public boolean isShared() throws DataUnavailable {
+			// TODO Auto-generated method stub
+			return false;
+		}
+	}
+	private final class MockJavaRuntime implements JavaRuntime {
+		
+		private final class MockJavaObject implements JavaObject {
+			
+			private JavaClass clazz=null;
+			private long addr=0;			
+			public MockJavaObject(JavaClass c1) {
+				this.clazz=c1;
+					lastaddr++;
+					addr=lastaddr;
+
+			}
+
+			@Override
+			public boolean isArray() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+
+			@Override
+			public long getSize() throws CorruptDataException {
+			
+				return 0;
+			}
+
+			@Override
+			public List<ImageSection> getSections() {
+			
+				return null;
+			}
+
+			@Override
+			public List<JavaReference> getReferences() {
+			
+				return null;
+			}
+
+			@Override
+			public long getPersistentHashcode() throws DataUnavailable,
+					CorruptDataException {
+			
+				return 0;
+			}
+
+			@Override
+			public JavaClass getJavaClass() throws CorruptDataException {
+				return clazz;
+			}
+
+			@Override
+			public ImagePointer getID() {
+			return new MockPointer(addr);
+			}
+
+			@Override
+			public JavaHeap getHeap() throws CorruptDataException, DataUnavailable {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public long getHashcode() throws DataUnavailable, CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public int getArraySize() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public void arraycopy(int srcStart, Object dst, int dstStart, int length)
+					throws CorruptDataException, MemoryAccessException {
+				// TODO Auto-generated method stub
+				
+			}
+		}
+
+		private final class MockJavaClass implements JavaClass {
+			
+			
+
+			private long addr=0;
+			public MockJavaClass() {
+			
+				lastaddr++;
+				addr=lastaddr;
+			}
+
+			
+			 
+			
+			@Override
+			public JavaClassLoader getClassLoader()
+					throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public JavaClass getComponentType() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public List<JavaObject> getConstantPoolReferences() {
+			
+				return null;
+			}
+
+			@Override
+			public List<JavaField> getDeclaredFields() {
+			
+				return null;
+			}
+
+			@Override
+			public List<JavaMethod> getDeclaredMethods() {
+			
+				return null;
+			}
+
+			@Override
+			public ImagePointer getID() {
+			 
+				return new MockPointer(addr);
+			}
+
+			@Override
+			public List<String> getInterfaces() {
+			
+				return null;
+			}
+
+			@Override
+			public int getModifiers() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public String getName() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public JavaObject getObject() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public List<JavaReference> getReferences() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public JavaClass getSuperclass() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public boolean isArray() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return false;
+			}
+		}
+
+		private final class MockHeap implements JavaHeap {
+			private final List<JavaObject> objects;
+
+			private MockHeap(List<JavaObject> objects) {
+				this.objects = objects;
+			}
+
+			@Override
+			public String getName() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public List<JavaObject> getObjects() {
+				return objects;
+			}
+
+			@Override
+			public List<ImageSection> getSections() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+		}
+
+		List<JavaHeap> heaps=new LinkedList<JavaHeap>();
+		public MockJavaRuntime() {
+			
+			JavaClass  c1=new MockJavaClass();
+			JavaObject a1=new MockJavaObject(c1);
+			JavaClass  c2=new MockJavaClass();
+			JavaObject b1=new MockJavaObject(c2);
+			JavaObject b2=new MockJavaObject(c2);
+			
+			final List<JavaObject> objects=new LinkedList<JavaObject>();
+			objects.add(a1);
+			objects.add(b1);
+			objects.add(b2);
+			
+			heaps.add(new MockHeap(objects));
+		}
+
+		
+		
+		@Override
+		public String getVersion() throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public String getFullVersion() throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public Object getTraceBuffer(String bufferName, boolean formatted)
+				throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public List<JavaThread> getThreads() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public File getSource() {
+			return new File("testfile.txt");
+		}
+
+		@Override
+		public JavaObject getObjectAtAddress(ImagePointer address)
+				throws CorruptDataException, IllegalArgumentException,
+				MemoryAccessException, DataUnavailable {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public List<JavaMonitor> getMonitors() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public JavaVMInitArgs getJavaVMInitArgs() throws DataUnavailable,
+				CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public ImagePointer getJavaVM() throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public List<JavaClassLoader> getJavaClassLoaders() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public List<JavaHeap> getHeaps() {
+			return heaps;
+		}
+
+		@Override
+		public List<JavaReference> getHeapRoots() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public List<JavaMethod> getCompiledMethods() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+	}
+
+	/**
+	 * Test we can create a persistent store from scratch
+	 * @throws IOException
+	 */
+	public void testCreate() throws IOException {
+		
+		File storeDir=getStoreDir();
+		if(storeDir.exists()) {
+			if(storeDir.isDirectory()) {
+				deleteFile(storeDir);
+			}
+			else {
+				throw new RuntimeException("test directory "+storeDir.getAbsolutePath()+" is not a directory");
+			}
+		}
+		
+		getStore(new MockJavaRuntime());
+	}
+	 
+	public void testSmallPopulateClassObjectTable() throws IOException {
+		
+		JavaRuntime jrt=new MockJavaRuntime();
+		PersistentStore store=getStore(jrt);
+		
+		// add in class object data
+		
+		Table table=store.getClassObjectTable();
+		
+		for(JavaHeap heap:jrt.getHeaps()) {
+			for(JavaObject object:heap.getObjects()) {
+				try {
+					JavaClass clazz=object.getJavaClass();
+					if(clazz!=null) {
+						long clazz_addr=clazz.getID().getAddress();
+						long obj_addr=object.getID().getAddress();
+						table.put(clazz_addr,obj_addr);
+					}
+				} catch (CorruptDataException e) {
+					
+				}
+				
+			}
+		}
+		
+		long records=table.setSize();
+		store.close();
+		
+		assertEquals(3,records);
+		
+		
+		
+		
+	}
+}

Propchange: incubator/kato/branches/experimental/kato.javaview/src/test/java/test/apache/kato/javaview/TestPersistentStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message