Skip to content

Commit

Permalink
NDT: Remove more unused code, source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vituperative committed Jan 20, 2025
1 parent 4ffce93 commit 49e1eb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 49 deletions.
17 changes: 9 additions & 8 deletions apps/routerconsole/java/src/edu/internet2/ndt/OsfwWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*
* <p>The result of the test is set back into the Tcpbw100._iS2cSFWResult variable
* (using setter methods) for the test results to be interpreted later.</p>
* */
*
*/

public class OsfwWorker implements Runnable {

Expand Down Expand Up @@ -55,7 +56,8 @@ public class OsfwWorker implements Runnable {
/**
* Make current thread sleep for 1000 ms
*
* */
*
*/
public void finalize() {
// If test is not already complete/terminated, then sleep
while (!_iFinalized) {
Expand All @@ -69,22 +71,21 @@ public void finalize() {
* from the server for a given time period, and checks to see if the server
* has sent a message that is valid and sufficient to determine if the S-&gt;C
* direction has a fire-wall.
* */
*
*/
public void run() {

Message msg = new Message();
Socket socketObj = null;

try {
// set timeout to given value in ms
// Set timeout to given value in ms
_srvSocket.setSoTimeout(_iTestTime * 1000);
try {
// Blocking call trying to create connection to socket and
// accept it
// Blocking call trying to create connection to socket and accept it
socketObj = _srvSocket.accept();
} catch (Exception e) {
// The "accept" call has failed, and indicates a firewall
// possibility
// The "accept" call has failed, and indicates possible firewall
this._localTcpAppObj.setS2cSFWTestResults(NDTConstants.SFW_POSSIBLE);
_srvSocket.close();
_iFinalized = true;
Expand Down
41 changes: 0 additions & 41 deletions apps/routerconsole/java/src/edu/internet2/ndt/Tcpbw100.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public class Tcpbw100 extends JApplet implements ActionListener {
JCheckBox _chkboxDefaultTest, _chkboxPreferIPv6;
JSpinner _spinnerTestCount = new JSpinner();
String[] _saDelays = { "immediate", "1min", "5mins", "10mins", "30mins", "2hours", "12hours", "1day" };
JComboBox _cmboboxDelay;

boolean _bFailed;
NewFrame _frameWeb100Vars, _frameDetailedStats, _frameOptions;
Expand Down Expand Up @@ -471,41 +470,6 @@ private void run2() {
_txtStatistics.append("\n** " + _resBundDisplayMsgs.getString("test") + " " + testNo + " **\n");
_txtDiagnosis.append("\n** " + _resBundDisplayMsgs.getString("test") + " " + testNo + " **\n");

// Now, sleep for some time based on user's choice before running the next iteration of the test suite
try {
switch (_cmboboxDelay.getSelectedIndex()) {
case 1:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep1m")+ " **\n");
Thread.sleep(1000 * 60);
break;
case 2:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep5m") + " **\n");
Thread.sleep(1000 * 60 * 5);
break;
case 3:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep10m") + " **\n");
Thread.sleep(1000 * 60 * 10);
break;
case 4:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep30m") + " **\n");
Thread.sleep(1000 * 60 * 30);
break;
case 5:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep2h") + " **\n");
Thread.sleep(1000 * 60 * 120);
break;
case 6:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep12h") + " **\n");
Thread.sleep(1000 * 60 * 720);
break;
case 7:
_resultsTxtPane.append("\n** " + _resBundDisplayMsgs.getString("sleep1d") + " **\n");
Thread.sleep(1000 * 60 * 1440);
break;
}
} catch (InterruptedException e) { // do nothing
_log.warn("Thread was interrupted while sleeping before starting the next test.");
}
}
} catch (Exception e) {
String sMessage = NDTUtils.isEmpty(e.getMessage())
Expand Down Expand Up @@ -641,11 +605,6 @@ private void createMainWindow() {
model.setValue(Integer.valueOf(1));
_spinnerTestCount.setModel(model);
_spinnerTestCount.setPreferredSize(new Dimension(60, 20));
_cmboboxDelay = new JComboBox();
for (int i = 0; i < _saDelays.length; i++) {
_cmboboxDelay.addItem(_resBundDisplayMsgs.getString(_saDelays[i]));
}
_cmboboxDelay.setSelectedIndex(0);

} // createDiagnoseWindow() ends

Expand Down

0 comments on commit 49e1eb9

Please sign in to comment.