diff options
author | Andrew Azores <[email protected]> | 2013-11-07 09:59:22 -0500 |
---|---|---|
committer | Andrew Azores <[email protected]> | 2013-11-07 09:59:22 -0500 |
commit | cc383fcf7288977d01608d9da4d9d84d167e1aad (patch) | |
tree | f5b899aa9cd705f7d1aba497874c8c787018903d /tests/test-extensions/net/sourceforge | |
parent | 8f59c1b0bf5fed4fce80ebcc0bc588e62dde706d (diff) |
Reproducer test cleanup to remove deprecation warnings and type checking warnings.
ServerAccess.ProcessResult removed and reference replaced with ProcessResult.
junit.framework.assert replaced in favour of org.junit.Assert.
Added parameterized typing to instantiation of several fields and local variables
where the declaration was already parameterized.
Diffstat (limited to 'tests/test-extensions/net/sourceforge')
3 files changed, 11 insertions, 21 deletions
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java b/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java index dd7ab89..da47f6e 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java @@ -52,7 +52,7 @@ class ContentReader implements Runnable { StringBuilder sb = new StringBuilder(); private final InputStream is; private boolean done; - final List<ContentReaderListener> listeners = new ArrayList(1); + final List<ContentReaderListener> listeners = new ArrayList<ContentReaderListener>(1); public String getContent() { return sb.toString(); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java index 9b2dbbb..6c9cdd4 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java @@ -56,8 +56,8 @@ public class ProcessWrapper { private List<String> args; private File dir; - private final List<ContentReaderListener> stdoutl = new ArrayList(1); - private final List<ContentReaderListener> stderrl = new ArrayList(1); + private final List<ContentReaderListener> stdoutl = new ArrayList<ContentReaderListener>(1); + private final List<ContentReaderListener> stderrl = new ArrayList<ContentReaderListener>(1); private String[] vars; private ReactingProcess reactingProcess; @@ -73,9 +73,9 @@ public class ProcessWrapper { Assert.assertNotNull(toBeExecuted); Assert.assertTrue(toBeExecuted.trim().length() > 1); if (otherargs == null) { - otherargs = new ArrayList(1); + otherargs = new ArrayList<String>(1); } - List<String> urledArgs = new ArrayList(otherargs); + List<String> urledArgs = new ArrayList<String>(otherargs); urledArgs.add(0, toBeExecuted); urledArgs.add(s); this.args = urledArgs; @@ -201,7 +201,7 @@ public class ProcessWrapper { this.vars = vars; } - public ServerAccess.ProcessResult execute() throws Exception { + public ProcessResult execute() throws Exception { if (reactingProcess !=null ){ reactingProcess.beforeProcess(""); }; @@ -222,7 +222,7 @@ public class ProcessWrapper { } if (t.deadlyException != null) { pa.setCanRun(false); - return new ServerAccess.ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); + return new ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); } ContentReader crs = new ContentReader(t.getP().getInputStream(), stdoutl); ContentReader cre = new ContentReader(t.getP().getErrorStream(), stderrl); @@ -244,7 +244,7 @@ public class ProcessWrapper { pa.setCanRun(false); // ServerAccess.logOutputReprint(t.getP().exitValue()); when process is killed, this throws exception - ServerAccess.ProcessResult pr = new ServerAccess.ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); + ProcessResult pr = new ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); if (ServerAccess.PROCESS_LOG) { ServerAccess.log(pr.stdout, true, false); ServerAccess.log(pr.stderr, false, true); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java index 31e81ad..6f45a23 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java @@ -55,6 +55,7 @@ import java.net.ServerSocket; import java.net.URL; import java.util.ArrayList; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.Browsers; @@ -270,7 +271,7 @@ public class ServerAccess { if (this.currentBrowser==null) return null; List<String> l1=this.currentBrowser.getComaptibilitySwitches(); List<String> l2=this.currentBrowser.getDefaultSwitches(); - List<String> l= new ArrayList(); + List<String> l= new ArrayList<String>(); if (l1!=null)l.addAll(l1); if (l2!=null)l.addAll(l2); return l; @@ -832,15 +833,4 @@ public class ServerAccess { return new ProcessWrapper(args, dir, stdoutl, stderrl, vars).execute(); } - /** - * this is temprary solution until refactoring is fully done - * Use net.sourceforge.jnlp.ProcessResult instead - */ - @Deprecated - public static class ProcessResult extends net.sourceforge.jnlp.ProcessResult { - - public ProcessResult(String stdout, String stderr, Process process, boolean wasTerminated, Integer r, Throwable deadlyException) { - super(stdout, stderr, process, wasTerminated, r, deadlyException); - } - } - } +} |