コード例 #1
0
  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;
  }
コード例 #2
0
 public void mockOperationAdded(MockOperation mockOperation) {
   MockOperationTreeNode mockOperationTreeNode =
       new MockOperationTreeNode(mockOperation, getTreeModel());
   mockOperationNodes.add(mockOperationTreeNode);
   mockOperation.addPropertyChangeListener(propertyChangeListener);
   getTreeModel().notifyNodeInserted(mockOperationTreeNode);
 }
コード例 #3
0
  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);
  }
コード例 #4
0
 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");
   }
 }
コード例 #5
0
  public SequenceMockOperationDispatcher(MockOperation mockOperation) {
    super(mockOperation);

    mockOperation.getMockService().addMockRunListener(this);
  }