Package com.splunk

Examples of com.splunk.IndexCollection


    }

    private void mockSplunkWriterApi() {
        try {
            Index index = mock(Index.class);
            IndexCollection indexColl = mock(IndexCollection.class);
            when(service.getIndexes()).thenReturn(indexColl);
            InputCollection inputCollection = mock(InputCollection.class);
            when(service.getInputs()).thenReturn(inputCollection);
            Input input = mock(Input.class);
            when(service.open(anyInt())).thenReturn(socket);
            when(inputCollection.get(anyString())).thenReturn(input);
            when(indexColl.get(anyString())).thenReturn(index);
            when(index.attach(isA(Args.class))).thenReturn(socket);
            when(socket.getOutputStream()).thenReturn(System.out);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


    assertEquals(buckets, actualBuckets);
  }

  private String stubSplunkIndexColdPath(String index) {
    IndexCollection indexes = mock(IndexCollection.class);
    when(splunkService.getIndexes()).thenReturn(indexes);
    Index splunkIndex = mock(Index.class);
    when(indexes.get(index)).thenReturn(splunkIndex);
    String coldPath = "/cold/path";
    when(splunkIndex.getColdPathExpanded()).thenReturn(coldPath);
    return coldPath;
  }
View Full Code Here

   * @return {@link Service} that returns a thawLocationPath for indexName.
   */
  public static Service createSplunkServiceReturningThawPathForIndex(
      String indexName, String thawLocationPath) {
    Service splunkService = mock(Service.class);
    IndexCollection indexesMock = mock(IndexCollection.class);
    Index indexMock = mock(Index.class);

    when(splunkService.getIndexes()).thenReturn(indexesMock);
    when(indexesMock.get(indexName)).thenReturn(indexMock);
    when(indexMock.getThawedPathExpanded()).thenReturn(thawLocationPath);
    return splunkService;
  }
View Full Code Here

TOP

Related Classes of com.splunk.IndexCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.