Author: adietish
Date: 2011-09-26 12:43:50 -0400 (Mon, 26 Sep 2011)
New Revision: 35051
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
Log:
[JBIDE-9773] correcting ApplicationLogReader implementation and adding new tests
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-26
16:24:58 UTC (rev 35050)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-26
16:43:50 UTC (rev 35051)
@@ -54,7 +54,7 @@
charactersRead = readStatus(cbuf, off, len);
} while (charactersRead == -1);
} catch (InterruptedException e) {
- throw new IOException(e);
+ // do nothing
}
return charactersRead;
}
@@ -64,7 +64,7 @@
int charactersRead = -1;
if (logReader == null) {
String status = requestStatus();
- if (isSameStatus(status, currentStatus)) {
+ if (status == null) {
Thread.sleep(STATUS_REQUEST_DELAY);
return -1;
}
@@ -75,6 +75,7 @@
charactersRead = logReader.read(cbuf, off, len);
if (charactersRead == -1) {
this.logReader = null;
+ return -1;
}
return charactersRead;
}
@@ -100,7 +101,12 @@
protected String requestStatus() throws IOException {
try {
- return service.getStatus(application.getName(), application.getCartridge(), user);
+ String status = service.getStatus(application.getName(), application.getCartridge(),
user);
+ if (isSameStatus(status, currentStatus)) {
+ return null;
+ }
+ return status;
+
} catch (OpenshiftException e) {
throw new IOException(e);
}
Show replies by date