Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 31757 invoked from network); 20 Jun 2007 08:09:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 08:09:24 -0000 Received: (qmail 72867 invoked by uid 500); 20 Jun 2007 08:09:27 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 72852 invoked by uid 500); 20 Jun 2007 08:09:27 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Delivered-To: moderator for commits@harmony.apache.org Received: (qmail 13747 invoked by uid 99); 20 Jun 2007 03:50:43 -0000 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r548917 - in /harmony/enhanced/buildtest/branches/2.0/tests/reliability: run/ src/java/org/apache/harmony/test/reliability/api/kernel/exec/ src/java/org/apache/harmony/test/reliability/api/kernel/hooks/ src/java/org/apache/harmony/test/reli... Date: Wed, 20 Jun 2007 03:50:18 -0000 To: commits@harmony.apache.org From: ivavladimir@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070620035018.627501A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ivavladimir Date: Tue Jun 19 20:50:16 2007 New Revision: 548917 URL: http://svn.apache.org/viewvc?view=rev&rev=548917 Log: issue 4144 was fixed Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.api.kernel.xml harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.xml harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/ExecApplication.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/RunExec.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/hooks/AddRmShtdwnHooksTest.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/RecursiveThreadTest/RecursiveTest.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/VolatileVariableTest/DekkerTest.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/NetClient.java harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/auxiliary/Test_lnx.out harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/nio/channels/filechannel/FileChannelMapTest.java Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.api.kernel.xml URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.api.kernel.xml?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.api.kernel.xml (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.api.kernel.xml Tue Jun 19 20:50:16 2007 @@ -44,7 +44,7 @@ + ${api.kernel.exec.RunExec.num_threads} ${test.classes.dir} ${jvm.under.test} ${test.classes.dir}" /> Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.xml URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.xml?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.xml (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/run/run.xml Tue Jun 19 20:50:16 2007 @@ -20,12 +20,22 @@ Run reliability testsuite + + + + - + - + + + + + + + @@ -90,6 +100,13 @@ + + + + Could not locate jvm executable to test, please, set "jvm.under.test" property. + + + Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/ExecApplication.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/ExecApplication.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/ExecApplication.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/ExecApplication.java Tue Jun 19 20:50:16 2007 @@ -150,7 +150,8 @@ prnWriter = new PrintWriter(new BufferedWriter(new FileWriter( filename))); } catch (IOException e) { - e.printStackTrace(); + RunExec.log.add("Failed to create PrintWriter, file name: " + filename); + return; } try { @@ -159,14 +160,15 @@ } } catch (IOException e) { - e.printStackTrace(); + RunExec.log.add("Failed print into file: " + filename); } finally { try { prnWriter.close(); bufReader.close(); in.close(); } catch (IOException e) { - e.printStackTrace(); + //e.printStackTrace(); + // Expected } } } @@ -195,11 +197,11 @@ } } } catch (FileNotFoundException e) { - System.out.println("Read the content of the file" + filename + ". The file does not exist"); - e.printStackTrace(); + RunExec.log.add("Read the content of the file" + filename + ". The file does not exist: " + e.getMessage()); + //e.printStackTrace(); } catch (IOException ee) { - System.out.println("Read a line of text: I/O error occurs"); - ee.printStackTrace(); + RunExec.log.add("Read a line of text: I/O error occurs: " + ee.getMessage()); + //ee.printStackTrace(); } finally { try { bufReader.close(); @@ -228,20 +230,20 @@ } } if (!result) { - System.out.println("Line is not found in the file " + filename + RunExec.log.add("Line is not found in the file " + filename + ". Number of lines = " + strcounter); + return result; } strcounter = strcounter - 2; if (strcounter != cntline) { - System.out.println("Invalid number of lines in the file " + RunExec.log.add("Invalid number of lines in the file " + filename + ". Number of lines = " + strcounter); result = false; } return result; } - public boolean checkSomeLine(String filename, String linestartswith, - String lineendswith, int cntline) { + public boolean checkSomeLine2(String filename, String linestartswith, int cntline) { int strcounter = 0; String line; boolean result = false; @@ -249,7 +251,7 @@ line = readLineFromFile(filename, strcounter); if (line != null) { for (int i = 0; i <= cntline; i++) { - if (checkLine(line, linestartswith, lineendswith)) { + if (checkLine(line, linestartswith, "")) { result = true; break; } @@ -258,7 +260,7 @@ } } if (!result) { - System.out.println("Invalid number of lines in the file " + RunExec.log.add("Invalid number of lines in the file " + filename + ". Number of lines = " + strcounter); } return result; @@ -281,7 +283,7 @@ fln = listFiles[i].getName(); if (fln.equals(filename)) { if (!listFiles[i].delete()) { - System.out.println("delete " + fln + " : failed"); + RunExec.log.add("delete " + fln + " : failed"); return false; } @@ -296,7 +298,7 @@ if (process != null) { exitvalue = processWaitFor(process); if (exitvalue != 104) { - System.out.println("the exit value = " + exitvalue + RunExec.log.add("the exit value = " + exitvalue + " The exit value of the process should be 104."); } } Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/RunExec.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/RunExec.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/RunExec.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/exec/RunExec.java Tue Jun 19 20:50:16 2007 @@ -40,7 +40,6 @@ public class RunExec extends Test { - int cnt = ExecApplication.getCnt(); String ins = ExecApplication.fileNameforIn(); String err = ExecApplication.fileNameforErr(); String ins_i; @@ -48,12 +47,9 @@ String line; int secarg = 0; int strcounter; + String tmpFolder = System.getProperty("java.io.tmpdir"); public int test(String params[]) { - String userdir = System.getProperty("java.io.tmpdir") + File.separator + "reliability_exec"; - File temp = new File(userdir); - temp.mkdir(); - if (params.length >= 1) { ExecApplication.setId(Integer.parseInt(params[0])); } @@ -70,6 +66,21 @@ ExecApplication.testedruntime = params[3]; } + if (params.length >= 5) { + tmpFolder = params[4]; + } + + int cnt = ExecApplication.getCnt(); + + String userdir = tmpFolder + File.separator + "reliability_exec"; + File temp = new File(userdir); + if (!temp.exists()) + { + if (!temp.mkdir()){ + return fail("Failed to create folder " + temp.getAbsolutePath()); + } + } + String longstr = ShutdownHookApp.getLongString(); for (int i = 0; i < cnt; i++) { @@ -92,8 +103,7 @@ } for (int j = 1; j < secarg; j++) { - if (!ex.checkSomeLine(ins_i, ExecApplication.currThreadStr(), Integer - .toString(j), secarg)) { + if (!ex.checkSomeLine2(ins_i, ExecApplication.currThreadStr(), secarg)) { return fail("Check line from file " + ins_i + " : failed"); } @@ -135,8 +145,7 @@ } for (int j = 1; j < secarg; j++) { - if (!ex.checkSomeLine(ins_i, ExecApplication.currThreadStr(), Integer - .toString(j), secarg)) { + if (!ex.checkSomeLine2(ins_i, ExecApplication.currThreadStr(), secarg)) { return fail("Check line from file " + ins_i + " : failed"); } Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/hooks/AddRmShtdwnHooksTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/hooks/AddRmShtdwnHooksTest.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/hooks/AddRmShtdwnHooksTest.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/hooks/AddRmShtdwnHooksTest.java Tue Jun 19 20:50:16 2007 @@ -384,7 +384,11 @@ Thread[] hooks = createHookThreads(Integer.parseInt(args[0])); for (int i = 0; i < hooks.length; ++ i){ - Runtime.getRuntime().addShutdownHook(hooks[i]); + try{ + Runtime.getRuntime().addShutdownHook(hooks[i]); + } catch (IllegalArgumentException iae){ + // Ignore + } } } @@ -411,7 +415,11 @@ Thread[] hooks = createExecutedHookThreads(Integer.parseInt(args[0])); for (int i = 0; i < hooks.length; ++ i){ - Runtime.getRuntime().addShutdownHook(hooks[i]); + try{ + Runtime.getRuntime().addShutdownHook(hooks[i]); + } catch (IllegalArgumentException iae){ + // Ignore + } } } Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/RecursiveThreadTest/RecursiveTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/RecursiveThreadTest/RecursiveTest.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/RecursiveThreadTest/RecursiveTest.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/RecursiveThreadTest/RecursiveTest.java Tue Jun 19 20:50:16 2007 @@ -43,7 +43,7 @@ public class RecursiveTest extends Test { - public static int depth = 1000; + public static int depth = 500; public static int size = 1000; public static volatile boolean finish = false; @@ -98,7 +98,7 @@ // just wasting memory Object[] array = new Object[RecursiveTest.size]; for (int i = 0; i < RecursiveTest.size; i++) { - array[i] = new recurThread(); + array[i] = new char[10]; } } Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/VolatileVariableTest/DekkerTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/VolatileVariableTest/DekkerTest.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/VolatileVariableTest/DekkerTest.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/kernel/thread/VolatileVariableTest/DekkerTest.java Tue Jun 19 20:50:16 2007 @@ -188,8 +188,10 @@ base.commonVar = vars[threadNum]; Thread.yield(); // to give a chance to another thread - if (base.commonVar != vars[threadNum]) { + if (base.commonVar != vars[0] && + base.commonVar != vars[1]) { base.statuses[threadNum] = DStatus.FAIL; + regionOut(threadNum); return; } // end of critical region Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/NetClient.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/NetClient.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/NetClient.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/NetClient.java Tue Jun 19 20:50:16 2007 @@ -80,6 +80,7 @@ private PrintWriter prnWriter; private FileInputStream fis; private static int clientcounter = 0; + private final static int NUMBER_OF_TRIES_TO_START_SERVER = 50; private static int threadcnt = 0; private static int cycle = 0; @@ -142,14 +143,24 @@ //log.add("PORT = " + PORT++); - - try { - server = new ServerSocket(NetClient.PORT); - //log.add("Creates a server socket " + server + ", bound to the" + NetClient.PORT + " port"); - } catch (Exception e) { - - log.add("Creates a ServerSocket(" + NetClient.PORT + "): Exception during test execution"); - log.add(e); + // try to create ServerSocket NUMBER_OF_TRIES_TO_START_SERVER times with + // different PORT values as some PORT values could already be taken! + int count = 0; + while (count < NUMBER_OF_TRIES_TO_START_SERVER){ + try { + server = new ServerSocket(NetClient.PORT); + log.add("Creates a server socket " + server + ", bound to the" + NetClient.PORT + " port"); + } catch (Exception e) { + // try next PORT number + count++; + NetClient.PORT++; + continue; + } + break; + } + + if (server == null){ + log.add("Creates a ServerSocket in the range(" + NetClient.PORT + ":" + NetClient.PORT + "): Exception during test execution"); return fail("Failed."); } @@ -200,29 +211,29 @@ //Creates some sockets and connects to the specified port while(true) { - if(threadcnt() < THREAD) { + if(threadcnt() < THREAD) { - Client client = new Client(ia); - } + Client client = new Client(ia); + } - try { - Thread.currentThread().sleep(NetClient.SLEEP); - } catch (InterruptedException e) { - log.add(e); - return fail("another thread has interrupted the current thread"); + try { + Thread.currentThread().sleep(NetClient.SLEEP); + } catch (InterruptedException e) { + log.add(e); + return fail("another thread has interrupted the current thread"); - } - if(cnt() == CNT) { - clientcounter = 0; - break; - } + } + if(cnt() == CNT) { + clientcounter = 0; + break; + } } if (result()) { - return pass("OK"); + return pass("OK"); } else { - return fail("Failed."); + return fail("Failed."); } } @@ -325,11 +336,11 @@ // arrays to be tested for equality if(java.util.Arrays.equals(a, b)) { - //log.add("checks "+ filename + " : true"); - return true; + //log.add("checks "+ filename + " : true"); + return true; } else { - log.add("checks "+ filename + " : false"); - return false; + log.add("checks "+ filename + " : false"); + return false; } } @@ -378,8 +389,8 @@ bufReader.close(); in.close(); } catch (Exception e) { - log.add(e); - log.add("error occurs when closing the streams"); + log.add(e); + log.add("error occurs when closing the streams"); } finally { try { socket.close(); Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/auxiliary/Test_lnx.out URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/auxiliary/Test_lnx.out?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/auxiliary/Test_lnx.out (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/net/auxiliary/Test_lnx.out Tue Jun 19 20:50:16 2007 @@ -1,37 +1,37 @@ -public class Test { - static void createFrame() { - new javax.swing.JFrame(); - System.out.println("PASSED"); - } - public static void main(String args[]) throws Exception { - javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); - } -} -public class Test { - static void createFrame() { - new javax.swing.JFrame(); - System.out.println("PASSED"); - } - public static void main(String args[]) throws Exception { - javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); - } -} -public class Test { - static void createFrame() { - new javax.swing.JFrame(); - System.out.println("PASSED"); - } - public static void main(String args[]) throws Exception { - javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); - } -} -public class Test { - static void createFrame() { - new javax.swing.JFrame(); - System.out.println("PASSED"); - } - public static void main(String args[]) throws Exception { - javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); - } -} - +public class Test { + static void createFrame() { + new javax.swing.JFrame(); + System.out.println("PASSED"); + } + public static void main(String args[]) throws Exception { + javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); + } +} +public class Test { + static void createFrame() { + new javax.swing.JFrame(); + System.out.println("PASSED"); + } + public static void main(String args[]) throws Exception { + javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); + } +} +public class Test { + static void createFrame() { + new javax.swing.JFrame(); + System.out.println("PASSED"); + } + public static void main(String args[]) throws Exception { + javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); + } +} +public class Test { + static void createFrame() { + new javax.swing.JFrame(); + System.out.println("PASSED"); + } + public static void main(String args[]) throws Exception { + javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { createFrame(); }}); + } +} + Modified: harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/nio/channels/filechannel/FileChannelMapTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/nio/channels/filechannel/FileChannelMapTest.java?view=diff&rev=548917&r1=548916&r2=548917 ============================================================================== --- harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/nio/channels/filechannel/FileChannelMapTest.java (original) +++ harmony/enhanced/buildtest/branches/2.0/tests/reliability/src/java/org/apache/harmony/test/reliability/api/nio/channels/filechannel/FileChannelMapTest.java Tue Jun 19 20:50:16 2007 @@ -204,5 +204,11 @@ } } + try { + fc.close(); + } catch (IOException e) { + // Expected + } + } }