diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-12 09:55:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-12 11:03:29 +0000 |
commit | bb437029c1e5331bcc3f8fb2fc87837142a52f33 (patch) | |
tree | 56bde4059792a5284e90ae3b10ee4388cc913a54 /qadevOOo/runner/complexlib | |
parent | 84f7f412bfc9e18b1ff8b133ceda7757eae28c36 (diff) |
java: convert fields to local variables where possible
found by PMD
Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542
Reviewed-on: https://gerrit.libreoffice.org/12376
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'qadevOOo/runner/complexlib')
-rw-r--r-- | qadevOOo/runner/complexlib/ComplexTestCase.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java index ff8b4fd7ad4d..2486692130bb 100644 --- a/qadevOOo/runner/complexlib/ComplexTestCase.java +++ b/qadevOOo/runner/complexlib/ComplexTestCase.java @@ -39,12 +39,6 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest * The method name which will be written into f.e. the data base **/ private String mTestMethodName = null; - /** Maximal time one method is allowed to execute - * Can be set with parameter 'ThreadTimeOut' - **/ - private int m_nThreadTimeOut = 0; - - private boolean m_bBeforeCalled; @@ -90,10 +84,13 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest private void test_method(DescEntry _entry) { - m_nThreadTimeOut = param.getInt("ThreadTimeOut"); - if (m_nThreadTimeOut == 0) + /* Maximal time one method is allowed to execute + * Can be set with parameter 'ThreadTimeOut' + **/ + int nThreadTimeOut = param.getInt("ThreadTimeOut"); + if (nThreadTimeOut == 0) { - m_nThreadTimeOut = 300000; + nThreadTimeOut = 300000; } for (int i = 0; i < _entry.SubEntries.length; i++) @@ -153,7 +150,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest int sleepingStep = 1000; int factor = 0; - while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < m_nThreadTimeOut)) + while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < nThreadTimeOut)) { Thread.sleep(sleepingStep); factor++; @@ -175,7 +172,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest { log.println("Destroy " + mTestMethodName); th.stopRunning(); - subEntry.State = "Test did sleep for " + (m_nThreadTimeOut / 1000) + " seconds and has been killed!"; + subEntry.State = "Test did sleep for " + (nThreadTimeOut / 1000) + " seconds and has been killed!"; subEntry.hasErrorMsg = true; subEntry.ErrorMsg = subEntry.State; continue; |