當前位置: 首頁>>代碼示例>>Java>>正文


Java AciHttpClient類代碼示例

本文整理匯總了Java中com.autonomy.aci.client.transport.AciHttpClient的典型用法代碼示例。如果您正苦於以下問題:Java AciHttpClient類的具體用法?Java AciHttpClient怎麽用?Java AciHttpClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AciHttpClient類屬於com.autonomy.aci.client.transport包,在下文中一共展示了AciHttpClient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testExecuteActionProcessorException

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
@SuppressWarnings("unchecked")
public void testExecuteActionProcessorException() throws AciServiceException, IOException, AciHttpException {
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    final AciResponseInputStream mockAciResponseInputStream = mock(AciResponseInputStream.class);
    when(mockAciHttpClient.executeAction(any(AciServerDetails.class), anySetOf(AciParameter.class))).thenReturn(mockAciResponseInputStream);

    final Processor<?> mockProcessor = mock(Processor.class);
    when(mockProcessor.process(any(AciResponseInputStream.class))).thenThrow(ProcessorException.class);

    try {
        new AciServiceImpl(mockAciHttpClient, details).executeAction(details, new ActionParameters("test"), mockProcessor);
        fail("Should have thrown an AciServiceException.");
    } catch (final AciServiceException ase) {
        assertThat("Exception cause is wrong", ase.getCause(), is(instanceOf(ProcessorException.class)));
        verify(mockAciResponseInputStream).close();
    }
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:19,代碼來源:AciServiceImplTest.java

示例2: testExecuteAction

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
@SuppressWarnings("unchecked")
public void testExecuteAction() throws AciServiceException, IOException, AciHttpException {
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    final AciResponseInputStream mockAciResponseInputStream = mock(AciResponseInputStream.class);
    when(mockAciHttpClient.executeAction(any(AciServerDetails.class), anySetOf(AciParameter.class))).thenReturn(mockAciResponseInputStream);

    final Processor<String> mockProcessor = mock(Processor.class);
    when(mockProcessor.process(mockAciResponseInputStream)).thenReturn("Success!");

    final String result = new AciServiceImpl(mockAciHttpClient)
            .executeAction(details, new ActionParameters("test"), (Processor<String>) mockProcessor);

    assertThat(result, is(equalTo("Success!")));
    verify(mockAciResponseInputStream).close();
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:17,代碼來源:AciServiceImplTest.java

示例3: AbstractMigrateUsersToIncludeUsernames

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
protected AbstractMigrateUsersToIncludeUsernames() {
    final String host = System.getProperty(COMMUNITY_HOST);
    final int port = Integer.parseInt(System.getProperty(COMMUNITY_PORT));
    final AciServerDetails.TransportProtocol transportProtocol = AciServerDetails.TransportProtocol.valueOf(System.getProperty(COMMUNITY_PROTOCOL));

    serverDetails = new AciServerDetails(transportProtocol, host, port);
    processorFactory = new ProcessorFactoryImpl(new Jaxb2MarshallerFactory());

    final SocketConfig socketConfig = SocketConfig.custom().setSoTimeout(HTTP_SOCKET_TIMEOUT).build();

    final HttpClient httpClient = HttpClientBuilder.create()
            .setMaxConnPerRoute(MAX_CONNECTIONS_PER_ROUTE)
            .setMaxConnTotal(MAX_CONNECTIONS_TOTAL)
            .setDefaultSocketConfig(socketConfig)
            .build();

    final AciHttpClient aciHttpClient = new AciHttpClientImpl(httpClient);
    aciService = new AciServiceImpl(aciHttpClient, serverDetails);
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:20,代碼來源:AbstractMigrateUsersToIncludeUsernames.java

示例4: testSinglePropertyConstructor

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
public void testSinglePropertyConstructor() {
    // Create a new service implementation...
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    final AciServiceImpl service = new AciServiceImpl(mockAciHttpClient);

    // Check...
    assertThat(service.getAciHttpClient(), is(sameInstance(mockAciHttpClient)));
    assertThat(service.getAciServerDetails(), is(nullValue()));
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:11,代碼來源:AciServiceImplTest.java

示例5: testDoublePropertyConstructor

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
public void testDoublePropertyConstructor() {
    // Create a new service implementation...
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    final AciServiceImpl service = new AciServiceImpl(mockAciHttpClient, details);

    // Check...
    assertThat(service.getAciHttpClient(), is(sameInstance(mockAciHttpClient)));
    assertThat(service.getAciServerDetails(), is(sameInstance(details)));
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:11,代碼來源:AciServiceImplTest.java

示例6: testExecuteActionWithDetailsBadParameterSetNullProcessor

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void testExecuteActionWithDetailsBadParameterSetNullProcessor() throws AciServiceException {
    final ActionParameters parameters = new ActionParameters();
    parameters.add(AciConstants.PARAM_FORMAT, "wibble");
    parameters.add(AciConstants.PARAM_DATA, "wobble");
    parameters.add(AciConstants.PARAM_ACTION, AciConstants.ACTION_GET_LICENSE_INFO);

    new AciServiceImpl(mock(AciHttpClient.class)).executeAction(details, parameters, null);
    fail("Should have thrown an IllegalArgumentException.");
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:11,代碼來源:AciServiceImplTest.java

示例7: testExecuteActionAciHttpException

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
@SuppressWarnings("unchecked")
public void testExecuteActionAciHttpException() throws AciServiceException, IOException, AciHttpException {
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    when(mockAciHttpClient.executeAction(any(AciServerDetails.class), anySetOf(AciParameter.class))).thenThrow(AciHttpException.class);

    try {
        new AciServiceImpl(mockAciHttpClient, details).executeAction(details, new ActionParameters("test"), mock(Processor.class));
        fail("Should have thrown an AciServiceException.");
    } catch (final AciServiceException ase) {
        assertThat("Exception cause is wrong", ase.getCause(), is(instanceOf(AciHttpException.class)));
    }
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:14,代碼來源:AciServiceImplTest.java

示例8: testExecuteActionIOException

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
@SuppressWarnings("unchecked")
public void testExecuteActionIOException() throws AciServiceException, IOException, AciHttpException {
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    when(mockAciHttpClient.executeAction(any(AciServerDetails.class), anySetOf(AciParameter.class))).thenThrow(IOException.class);

    try {
        new AciServiceImpl(mockAciHttpClient, details).executeAction(details, new ActionParameters("test"), mock(Processor.class));
        fail("Should have thrown an AciServiceException.");
    } catch (final AciServiceException ase) {
        assertThat("Exception cause is wrong", ase.getCause(), is(instanceOf(IOException.class)));
    }
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:14,代碼來源:AciServiceImplTest.java

示例9: testAciHttpClientProperty

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test
public void testAciHttpClientProperty() {
    // Create a new service implementation...
    final AciServiceImpl service = new AciServiceImpl();
    assertThat(service.getAciHttpClient(), is(nullValue()));

    // Set and check...
    final AciHttpClient mockAciHttpClient = mock(AciHttpClient.class);
    service.setAciHttpClient(mockAciHttpClient);
    assertThat(service.getAciHttpClient(), is(sameInstance(mockAciHttpClient)));

    // Set to null and check...
    service.setAciHttpClient(null);
    assertThat(service.getAciHttpClient(), is(nullValue()));
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:16,代碼來源:AciServiceImplTest.java

示例10: FlywayIdolConfigUpdateHandler

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Autowired
public FlywayIdolConfigUpdateHandler (
        final ProcessorFactory processorFactory,
        final Flyway flyway,
        final AciHttpClient aciHttpClient
) {
    this.processorFactory = processorFactory;
    this.flyway = flyway;

    aciService = new AciServiceImpl(aciHttpClient);
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:12,代碼來源:FlywayIdolConfigUpdateHandler.java

示例11: aciService

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = ACI_SERVICE_BEAN_NAME)
public AciService aciService(final AciHttpClient aciHttpClient) {
    return new AciServiceImpl(aciHttpClient);
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:6,代碼來源:HavenSearchIdolConfiguration.java

示例12: validatorAciService

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = VALIDATOR_ACI_SERVICE_BEAN_NAME)
public AciService validatorAciService(final AciHttpClient validatorAciHttpClient) {
    return new AciServiceImpl(validatorAciHttpClient);
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:6,代碼來源:HavenSearchIdolConfiguration.java

示例13: aciHttpClient

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = ACI_HTTP_CLIENT_BEAN_NAME)
public AciHttpClient aciHttpClient(final HttpClient httpClient) {
    return new AciHttpClientImpl(httpClient);
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:6,代碼來源:HavenSearchIdolConfiguration.java

示例14: validatorAciHttpClient

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = VALIDATOR_ACI_HTTP_CLIENT_BEAN_NAME)
public AciHttpClient validatorAciHttpClient(final HttpClient validatorHttpClient) {
    return new AciHttpClientImpl(validatorHttpClient);
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:6,代碼來源:HavenSearchIdolConfiguration.java

示例15: testExecuteActionNullConnectionDetails

import com.autonomy.aci.client.transport.AciHttpClient; //導入依賴的package包/類
@Test(expected = IllegalArgumentException.class)
public void testExecuteActionNullConnectionDetails() throws AciServiceException {
    new AciServiceImpl(mock(AciHttpClient.class)).executeAction(new ActionParameters("test"), null);
    fail("Should have thrown an IllegalArgumentException.");
}
 
開發者ID:hpe-idol,項目名稱:java-aci-api-ng,代碼行數:6,代碼來源:AciServiceImplTest.java


注:本文中的com.autonomy.aci.client.transport.AciHttpClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。