You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by sp...@apache.org on 2009/12/20 00:53:42 UTC
svn commit: r892543 - in /incubator/kato/trunk/org.apache.kato:
kato.api.vm/src/main/java/javax/tools/diagnostics/vm/
kato.common.142/src/main/java/org/apache/kato/common142/ kato.distro/
kato.distro/src/main/assembly/ kato.tck/harness/src/main/java/or...
Author: spoole
Date: Sun Dec 20 00:53:41 2009
New Revision: 892543
URL: http://svn.apache.org/viewvc?rev=892543&view=rev
Log:
added assembly to create standalone tck secenario setup jar. Also tweeked dump trigger mechanism in scenario launcher etc so it will look for the VMAPI library if not told where it is.
Added:
incubator/kato/trunk/org.apache.kato/kato.distro/src/main/assembly/tckdist.xml
Modified:
incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/Dump.java
incubator/kato/trunk/org.apache.kato/kato.common.142/src/main/java/org/apache/kato/common142/DumpTrigger.java
incubator/kato/trunk/org.apache.kato/kato.distro/pom.xml
incubator/kato/trunk/org.apache.kato/kato.tck/harness/src/main/java/org/apache/kato/tck/harness/scenario/ScenarioLauncher.java
Modified: incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/Dump.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/Dump.java?rev=892543&r1=892542&r2=892543&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/Dump.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/Dump.java Sun Dec 20 00:53:41 2009
@@ -13,6 +13,8 @@
******************************************************************************/
package javax.tools.diagnostics.vm;
+import java.io.File;
+import java.io.IOException;
import java.lang.reflect.Method;
/**
@@ -233,7 +235,14 @@
public boolean dump() {
- return false;
+ File dumpFile=new File("kato.dump.placebo");
+ try {
+ return dumpFile.createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+
}
public boolean available() {
Modified: incubator/kato/trunk/org.apache.kato/kato.common.142/src/main/java/org/apache/kato/common142/DumpTrigger.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.common.142/src/main/java/org/apache/kato/common142/DumpTrigger.java?rev=892543&r1=892542&r2=892543&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.common.142/src/main/java/org/apache/kato/common142/DumpTrigger.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.common.142/src/main/java/org/apache/kato/common142/DumpTrigger.java Sun Dec 20 00:53:41 2009
@@ -13,6 +13,8 @@
******************************************************************************/
package org.apache.kato.common142;
+import java.io.File;
+
/**
* This class provides access to native function used to send a signal back to the
* invoking JVM with the intent of triggering a Dump.
@@ -22,28 +24,74 @@
private static final String libraryPathName="org.apache.kato.dumptrigger.librarypath";
- private static DumpTrigger trigger=new DumpTrigger();
+ private static DumpTrigger trigger=null;
+ static {
+ new DumpTrigger();
+ }
private DumpTrigger () {
+
String pathName=System.getProperty(libraryPathName);
- if(pathName==null) throw new RuntimeException("DumpTrigger pathname system property "+libraryPathName+" is missing");
- pathName=pathName.trim();
- if(pathName.equals("")) throw new RuntimeException("DumpTrigger pathname system property "+libraryPathName+" is empty");
+ if(pathName!=null) {
+ pathName=pathName.trim();
+ if(pathName.equals("")) throw new RuntimeException("DumpTrigger pathname system property "+libraryPathName+" is empty");
+ System.load(pathName);
+ trigger=this;
+ }
+ else {
+ // no overt specification of a library so lets go looking...
+ // look for a file with katovmapi in the name...
+ pathName=findLocalLibrary();
+ if(pathName!=null) {
+ System.load(pathName);
+ trigger=this;
+ }
+ }
+
- System.load(pathName);
}
+ private String findLocalLibrary() {
+
+
+ String lib=findLib(".");
+ if(lib!=null) return lib;
+ lib=findLib("lib");
+
+ return lib;
+
+ }
+
+ private String findLib(String location) {
+ File dir=new File(location);
+ if(dir.exists()==false) return null; // doesn't exists
+ if(dir.isDirectory()==false) return null; // not a directory
+ File[] kids=dir.listFiles();
+ if(kids==null || kids.length==0) return null; // no contents
+
+ for(int i=0;i<kids.length;i++) {
+ File child=kids[i];
+ if(child.isFile()) {
+ String name=child.getName();
+ if(name.indexOf("katovmapi")>=0) return child.getAbsolutePath();
+ }
+ }
+ return null;
+ }
+
public static boolean triggerDump() {
+ if(trigger==null) return false;
+
int pid=getProcessID();
return trigger.sendDumpSignal(pid);
}
public static int getProcessID() {
-
+ if(trigger==null) return 0;
return trigger.getNativeProcessID();
}
Modified: incubator/kato/trunk/org.apache.kato/kato.distro/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.distro/pom.xml?rev=892543&r1=892542&r2=892543&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.distro/pom.xml (original)
+++ incubator/kato/trunk/org.apache.kato/kato.distro/pom.xml Sun Dec 20 00:53:41 2009
@@ -1,131 +1,161 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
--->
-
- <parent>
- <artifactId>kato</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.kato</groupId>
- <artifactId>kato.distro</artifactId>
- <packaging>pom</packaging>
- <version>M1-incubating</version>
- <name>Kato runtime distribution packaging</name>
-
- <!-- List dependencies here for consideration by the
- assembly plugin
- -->
-
- <dependencies>
- <dependency>
- <artifactId>kato.api</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
-
-<!-- Includes API JavaDoc -->
- <dependency>
- <artifactId>kato.api.vm</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- <classifier>javadoc</classifier>
- </dependency>
- <dependency>
- <artifactId>kato.api</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- <classifier>javadoc</classifier>
- </dependency>
- <dependency>
- <artifactId>kato.common</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.common</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.hprof.api</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.hprof.reader</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.jdi</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.cjvmti</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.tools.katoview</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.jdi</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- </dependency>
- <dependency>
- <artifactId>kato.demo.tomcat</artifactId>
- <groupId>org.apache.kato</groupId>
- <version>M1-incubating</version>
- <type>war</type>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <!--<executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>assembly</goal>
- </goals>
- </execution>
- </executions>-->
- <configuration>
- <finalName>apache-kato-${project.version}</finalName>
- <descriptors>
- <descriptor>src/main/assembly/bindist.xml</descriptor>
- <descriptor>src/main/assembly/tomcatdemodist.xml</descriptor>
- <descriptor>src/main/assembly/src.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
-
- </plugin>
- </plugins>
- </build>
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one * or more
+ contributor license agreements. See the NOTICE file * distributed with
+ this work for additional information * regarding copyright ownership.
+ The ASF licenses this file * to you 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.
+ -->
+
+ <parent>
+ <artifactId>kato</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.kato</groupId>
+ <artifactId>kato.distro</artifactId>
+ <packaging>pom</packaging>
+ <version>M1-incubating</version>
+ <name>Kato runtime distribution packaging</name>
+
+ <!--
+ List dependencies here for consideration by the assembly plugin
+ -->
+
+ <dependencies>
+ <dependency>
+ <artifactId>kato.api</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+
+ <!-- Includes API JavaDoc -->
+ <dependency>
+ <artifactId>kato.api.vm</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <artifactId>kato.api</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <artifactId>kato.common</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.common</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.hprof.api</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.hprof.reader</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.jdi</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.cjvmti</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.tools.katoview</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.jdi</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.demo.tomcat</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <artifactId>kato.tck.testcases</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.tck.scenario.142</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.tck.scenario.150</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ <dependency>
+ <artifactId>kato.tck.scenario.160</artifactId>
+ <groupId>org.apache.kato</groupId>
+ <version>M1-incubating</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>apache-kato-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/main/assembly/tckdist.xml</descriptor>
+ </descriptors>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.kato.tck.harness.scenario.ScenarioLauncher</mainClass>
+ </manifest>
+ </archive>
+
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <finalName>apache-kato-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/main/assembly/bindist.xml</descriptor>
+ <descriptor>src/main/assembly/tomcatdemodist.xml</descriptor>
+ <descriptor>src/main/assembly/src.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added: incubator/kato/trunk/org.apache.kato/kato.distro/src/main/assembly/tckdist.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.distro/src/main/assembly/tckdist.xml?rev=892543&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.distro/src/main/assembly/tckdist.xml (added)
+++ incubator/kato/trunk/org.apache.kato/kato.distro/src/main/assembly/tckdist.xml Sun Dec 20 00:53:41 2009
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<!--
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+-->
+<assembly>
+ <id>tck</id>
+ <formats>
+ <format>jar</format>
+
+ </formats>
+ <baseDirectory>/</baseDirectory>
+ <fileSets>
+
+ <!--
+ Place readme into base directory, including other docs.
+ -->
+ <fileSet>
+ <directory>src/main/readme/</directory>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ </fileSet>
+
+
+
+ <!--
+ Places the disclaimer, licence and notice files
+ from the project directory into the binary base directory.
+ -->
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>DISCLAIMER.txt</include>
+ <include>NOTICE</include>
+ <include>LICENSE</include>
+ </includes>
+ <fileMode>644</fileMode>
+ </fileSet>
+
+ </fileSets>
+
+
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>kato.api*</include>
+ <include>kato.common*</include>
+ <include>kato.cjvmti*</include>
+ <include>kato.hprof*</include>
+ <include>kato.tck.*</include>
+ <include>commons*</include>
+ </includes>
+ <excludes>
+ <exclude>org.apache.kato:kato.api:jar:javadoc:*</exclude>
+ <exclude>org.apache.kato:kato.api.vm:jar:javadoc:*</exclude>
+ </excludes>
+ <unpack>true</unpack>
+ <unpackOptions>
+ <excludes>
+ <exclude>**/pom.*</exclude>
+ <exclude>**/maven/**</exclude>
+ <exclude>**/LICENCE</exclude>
+ <exclude>**/NOTICE</exclude>
+ <exclude>**/DISCLAIMER.txt</exclude>
+ </excludes>
+ </unpackOptions>
+ <scope>runtime</scope>
+ </dependencySet>
+
+ </dependencySets>
+</assembly>
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=892543&r1=892542&r2=892543&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 Sun Dec 20 00:53:41 2009
@@ -334,8 +334,9 @@
private String getTriggerClassName(String dumpClassName) {
if(dumpClassName!=null && dumpClassName.trim().equals("")==false) return dumpClassName;
-
- return StandardDumpTrigger.class.getCanonicalName();
+
+ return StandardDumpTrigger.class.getName();
+
}
/**