[jbpm-commits] JBoss JBPM SVN: r3062 - in projects/gwt-console/trunk/war/src: main/java/org/jboss/bpm/console/client/model and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Nov 24 13:11:09 EST 2008
Author: heiko.braun at jboss.com
Date: 2008-11-24 13:11:09 -0500 (Mon, 24 Nov 2008)
New Revision: 3062
Added:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/ChainedTimer.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
Removed:
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
Modified:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignmentFormPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailsFormPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
projects/gwt-console/trunk/war/src/test/resources/SampleProcess.par
Log:
Extended test coverage
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -3,7 +3,7 @@
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
/**
* Entry point classes define <code>onModuleLoad()</code>.
@@ -18,10 +18,13 @@
* can catch any unexpected exceptions.
*/
public void onModuleLoad() {
+
+ ConsoleLog.setEnabled(true);
+
/* Install an UncaughtExceptionHandler which will
* produce <code>FATAL</code> log messages
*/
- Log.setUncaughtExceptionHandler();
+ ConsoleLog.setUncaughtExceptionHandler();
/* Use a deferred command so that the UncaughtExceptionHandler
* catches any exceptions in onModuleLoad2()
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -23,7 +23,7 @@
import com.google.gwt.http.client.*;
import com.google.gwt.core.client.GWT;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.model.DTOParser;
import java.util.List;
@@ -74,7 +74,7 @@
this.username = user;
// discard password
- Log.debug("Authentication against: " + rb.getUrl());
+ ConsoleLog.debug("Authentication against: " + rb.getUrl());
if(user!=null&&pass!=null)
{
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
@@ -182,7 +182,7 @@
public void onLoginFailed(Request request, Throwable t)
{
// auth failed
- Log.error("Authentication failed.", t);
+ ConsoleLog.error("Authentication failed.", t);
}
}
);
@@ -207,6 +207,7 @@
public void addEditor(Editor editor)
{
+ ConsoleLog.debug("Add editor " + editor.getEditorId());
workspace.addEditor(editor, true);
}
@@ -216,7 +217,7 @@
}
public void showEditor(String id)
- {
+ {
workspace.showTab(id);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.http.client.URL;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
@@ -39,7 +39,7 @@
this.consoleServerUrl = consoleServerUrl;
this.webContext = webContext;
- Log.debug("Using gwt-console-server: " + getBaseUrl());
+ ConsoleLog.debug("Using gwt-console-server: " + getBaseUrl());
}
public String getConsoleServerUrl()
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -22,7 +22,7 @@
package org.jboss.bpm.console.client.model;
import com.google.gwt.json.client.*;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.model.forms.FieldDef;
import org.jboss.bpm.console.client.model.forms.FormDef;
import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
@@ -191,7 +191,7 @@
public static ProcessInstanceRef parseProcessInstance(JSONObject root)
{
- Log.debug("parse " + root);
+ ConsoleLog.debug("parse " + root);
long id = JSONWalk.on(root).next("instanceId").asLong();
long parentId = JSONWalk.on(root).next("parentId").asLong();
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.widgets.RemoteListView;
@@ -82,18 +82,23 @@
return reader;
}
- protected void onExamine(int row)
+ public void onExamine(int row)
{
ProcessDefinitionRef proc = row2ProcessMap.get(row);
- String editorId = ProcessInstanceEditor.createWidgetID(proc);
+ lauchEditor(proc);
+ }
+ public void lauchEditor(ProcessDefinitionRef proc)
+ {
+ String editorId = ProcessInstanceListEditor.createWidgetID(proc);
+
if(view.hasEditor(editorId))
view.showEditor(editorId);
else
view.addEditor( new ProcessInstanceListEditor(proc, view) );
}
- protected void onDelete(final int row)
+ public void onDelete(final int row)
{
MessageBox.show(new MessageBoxConfig() {
{
@@ -123,13 +128,13 @@
public void onError(Request request, Throwable t)
{
// auth failed
- Log.error("Failed to remove process definition", t);
+ ConsoleLog.error("Failed to remove process definition", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed", e1);
+ ConsoleLog.error("Request failed", e1);
}
}
}
@@ -139,7 +144,7 @@
}
- protected void onAdd()
+ public void onAdd()
{
}
@@ -162,7 +167,7 @@
i++;
}
- Log.debug("Loaded " + row2ProcessMap.size() + " process definitions");
+ ConsoleLog.debug("Loaded " + row2ProcessMap.size() + " process definitions");
}
public List<ProcessDefinitionRef> getAvailableProcessDefinitions()
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -34,7 +34,7 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
@@ -138,7 +138,7 @@
public void onActionFailed(Form form, int i, String string)
{
super.onActionFailed(form, i, string);
- Log.error("Failed to upload process definition: " + string );
+ ConsoleLog.error("Failed to upload process definition: " + string );
}
}
);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.jbpm3.ActiveNodeInfo;
@@ -90,7 +90,7 @@
private void loadActiveNodeInfo()
{
String url = view.getUrlBuilder().getActiveNodeInfoURL(this.instance.getInstanceId());
- Log.debug("Loading activeNodeInfo: " + url);
+ ConsoleLog.debug("Loading activeNodeInfo: " + url);
JSONRequest.get(url,
new JSONRequestHandler() {
@@ -127,7 +127,7 @@
public void onActiveNodeInfoLoaded(ActiveNodeInfo activeNodeInfo)
{
- Log.debug("Successfully loaded activeNodeInfo:" + activeNodeInfo.getActiveNode().getName());
+ ConsoleLog.debug("Successfully loaded activeNodeInfo:" + activeNodeInfo.getActiveNode().getName());
this.activeNodeInfo = activeNodeInfo;
DiagramNodeInfo activeNode = activeNodeInfo.getActiveNode();
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client.process;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.http.client.*;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
@@ -132,7 +132,7 @@
public void onResponseReceived(Request request, Response response)
{
if(response.getStatusCode()!=200)
- Log.error("Failed to change state: " +response.getStatusText());
+ ConsoleLog.error("Failed to change state: " +response.getStatusText());
else
callback.onStaleModel();
}
@@ -140,13 +140,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed", e1);
+ ConsoleLog.error("Request failed", e1);
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -29,7 +29,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.util.DateRenderer;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
@@ -61,7 +61,7 @@
return parent;
}
- protected void onExamine(final int row)
+ public void onExamine(final int row)
{
ProcessInstanceRef instance = row2InstanceMap.get(row);
String id = ProcessInstanceEditor.ID+"."+instance.getInstanceId();
@@ -71,7 +71,7 @@
view.addEditor( new ProcessInstanceEditor(parent, instance, view) );
}
- protected void onDelete(final int row)
+ public void onDelete(final int row)
{
MessageBox.show(new MessageBoxConfig() {
{
@@ -101,13 +101,13 @@
public void onError(Request request, Throwable t)
{
// auth failed
- Log.error("Failed to remove process instance", t);
+ ConsoleLog.error("Failed to remove process instance", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed", e1);
+ ConsoleLog.error("Request failed", e1);
}
}
}
@@ -117,7 +117,7 @@
}
- protected void onAdd()
+ public void onAdd()
{
MessageBox.show(new MessageBoxConfig() {
{
@@ -146,13 +146,13 @@
public void onError(Request request, Throwable t)
{
// auth failed
- Log.error("Failed to start new instance", t);
+ ConsoleLog.error("Failed to start new instance", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed", e1);
+ ConsoleLog.error("Request failed", e1);
}
}
}
@@ -171,7 +171,7 @@
i++;
}
- Log.debug("Loaded " + row2InstanceMap.size() + " records");
+ ConsoleLog.debug("Loaded " + row2InstanceMap.size() + " records");
}
public static ProcessInstanceRef transform(Record r)
@@ -185,7 +185,7 @@
}
catch (Throwable t)
{
- Log.error("Failed to parse process instance", t);
+ ConsoleLog.error("Failed to parse process instance", t);
}
return processInstance;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -43,6 +43,8 @@
*/
public class ProcessInstanceListEditor extends Editor
{
+ public final static String ID = "org.jboss.bpm.process.ProcessInstanceList";
+
private MainView view;
private ProcessDefinitionRef parent;
private ProcessInstanceList instanceList;
@@ -63,7 +65,7 @@
this.parent = proc;
this.view = view;
- this.setId( ProcessInstanceEditor.createWidgetID(proc) );
+ this.setId( ProcessInstanceListEditor.createWidgetID(proc) );
// --------------------------------------------------
@@ -122,7 +124,7 @@
modelListeners.fireModelChangeEvent(selectedInstance);
// --------------------
-
+
// token form update
// TODO: can't this use ModelChangeListener callbacks as well?
tokenEditorPanel.clear();
@@ -189,5 +191,11 @@
//tabPanel.setActiveTab(0);
}
+
+ public static String createWidgetID(ProcessDefinitionRef proc)
+ {
+ return ProcessInstanceListEditor.ID+"."+proc.getName()+"."+proc.getVersion();
+
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client.process;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.http.client.*;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Node;
@@ -182,7 +182,7 @@
public void onResponseReceived(Request request, Response response)
{
if(response.getStatusCode()!=200)
- Log.error("Signaling failed: " +response.getText());
+ ConsoleLog.error("Signaling failed: " +response.getText());
else
{
resetEditor();
@@ -193,13 +193,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed", e1);
+ ConsoleLog.error("Request failed", e1);
}
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignmentFormPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignmentFormPanel.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignmentFormPanel.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client.task;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.http.client.*;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
@@ -163,7 +163,7 @@
public void onResponseReceived(Request request, Response response)
{
if(200 != response.getStatusCode())
- Log.error("Failed to retrieve groups: " + response.getStatusText());
+ ConsoleLog.error("Failed to retrieve groups: " + response.getStatusText());
JSONValue value = JSONParser.parse(response.getText());
@@ -173,13 +173,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed" ,e1);
+ ConsoleLog.error("Request failed" ,e1);
}
}
@@ -210,7 +210,7 @@
public void onResponseReceived(Request request, Response response)
{
if(200 != response.getStatusCode())
- Log.error("Failed to reassign task: " + response.getStatusText());
+ ConsoleLog.error("Failed to reassign task: " + response.getStatusText());
selectedInstance = null;
callback.onAssignmentDone();
@@ -219,13 +219,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed" ,e1);
+ ConsoleLog.error("Request failed" ,e1);
}
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailsFormPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailsFormPanel.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailsFormPanel.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client.task;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.http.client.*;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Record;
@@ -173,7 +173,7 @@
public void onResponseReceived(Request request, Response response)
{
if(200 != response.getStatusCode())
- Log.error("Failed to reassign task: " + response.getStatusText());
+ ConsoleLog.error("Failed to reassign task: " + response.getStatusText());
selectedInstance = null;
callback.onAssignmentDone();
@@ -182,13 +182,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Request failed" ,e1);
+ ConsoleLog.error("Request failed" ,e1);
}
}
@@ -208,7 +208,7 @@
public void onResponseReceived(Request request, Response response)
{
if(200 != response.getStatusCode())
- Log.error("Failed to end task: " + response.getStatusText());
+ ConsoleLog.error("Failed to end task: " + response.getStatusText());
selectedInstance = null;
callback.onTaskEnd();
@@ -217,13 +217,13 @@
public void onError(Request request, Throwable t)
{
// Unknown error
- Log.error("Unknown error", t);
+ ConsoleLog.error("Unknown error", t);
}
});
}
catch (RequestException e1)
{
- Log.error("Failed to close task", e1);
+ ConsoleLog.error("Failed to close task", e1);
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -21,7 +21,7 @@
*/
package org.jboss.bpm.console.client.task;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONObject;
import com.gwtext.client.core.EventObject;
@@ -107,10 +107,10 @@
}
catch (Throwable e)
{
- Log.error("Failed to parse task ref", e);
+ ConsoleLog.error("Failed to parse task ref", e);
}
- Log.debug("Loaded " + row2taskref.size() + " tasks");
+ ConsoleLog.debug("Loaded " + row2taskref.size() + " tasks");
}
public static TaskRef transform(Record r)
@@ -181,7 +181,7 @@
public void onLoadException(Throwable throwable)
{
- Log.error("Failed to load remote data", throwable);
+ ConsoleLog.error("Failed to load remote data", throwable);
}
}
@@ -242,7 +242,7 @@
public void reloadStore()
{
- Log.debug("Reload " + this.getId());
+ ConsoleLog.debug("Reload " + this.getId());
store.load(0, PAGE_SIZE);
}
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+/**
+ * The maven gwt:test mojo treats any output to stderr as
+ * a test failure. gwt-log does dump some information there,
+ * hence we need to proxy log invocation and be able to disable them at all.
+ * <p>
+ * If you want to test the application, make sure to lauch it using
+ * {@link org.jboss.bpm.console.client.Application#onModuleLoad2()}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ConsoleLog
+{
+ private static boolean enabled = false;
+
+ public static void debug(String msg)
+ {
+ if(enabled)
+ com.allen_sauer.gwt.log.client.Log.debug(msg);
+ }
+
+ public static void error(String msg)
+ {
+ if(enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg);
+ }
+
+ public static void error(String msg, Throwable t)
+ {
+ if(enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg, t);
+ }
+
+ public static void setUncaughtExceptionHandler()
+ {
+ if(enabled)
+ com.allen_sauer.gwt.log.client.Log.setUncaughtExceptionHandler();
+ }
+
+ public static boolean isEnabled()
+ {
+ return enabled;
+ }
+
+ public static void setEnabled(boolean enabled)
+ {
+ ConsoleLog.enabled = enabled;
+ }
+}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -32,7 +32,7 @@
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.GridCellListener;
-import com.allen_sauer.gwt.log.client.Log;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
@@ -204,11 +204,11 @@
return pagingToolbar;
}
- protected abstract void onAdd();
+ public abstract void onAdd();
- protected abstract void onExamine(final int row);
+ public abstract void onExamine(final int row);
- protected abstract void onDelete(final int row);
+ public abstract void onDelete(final int row);
protected abstract void onRecordsLoaded(Record[] records);
@@ -244,7 +244,7 @@
public void onLoadException(Throwable throwable)
{
- Log.error("Failed to load remote data", throwable);
+ ConsoleLog.error("Failed to load remote data", throwable);
}
}
@@ -294,7 +294,7 @@
public void reloadStore()
{
- Log.debug("Reload " + this.getId());
+ ConsoleLog.debug("Reload " + this.getId());
store.load(0,PAGE_SIZE);
}
Added: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/ChainedTimer.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/ChainedTimer.java (rev 0)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/ChainedTimer.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.Timer;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+abstract class ChainedTimer extends Timer
+{
+
+ private Timer next;
+
+
+ protected ChainedTimer(Timer next)
+ {
+ this.next = next;
+ }
+
+ public abstract void run();
+
+ protected void scheduleNext(int after)
+ {
+ if(null==next)
+ throw new IllegalArgumentException("No next timer given");
+ next.schedule(after);
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-11-24 16:34:29 UTC (rev 3061)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -1,150 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.user.client.Timer;
-import com.gwtext.client.widgets.ComponentMgr;
-import org.jboss.bpm.console.client.process.ProcessDefinitionList;
-import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class GwtTestApplication extends GWTTestCase
-{
- private static Application application = null;
-
- public String getModuleName()
- {
- return "org.jboss.bpm.console.Application";
- }
-
- protected void gwtSetUp() throws Exception
- {
- super.gwtSetUp();
-
- if(null==application)
- {
- application = new Application();
- application.onModuleLoad2();
- }
-
- }
-
- public void testAuthentication()
- {
- final MainView view = application.getConsoleView();
- assertNotNull("View not initialized", view);
-
- Timer timer = new Timer()
- {
- public void run()
- {
-
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
- final Authentication auth = new Authentication(inRoleURL);
- auth.setCallback(
- new Authentication.AuthCallback() {
-
- public void onLoginSuccess(Request request, Response response) {
- System.out.println("Assigned roles: " + auth.getRolesAssigned() );
- }
-
- public void onLoginFailed(Request request, Throwable t) {
-
- throw new RuntimeException("Login failed", t);
- }
- }
- );
- auth.doLogin();
- finishTest();
- }
-
-
- };
-
- timer.schedule(300);
- delayTestFinish(500);
- }
-
- public void testProcessDefList()
- {
- final MainView view = application.getConsoleView();
- assertNotNull("View not initialized", view);
-
- URLBuilder urlBuilder = new URLBuilder("http://localhost:8080", "gwt-console-server");
- final String url = urlBuilder.getProcessDefinitionByNameURL("simple");
-
- Timer verification = new Timer(){
-
- public void run()
- {
- System.out.println("Verify process definition list");
- ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)
- ComponentMgr.getComponent(ProcessDefinitionListEditor.ID);
-
- ProcessDefinitionList list = editor.getProcessDefinitionList();
-
- System.out.println("! Got " + list.getAvailableProcessDefinitions().size() + " definitions");
- assertTrue("No process definitions loaded",
- list.getAvailableProcessDefinitions().size() != 0
- );
-
- finishTest();
- }
- };
-
- Timer loading = new Timer(){
-
- public void run()
- {
- System.out.println("Fetch process definitions");
- ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)
- ComponentMgr.getComponent(ProcessDefinitionListEditor.ID);
-
- ProcessDefinitionList list = editor.getProcessDefinitionList();
- list.reloadStore();
- }
- };
-
- Timer authentication = new Timer()
- {
- public void run()
- {
- System.out.println("Do authentication");
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
- final Authentication auth = new Authentication(inRoleURL);
- auth.doLogin();
-
- }
- };
-
- authentication.schedule(500);
- loading.schedule(1000);
- verification.schedule(1500);
-
- delayTestFinish(2000);
- }
-}
Copied: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java (from rev 3049, projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java)
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java (rev 0)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java 2008-11-24 18:11:09 UTC (rev 3062)
@@ -0,0 +1,240 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.user.client.Timer;
+import com.gwtext.client.widgets.ComponentMgr;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.process.ProcessDefinitionList;
+import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
+import org.jboss.bpm.console.client.process.ProcessInstanceListEditor;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class GwtTestProcessManagement extends GWTTestCase
+{
+ private static Application application = null;
+
+ public String getModuleName()
+ {
+ return "org.jboss.bpm.console.Application";
+ }
+
+ protected void gwtSetUp() throws Exception
+ {
+ super.gwtSetUp();
+
+ if(null==application)
+ {
+ System.out.println("=========");
+ System.out.println("Setup console application");
+ System.out.println("=========");
+
+ application = new Application();
+ application.onModuleLoad2();
+
+ }
+
+ }
+
+ public void testAuthentication()
+ {
+ final MainView view = application.getConsoleView();
+ assertNotNull("View not initialized", view);
+
+ Timer timer = new Timer()
+ {
+ public void run()
+ {
+
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
+ final Authentication auth = new Authentication(inRoleURL);
+ auth.setCallback(
+ new Authentication.AuthCallback() {
+
+ public void onLoginSuccess(Request request, Response response) {
+ System.out.println("Assigned roles: " + auth.getRolesAssigned() );
+ }
+
+ public void onLoginFailed(Request request, Throwable t) {
+
+ throw new RuntimeException("Login failed", t);
+ }
+ }
+ );
+ auth.doLogin();
+ finishTest();
+ }
+
+
+ };
+
+ timer.schedule(300);
+ delayTestFinish(500);
+ }
+
+ public void testProcessDefEditor()
+ {
+ final MainView view = application.getConsoleView();
+ assertNotNull("View not initialized", view);
+
+ Timer verification = new Timer(){
+
+ public void run()
+ {
+ System.out.println("Verify process definition list");
+ ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)
+ ComponentMgr.getComponent(ProcessDefinitionListEditor.ID);
+
+ ProcessDefinitionList list = editor.getProcessDefinitionList();
+ assertTrue("No process definitions loaded",
+ list.getAvailableProcessDefinitions().size() != 0
+ );
+
+ finishTest();
+ }
+ };
+
+ Timer loading = new Timer(){
+
+ public void run()
+ {
+ System.out.println("Fetch process definitions");
+ ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)
+ ComponentMgr.getComponent(ProcessDefinitionListEditor.ID);
+
+ ProcessDefinitionList list = editor.getProcessDefinitionList();
+ list.reloadStore();
+ }
+ };
+
+ Timer authentication = new Timer()
+ {
+ public void run()
+ {
+ System.out.println("Do authentication");
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
+ final Authentication auth = new Authentication(inRoleURL);
+ auth.doLogin();
+
+ }
+ };
+
+ authentication.schedule(500);
+ loading.schedule(1000);
+ verification.schedule(1500);
+
+ delayTestFinish(2000);
+ }
+
+ public void testProcessInstanceEditor()
+ {
+ final ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)
+ ComponentMgr.getComponent(ProcessDefinitionListEditor.ID);
+
+ Map<String, Object> context = new HashMap<String, Object>();
+ context.put("editor", editor);
+
+ LoadTestHarnessTimer loading = new LoadTestHarnessTimer(context);
+ InstanceEditorTimer instances = new InstanceEditorTimer(context);
+ context.put("secondTimer", instances);
+
+ loading.schedule(500);
+ delayTestFinish(1000);
+
+ }
+
+ class LoadTestHarnessTimer extends Timer
+ {
+
+ Map<String, Object> context;
+
+ public LoadTestHarnessTimer(Map<String, Object> context)
+ {
+ super();
+ this.context = context;
+ }
+
+ public void run()
+ {
+ ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor) context.get("editor");
+ ProcessDefinitionList list = editor.getProcessDefinitionList();
+ list.reloadStore();
+
+ List<ProcessDefinitionRef> defs = list.getAvailableProcessDefinitions();
+ assertFalse(defs.isEmpty());
+
+ for(ProcessDefinitionRef pd : defs)
+ {
+ if(pd.getName().equals("GWT_Test_Harness"))
+ {
+ context.put("def", pd);
+ break;
+ }
+ }
+
+ Timer next = (Timer)context.get("secondTimer");
+ next.schedule(500);
+ delayTestFinish(1000);
+ }
+ }
+
+ class InstanceEditorTimer extends Timer
+ {
+ Map<String, Object> context;
+
+ public InstanceEditorTimer(Map<String, Object> context)
+ {
+ super();
+ this.context = context;
+ }
+
+ public void run()
+ {
+ ProcessDefinitionListEditor editor = (ProcessDefinitionListEditor)context.get("editor");
+ ProcessDefinitionRef def = (ProcessDefinitionRef)context.get("def");
+ ProcessDefinitionList list = editor.getProcessDefinitionList();
+ list.lauchEditor(def); // will create an instance editor
+
+ // lookup instance editor
+ String editorId = ProcessInstanceListEditor.createWidgetID(def);
+ ProcessInstanceListEditor instanceEditor = (ProcessInstanceListEditor)
+ ComponentMgr.getComponent(editorId);
+ assertNotNull("Failed to create instance editor for process", instanceEditor);
+
+ // todo: start new instance
+
+ // finish
+ finishTest();
+
+ }
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/gwt-console/trunk/war/src/test/resources/SampleProcess.par
===================================================================
(Binary files differ)
More information about the jbpm-commits
mailing list