incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r892789 - in /incubator/kato/trunk/org.apache.kato/kato.tck: harness/src/main/java/org/apache/kato/tck/harness/scenario/ scenarios/142/src/main/java/org/apache/kato/tck/scenario142/
Date Mon, 21 Dec 2009 12:10:45 GMT
Author: spoole
Date: Mon Dec 21 12:10:44 2009
New Revision: 892789

URL: http://svn.apache.org/viewvc?rev=892789&view=rev
Log:
updated harness and Scenario Launcher so a specific dump format can be specified when generating
a dump

Modified:
    incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/IDumpTrigger.java
    incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/PlaceboDumpTrigger.java
    incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java
    incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/StandardDumpTrigger.java
    incubator/kato/trunk/org.apache.kato/kato.tck/scenarios/142/src/main/java/org/apache/kato/tck/scenario142/DumpTrigger142.java

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/IDumpTrigger.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/IDumpTrigger.java?rev=892789&r1=892788&r2=892789&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/IDumpTrigger.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/IDumpTrigger.java
Mon Dec 21 12:10:44 2009
@@ -34,5 +34,12 @@
 	 * @throws IOException 
 	 */
 	public void dump() throws IOException;
+
+	/**
+	 * Specify the dump format to produce
+	 * 
+	 * @param dumpFormat
+	 */
+	public void setDumpFormat(String dumpFormat);
 	
 }

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/PlaceboDumpTrigger.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/PlaceboDumpTrigger.java?rev=892789&r1=892788&r2=892789&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/PlaceboDumpTrigger.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/PlaceboDumpTrigger.java
Mon Dec 21 12:10:44 2009
@@ -40,4 +40,14 @@
 		
 	}
 
+	/**
+	 * Sets the dump format to produce.
+	 * Ignored by this trigger
+	 * 
+	 */
+	public void setDumpFormat(String dumpFormat) {
+		
+		
+	}
+
 }

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java?rev=892789&r1=892788&r2=892789&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java
Mon Dec 21 12:10:44 2009
@@ -31,6 +31,8 @@
  * 
  */
 public class ScenarioLauncher {
+	private static final String DUMPTYPE = "dumptype";
+
 	/**
 	 * 
 	 */
@@ -75,7 +77,7 @@
 		options.addOption(clazz);
 
 		Option mode = OptionBuilder.withArgName("modetype").hasArg()
-				.withDescription("run mode: report or execute").create(MODE2);
+				.withDescription("run mode: config or run").create(MODE2);
 		mode.setRequired(true);
 		options.addOption(mode);
 		
@@ -87,6 +89,10 @@
 		.withDescription("Dump trigger class name (defaults to jvm level specific dump trigger)").create(DUMPTRIGGER);
 		options.addOption(dumpclass);
 		
+		Option dumptype = OptionBuilder.withArgName(DUMPTYPE).hasArg()
+		.withDescription("dump type to generate").create(CLASS);
+		options.addOption(dumptype);
+
 		return options;
 		
 	}
@@ -273,6 +279,10 @@
 					
 					// 	do we have the dump trigger class?
 					IDumpTrigger trigger=instantiateTriggerClass(line.getOptionValue(DUMPTRIGGER));
+					// do we have a overide to the dump type?
+					String dumpFormat = line.getOptionValue(DUMPTYPE);
+					if(dumpFormat!=null) trigger.setDumpFormat(dumpFormat);
+					
 					if(trigger==null) return null; // error already reported
 					
 					handler=new ScenarioSetupHandler(trigger);

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/StandardDumpTrigger.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/StandardDumpTrigger.java?rev=892789&r1=892788&r2=892789&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/StandardDumpTrigger.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/StandardDumpTrigger.java
Mon Dec 21 12:10:44 2009
@@ -18,14 +18,37 @@
 
 import javax.tools.diagnostics.vm.DumpFactory;
 import javax.tools.diagnostics.vm.DumpHandle;
+import javax.tools.diagnostics.vm.DumpInitiatorDelegate;
 
 public class StandardDumpTrigger implements IDumpTrigger {
 
+	private String format=null;
+	
 	public void dump() throws IOException {
+		
+		DumpHandle handle=null;
+		
 		DumpFactory d=DumpFactory.getDefault();
-		DumpHandle handle=d.createDumpHandle();
+		
+		if(format!=null) {
+			DumpInitiatorDelegate delegate=d.getInitiator(format);
+			if(delegate==null) {
+				System.out.println("Dump format "+format+" requested but unavailable");
+			}
+			else {
+				handle=delegate.createDumpHandle();
+			}
+			
+		}
+		if(handle==null)handle=d.createDumpHandle();
+		
 		handle.dump();
 		
 	}
 
+	public void setDumpFormat(String dumpFormat) {
+		this.format=dumpFormat;
+		
+	}
+
 }

Modified: incubator/kato/trunk/org.apache.kato/kato.tck/scenarios/142/src/main/java/org/apache/kato/tck/scenario142/DumpTrigger142.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.tck/scenarios/142/src/main/java/org/apache/kato/tck/scenario142/DumpTrigger142.java?rev=892789&r1=892788&r2=892789&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.tck/scenarios/142/src/main/java/org/apache/kato/tck/scenario142/DumpTrigger142.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.tck/scenarios/142/src/main/java/org/apache/kato/tck/scenario142/DumpTrigger142.java
Mon Dec 21 12:10:44 2009
@@ -23,4 +23,9 @@
 		
 	}
 
+	public void setDumpFormat(String dumpFormat) {
+		// TODO Auto-generated method stub
+		
+	}
+
 }



Mime
View raw message