Skip to content

Commit

Permalink
isConnected checks that QMUX is in running state
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Aug 6, 2014
1 parent 42b1f03 commit df69a8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions jpos/src/main/java/org/jpos/q2/iso/QMUX.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,13 @@ public void send(ISOMsg m) throws IOException, ISOException {
}

public boolean isConnected() {
if (ready != null && ready.length > 0) {
if (running() && ready != null && ready.length > 0) {
for (String aReady : ready)
if (sp.rdp(aReady) != null)
return true;
return false;
}
else
return true;
return running();
}
public void dump (PrintStream p, String indent) {
p.println (indent + getCountersAsString());
Expand Down
3 changes: 1 addition & 2 deletions jpos/src/test/java/org/jpos/q2/iso/QMUXTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public void testInitServiceThrowsNullPointerException2() throws Throwable {

@Test
public void testIsConnected() throws Throwable {
boolean result = new QMUX().isConnected();
assertTrue("result", result);
assertFalse("result", new QMUX().isConnected()); // MUX was not started
}

@Test
Expand Down

0 comments on commit df69a8c

Please sign in to comment.