Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2011-10-26 14:05:55 -0400
committerChristopher Frost2011-10-26 14:05:55 -0400
commit252dd84cc5a980d124ef6447e9a632973c4d3461 (patch)
treef4b57294ebd21a5195980a103e7722742d4fdd50
parentf76c013849dcc32cecbba5fc807311481c36a96c (diff)
downloadorg.eclipse.virgo.medic-252dd84cc5a980d124ef6447e9a632973c4d3461.tar.gz
org.eclipse.virgo.medic-252dd84cc5a980d124ef6447e9a632973c4d3461.tar.xz
org.eclipse.virgo.medic-252dd84cc5a980d124ef6447e9a632973c4d3461.zip
360646 Adding a slight change to the MBean api
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java2
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java14
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java4
-rw-r--r--org.eclipse.virgo.medic.test/.classpath2
4 files changed, 12 insertions, 10 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
index e424a79..1a4d902 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
@@ -70,5 +70,5 @@ public interface DumpInspector {
*
* @param dumpId
*/
- void delete(String dumpId);
+ void deleteDump(String dumpId);
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
index 8c8a074..ad1174c 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
@@ -33,6 +33,8 @@ import org.eclipse.virgo.util.io.FileSystemUtils;;
*/
public class FileSystemDumpInspector implements DumpInspector {
+ private static final String OSGI_STATE_STRING = "OSGi-state";
+
private final Logger logger = LoggerFactory.getLogger(FileSystemDumpInspector.class);
private final DumpGenerator generator;
@@ -70,18 +72,18 @@ public class FileSystemDumpInspector implements DumpInspector {
}
File dumpDir = new File(getDumpDirectory(), dumpId);
if(dumpDir != null && dumpDir.exists() && dumpDir.isDirectory()){
- List<String> dumpItems = Arrays.asList(FileSystemUtils.list(dumpDir, this.logger));
+ List<String> dumpItems = new ArrayList<String>(Arrays.asList(FileSystemUtils.list(dumpDir, this.logger)));
if(dumpItems.contains("osgi.zip") && dumpItems.contains("region.digraph")){
- dumpItems.add("OSGi state");
+ dumpItems.add(OSGI_STATE_STRING);
}
dumpItems.remove("osgi.zip");
dumpItems.remove("region.digraph");
String[][] result = new String[dumpItems.size()][];
for(int i = 0; i < dumpItems.size(); i++) {
- if("OSGi state".equals(dumpItems.get(i))){
- result[i] = new String[]{dumpItems.get(i), "StateDumpInspector", getConfiguredDumpDirectory() + File.separatorChar + dumpId};
+ if(OSGI_STATE_STRING.equals(dumpItems.get(i))){
+ result[i] = new String[]{dumpItems.get(i), "StateDumpInspector/getSummary/" + getConfiguredDumpDirectory().replace("/", "!/") + "!/" + dumpId};
}else{
- result[i] = new String[]{dumpItems.get(i), "DumpInspector"};
+ result[i] = new String[]{dumpItems.get(i), "DumpInspector/getDumpEntry/" + dumpId + "/" + dumpItems.get(i)};
}
}
return result;
@@ -132,7 +134,7 @@ public class FileSystemDumpInspector implements DumpInspector {
}
@Override
- public void delete(String dumpId) {
+ public void deleteDump(String dumpId) {
File dumpDir = getDumpDirectory();
if(dumpDir != null && dumpDir.exists() && dumpDir.isDirectory()){
File root = new File(dumpDir, dumpId);
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java
index a928780..9652128 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java
@@ -60,7 +60,7 @@ public class FileSystemDumpInspectorTests {
public void testGetDumpEntries() throws IOException {
String[][] dumpEntries = fileSystemDumpInspector.getDumpEntries("testDump");
assertTrue(dumpEntries.length == 1);
- assertArrayEquals("Unexpected dump found" + dumpEntries[0], new String[]{"testDumpItem.txt", "DumpInspector"}, dumpEntries[0]);
+ assertArrayEquals(new String[]{"testDumpItem.txt", "DumpInspector/getDumpEntry/testDump/testDumpItem.txt"}, dumpEntries[0]);
}
@Test
@@ -97,7 +97,7 @@ public class FileSystemDumpInspectorTests {
File deleteMe = new File("src/test/resources/testDumps/serviceability/dump/deleteMe");
deleteMe.mkdir();
assertTrue(deleteMe.exists() && deleteMe.isDirectory());
- fileSystemDumpInspector.delete("deleteMe");
+ fileSystemDumpInspector.deleteDump("deleteMe");
assertFalse(deleteMe.exists());
}
diff --git a/org.eclipse.virgo.medic.test/.classpath b/org.eclipse.virgo.medic.test/.classpath
index ed078d7..60f875e 100644
--- a/org.eclipse.virgo.medic.test/.classpath
+++ b/org.eclipse.virgo.medic.test/.classpath
@@ -20,8 +20,8 @@
<attribute name="com.springsource.server.ide.jdt.core.test.classpathentry" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.medic"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

Back to the top