Skip to content

Commit

Permalink
remove OEID alias from taskqueries. Fixed test and refreshGrid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nmirasch committed Jun 6, 2016
1 parent ce8ef50 commit 20a4df0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public void onRefresh() {
}

public void refreshGrid() {
getListView().getListGrid().setVisibleRangeAndClearData(getListView().getListGrid().getVisibleRange(),true);
if(getListView().getListGrid()!=null) {
getListView().getListGrid().setVisibleRangeAndClearData(getListView().getListGrid().getVisibleRange(), true);
}
}

protected void onSearchEvent(@Observes SearchEvent searchEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.google.gwt.view.client.Range;
import com.google.gwtmockito.GwtMockitoTestRunner;
import org.apache.commons.lang3.RandomStringUtils;
import org.drools.core.spi.DataProvider;
import org.jbpm.console.ng.gc.client.experimental.grid.base.ExtendedPagedTable;
import org.jbpm.console.ng.gc.client.list.base.events.SearchEvent;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -46,6 +46,9 @@ public class AbstractListPresenterTest {
@Mock
private AbstractListView.ListView viewMock;

@Mock
ExtendedPagedTable extendedPagedTable;

@Mock
HasData next;

Expand Down Expand Up @@ -157,4 +160,19 @@ public void testUpDateDataOnCallBackMiddlePage() {

}

@Test
public void testRefreshGrid() {

Range range = new Range(0,5);

when(viewMock.getListGrid()).thenReturn(extendedPagedTable);
when(extendedPagedTable.getVisibleRange()).thenReturn(range);

testListPresenter.refreshGrid();

verify(extendedPagedTable).setVisibleRangeAndClearData(range, true);

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class TaskDataSetConstants {
public static final String COLUMN_STATUS = "status";
public static final String COLUMN_TASK_ID = "taskId";
public static final String COLUMN_WORK_ITEM_ID = "workItemId";
public static final String COLUMN_ORGANIZATIONAL_ENTITY = "oeid";
public static final String COLUMN_ORGANIZATIONAL_ENTITY = "id";

public static final String COLUMN_TASK_VARIABLE_TASK_ID = "taskId";
public static final String COLUMN_TASK_VARIABLE_TASK_NAME = "TASKNAME";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected void registerDataSetDefinitions() {
"t.status, " +
"t.taskId, " +
"t.workItemId, " +
"oe.id as OEID " +
"oe.id " +
"from " +
"AuditTaskImpl t, " +
"PeopleAssignments_PotOwners po, " +
Expand Down Expand Up @@ -172,7 +172,7 @@ protected void registerDataSetDefinitions() {
"t.status, " +
"t.taskId, " +
"t.workItemId, " +
"oe.id as OEID " +
"oe.id " +
"from " +
"AuditTaskImpl t, " +
"PeopleAssignments_BAs bas, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.gwtmockito.GwtMockitoTestRunner;
import org.jboss.errai.common.client.api.Caller;
import org.jbpm.console.ng.bd.model.ProcessVariableSummary;
import org.jbpm.console.ng.gc.client.experimental.grid.base.ExtendedPagedTable;
import org.jbpm.console.ng.pr.model.events.ProcessInstanceSelectionEvent;
import org.jbpm.console.ng.pr.service.ProcessVariablesService;
import org.junit.Before;
Expand All @@ -39,6 +40,9 @@ public class ProcessVariableListPresenterTest {
@Mock
ProcessVariableListPresenter.ProcessVariableListView view;

@Mock
ExtendedPagedTable extendedPagedTable;

Caller<ProcessVariablesService> variablesServicesCaller;

@Mock
Expand All @@ -61,6 +65,7 @@ public void testLoadVariableHistory() {
final ProcessVariableSummary summary = new ProcessVariableSummary(variableName, "variableInstanceId", processInstanceId, "oldValue", "newValue", System.currentTimeMillis(), "type");
final List<ProcessVariableSummary> summaries = Arrays.asList(summary);
when(processVariablesService.getVariableHistory(anyString(), eq(deploymentId), eq(processInstanceId), eq(variableName))).thenReturn(summaries);
when(view.getListGrid()).thenReturn(extendedPagedTable);

final ProcessInstanceSelectionEvent event = new ProcessInstanceSelectionEvent(deploymentId, processInstanceId, "processDefId", "processDefName", 1);

Expand Down

0 comments on commit 20a4df0

Please sign in to comment.