public MockResponse selectMockResponse(MockRequest request, MockResult result) { MockResponse mockResponse = null; MockOperation mockOperation = getMockOperation(); synchronized (mockOperation) { if (currentDispatchIndex >= mockOperation.getMockResponseCount()) { currentDispatchIndex = 0; } mockResponse = mockOperation.getMockResponseAt(currentDispatchIndex); currentDispatchIndex++; } return mockResponse; }
public void mockOperationAdded(MockOperation mockOperation) { MockOperationTreeNode mockOperationTreeNode = new MockOperationTreeNode(mockOperation, getTreeModel()); mockOperationNodes.add(mockOperationTreeNode); mockOperation.addPropertyChangeListener(propertyChangeListener); getTreeModel().notifyNodeInserted(mockOperationTreeNode); }
public MockServiceTreeNode(MockService mockService, SoapUITreeModel treeModel) { super(mockService, mockService.getProject(), treeModel); mockServiceListener = new InternalMockServiceListener(); mockService.addMockServiceListener(mockServiceListener); for (int c = 0; c < mockService.getMockOperationCount(); c++) { MockOperation mockOperation = mockService.getMockOperationAt(c); mockOperation.addPropertyChangeListener(MockService.NAME_PROPERTY, propertyChangeListener); mockOperationNodes.add(new MockOperationTreeNode(mockOperation, getTreeModel())); } getTreeModel().mapModelItems(mockOperationNodes); propertiesTreeNode = PropertiesTreeNode.createDefaultPropertiesNode(mockService, getTreeModel()); getTreeModel().mapModelItem(propertiesTreeNode); }
public void mockOperationRemoved(MockOperation mockOperation) { SoapUITreeNode treeNode = getTreeModel().getTreeNode(mockOperation); if (mockOperationNodes.contains(treeNode)) { getTreeModel().notifyNodeRemoved(treeNode); mockOperation.removePropertyChangeListener(propertyChangeListener); mockOperationNodes.remove(treeNode); } else { throw new RuntimeException("Removing unkown mockOperation"); } }
public SequenceMockOperationDispatcher(MockOperation mockOperation) { super(mockOperation); mockOperation.getMockService().addMockRunListener(this); }