当前位置: 首页>>代码示例>>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;未经允许,请勿转载。