Index: run/run.api.net.xml =================================================================== --- run/run.api.net.xml (revision 551525) +++ run/run.api.net.xml (working copy) @@ -22,6 +22,15 @@ + + + + + + + + - + run.api.io, run.api.net, run.vm, run.api.util, run.api.security, run.api.serialization"/> Index: run/run.vm.xml =================================================================== --- run/run.vm.xml (revision 551525) +++ run/run.vm.xml (working copy) @@ -40,6 +40,9 @@ + + + Index: run/run.api.kernel.xml =================================================================== --- run/run.api.kernel.xml (revision 551525) +++ run/run.api.kernel.xml (working copy) @@ -24,7 +24,7 @@ + run.api.kernel.management, run.api.kernel.compiler" /> @@ -73,6 +73,12 @@ + + + + + + Index: run/run.normal.mode.settings.xml =================================================================== --- run/run.normal.mode.settings.xml (revision 551525) +++ run/run.normal.mode.settings.xml (working copy) @@ -471,6 +471,14 @@ + + + + + + + + @@ -482,6 +490,21 @@ + + + + + + + + + + + + + + + Index: src/java/org/apache/harmony/test/reliability/share/JarFilesScanner.java =================================================================== --- src/java/org/apache/harmony/test/reliability/share/JarFilesScanner.java (revision 551525) +++ src/java/org/apache/harmony/test/reliability/share/JarFilesScanner.java (working copy) @@ -41,7 +41,7 @@ static ArrayList classFiles = new ArrayList(); // contains names of found class files static Boolean cache = false; - public ArrayList getJarFilesInJRE(){ + public static ArrayList getJarFilesInJRE(){ if (cache == false) { String rootDir = getDirToScanForJarFiles(); scanDirForJarFiles(rootDir); @@ -50,7 +50,7 @@ return jarFiles; } - public ArrayList getClassFilesInJRE(){ + public static ArrayList getClassFilesInJRE(){ if (cache == false) { getJarFilesInJRE(); @@ -74,11 +74,11 @@ return classFiles; } - String getDirToScanForJarFiles() { + static String getDirToScanForJarFiles() { return System.getProperty("java.home"); } - void scanDirForJarFiles(String rootDir) { + static void scanDirForJarFiles(String rootDir) { try { Index: src/java/org/apache/harmony/test/reliability/vm/classloading/ClassReflectionTest.java =================================================================== --- src/java/org/apache/harmony/test/reliability/vm/classloading/ClassReflectionTest.java (revision 551525) +++ src/java/org/apache/harmony/test/reliability/vm/classloading/ClassReflectionTest.java (working copy) @@ -45,14 +45,22 @@ import java.lang.reflect.GenericSignatureFormatError; import java.lang.reflect.MalformedParameterizedTypeException; import java.lang.reflect.Method; +import org.apache.harmony.test.reliability.share.ClassMultiTestBase; public class ClassReflectionTest extends ClassMultiTestBase{ public static void main(String[] args){ System.exit(new ClassReflectionTest().test(args)); } - - void testContent(Class cls) { + + public void initCycle() { + // do nothing + } + public void releaseCycle() { + // do nothing + } + + public void testContent(Class cls) { Constructor[] ctrs = null; try{ ctrs = cls.getConstructors(); Index: src/java/org/apache/harmony/test/reliability/vm/classloading/ClassMultiTestBase.java =================================================================== --- src/java/org/apache/harmony/test/reliability/vm/classloading/ClassMultiTestBase.java (revision 551525) +++ src/java/org/apache/harmony/test/reliability/vm/classloading/ClassMultiTestBase.java (working copy) @@ -1,131 +0,0 @@ -/* - * Copyright 2007 The Apache Software Foundation or its licensors, as applicable - * - * 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. - */ - -/** - * @author Aleksey Ignatenko - * @version $Revision: 1.0 $ - */ - -/** - * NOTE: this class is not a test for running, it is a base class for other tests which - * process classes from "java.home"'s jar files. - * - * The class does: - * 1. Reads parameter, which is: - * param[0] - number of threads to launch for parallel classes processing - * param[1] - flag indicates what OS is used, true == linux, it is required not to initialize loaded classes as it requires - * XServer to be up. - * - * 2. Gets names of all classes from all jar files found in "java.home" and its subdirectories. - * - * 2. Starts param[0] threads. - * Each thread: - * For each class name: - * - tries to load the class by Class.forName() (classes are not initialized on linux because it requires XServer to be up) - * - if class could not be loaded for any reason, it is ignored, otherwise, - * - testContent() method which must be overridden in real tests is invoked. - * - * 3. If there are no unexpected exceptions, PASS status is returned, otherwise, FAIL - */ - -package org.apache.harmony.test.reliability.vm.classloading; - -import java.util.ArrayList; -import java.lang.reflect.*; -import java.lang.annotation.*; - -import org.apache.harmony.test.reliability.share.Test; -import org.apache.harmony.test.reliability.share.JarFilesScanner; - - -public class ClassMultiTestBase extends Test implements Runnable{ - volatile boolean failed = false; - final static String classFilesExt = ".class"; - final static char slashCharDelimiter1 = '/'; - final static char slashCharDelimiter2 = '\\'; - final static char dotCharDelimiter = '.'; - final static int NUMBER_OF_THREADS = 3; - int numberOfThreads = NUMBER_OF_THREADS; - int classCounter = 0; - ArrayList jarFiles; - - void testContent(Class cls) { - fail("The " + this.getClass().getName() + " class is for infra purposes only! - NOT TEST!"); - } - - public int test(String []args){ - parseParams(args); - jarFiles = new JarFilesScanner().getClassFilesInJRE(); - - - Thread[] thrds = new Thread[numberOfThreads]; - for (int i = 0; i< thrds.length; i++){ - thrds[i] = new Thread(this); - thrds[i].start(); - } - - for (int i = 0; i< thrds.length; i++){ - try { - thrds[i].join(); - } catch (InterruptedException e) { - failed = true; - log.add("Failed to join thread " + e); - } - } - - if (failed){ - return fail("FAILED"); - } - //System.out.println("Number of classes tested "+ classCounter); - return pass("OK"); - } - - - public void run(){ - for (int i=0; i= 1) { - numberOfThreads = Integer.parseInt(params[0]); - } - } - -} - Index: src/java/org/apache/harmony/test/reliability/vm/classloading/ClassAttributesTest.java =================================================================== --- src/java/org/apache/harmony/test/reliability/vm/classloading/ClassAttributesTest.java (revision 551525) +++ src/java/org/apache/harmony/test/reliability/vm/classloading/ClassAttributesTest.java (working copy) @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + /** * @author Aleksey Ignatenko * @version $Revision: 1.0 $ */ /** - * GOAL: the test checks that for each loaded class (from "java.home") invocation of java.lang.Class methods + * GOAL: the test checks that for each loaded class (from "java.home") invocation of java.lang.Class methods * in multiple threads running in parallel does not cause unexpected errors (crashes, hangs, exceptions). * * NOTE: see additional description in ClassMultiBase class. @@ -42,14 +42,22 @@ import java.lang.reflect.GenericSignatureFormatError; import java.lang.reflect.MalformedParameterizedTypeException; +import org.apache.harmony.test.reliability.share.ClassMultiTestBase; public class ClassAttributesTest extends ClassMultiTestBase{ public static void main(String[] args){ System.exit(new ClassAttributesTest().test(args)); } + + public void initCycle() { + // do nothing + } + public void releaseCycle() { + // do nothing + } - void testContent(Class cls) { + public void testContent(Class cls) { cls.getName(); cls.getAnnotations(); try{