当前位置: 首页>>代码示例>>Java>>正文


Java OperationParameter类代码示例

本文整理汇总了Java中org.oscm.operation.data.OperationParameter的典型用法代码示例。如果您正苦于以下问题:Java OperationParameter类的具体用法?Java OperationParameter怎么用?Java OperationParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OperationParameter类属于org.oscm.operation.data包,在下文中一共展示了OperationParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeServiceOperation

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Override
public OperationResult executeServiceOperation(String userId,
        String instanceId, String transactionId, String operationId,
        List<OperationParameter> parameters) {

    Properties opProperties = operationBean.createProperties(userId,
            operationId, parameters);
    OperationResult result = new OperationResult();
    result = operationBean.execute(userId, instanceId, transactionId,
            operationId, opProperties, 0L);

    if (result.getErrorMessage() == null)
        try {
            ServiceInstance si = instanceDAO.getInstanceById(instanceId);
            if (si.getProvisioningStatus().isWaitingForOperation()) {
                timerServcie.initTimers();
            }
        } catch (ServiceInstanceNotFoundException e) {
            // could not happen, otherwise the result is not null
        }
    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:23,代码来源:AsynchronousOperationProxy.java

示例2: execute_instanceAvailable_newOperation_noStatus

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_instanceAvailable_newOperation_noStatus()
        throws APPlatformException, ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doReturn(si).when(instanceDAO).getInstanceById(anyString());
    doReturn(null).when(controller).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.data.OperationParameter.class),
            any(ProvisioningSettings.class));

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 0L);

    // then
    assertNull(result.getErrorMessage());
    verify(controller, times(1)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).removeOperation(anyLong());
    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:26,代码来源:OperationServiceBeanTest.java

示例3: execute_instanceAvailable_operationFromQueue_noStatus

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_instanceAvailable_operationFromQueue_noStatus()
        throws APPlatformException, ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doReturn(si).when(instanceDAO).getInstanceById(anyString());
    doReturn(null).when(controller).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.data.OperationParameter.class),
            any(ProvisioningSettings.class));

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 1000L);

    // then
    assertNull(result.getErrorMessage());
    verify(controller, times(1)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).removeOperation(anyLong());
    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:26,代码来源:OperationServiceBeanTest.java

示例4: execute_noInstance

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_noInstance() throws APPlatformException,
        ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doThrow(
            new ServiceInstanceNotFoundException("error_message",
                    new Throwable())).when(instanceDAO).getInstanceById(
            anyString());

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 1000L);

    // then
    assertEquals("error_message", result.getErrorMessage());
    verify(controller, times(0)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).addOperationForQueue(
            any(ServiceInstance.class), any(Properties.class), anyString());

    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:27,代码来源:OperationServiceBeanTest.java

示例5: execute_instanceAvailable_newOperation_noStatus

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_instanceAvailable_newOperation_noStatus()
        throws APPlatformException, ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doReturn(si).when(instanceDAO).getInstanceById(anyString());
    doReturn(null).when(controller).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.v2_0.data.OperationParameter.class),
            any(ProvisioningSettings.class));

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 0L);

    // then
    assertNull(result.getErrorMessage());
    verify(controller, times(1)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.v2_0.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).removeOperation(anyLong());
    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:OperationServiceBeanTest.java

示例6: execute_instanceAvailable_operationFromQueue_noStatus

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_instanceAvailable_operationFromQueue_noStatus()
        throws APPlatformException, ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doReturn(si).when(instanceDAO).getInstanceById(anyString());
    doReturn(null).when(controller).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.v2_0.data.OperationParameter.class),
            any(ProvisioningSettings.class));

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 1000L);

    // then
    assertNull(result.getErrorMessage());
    verify(controller, times(1)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.v2_0.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).removeOperation(anyLong());
    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:OperationServiceBeanTest.java

示例7: execute_noInstance

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void execute_noInstance() throws APPlatformException,
        ServiceInstanceNotFoundException {
    // given
    ServiceInstance si = spy(new ServiceInstance());
    si.setProvisioningStatus(ProvisioningStatus.COMPLETED);
    doThrow(
            new ServiceInstanceNotFoundException("error_message",
                    new Throwable())).when(instanceDAO).getInstanceById(
            anyString());

    // when
    OperationResult result = opService.execute("any", "any", "any", "any",
            new Properties(), 1000L);

    // then
    assertEquals("error_message", result.getErrorMessage());
    verify(controller, times(0)).executeServiceOperation(anyString(),
            anyString(), anyString(), anyString(),
            anyListOf(org.oscm.app.v2_0.data.OperationParameter.class),
            any(ProvisioningSettings.class));
    verify(opDAO, times(0)).addOperationForQueue(
            any(ServiceInstance.class), any(Properties.class), anyString());

    assertEquals(ProvisioningStatus.COMPLETED, si.getProvisioningStatus());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:27,代码来源:OperationServiceBeanTest.java

示例8: executeServiceOperation

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void executeServiceOperation() {
    // given
    String message = "some return message";
    result.setErrorMessage(message);
    when(
            port.executeServiceOperation(anyString(), anyString(),
                    anyString(), anyString(),
                    anyListOf(OperationParameter.class)))
            .thenReturn(result);

    // when
    OperationResult operationResult = adapter.executeServiceOperation(
            USERID, INSTANCEID, TRANSACTIONID, OPERATIONID, params);

    // then
    assertSame(result, operationResult);

    verify(port).executeServiceOperation(same(USERID), same(INSTANCEID),
            same(TRANSACTIONID), same(OPERATIONID), same(params));
    verifyNoMoreInteractions(port);
    verifyZeroInteractions(params);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:24,代码来源:OperationServiceAdapterV1_0Test.java

示例9: getParameterValues

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void getParameterValues() {
    // given
    when(port.getParameterValues(anyString(), anyString(), anyString()))
            .thenReturn(params);

    // when
    List<OperationParameter> list = adapter.getParameterValues(USERID,
            INSTANCEID, OPERATIONID);

    assertSame(params, list);
    verify(port).getParameterValues(same(USERID), same(INSTANCEID),
            same(OPERATIONID));
    verifyNoMoreInteractions(port);
    verifyZeroInteractions(params);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:OperationServiceAdapterV1_0Test.java

示例10: executeServiceOperation_Parameters

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void executeServiceOperation_Parameters() throws Exception {
    when(operationPort.executeServiceOperation(anyString(), anyString(),
            anyString(), anyString(), passedParams.capture()))
                    .thenReturn(operationResult);
    String userId = "1";
    String operationId = "OP";
    String trasactionId = "transactionid";
    Map<String, String> params = new HashMap<>();
    params.put("param1", "value1");
    params.put("param2", null);
    Subscription sub = createSubscription(false);

    am.executeServiceOperation(userId, sub, trasactionId,
            createTechnicalProductOperation(operationId), params);

    verify(operationPort).executeServiceOperation(eq(userId),
            eq(sub.getProductInstanceId()), eq(trasactionId),
            eq(operationId), anyListOf(OperationParameter.class));
    List<OperationParameter> list = passedParams.getValue();
    for (OperationParameter op : list) {
        assertTrue(params.containsKey(op.getName()));
        assertEquals(params.get(op.getName()), op.getValue());
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:ApplicationServiceBeanTest.java

示例11: executeServiceOperation_MessageReturned

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test(expected = TechnicalServiceOperationException.class)
public void executeServiceOperation_MessageReturned() throws Exception {
    String error = "some error message";
    operationResult.setErrorMessage(error);
    when(operationPort.executeServiceOperation(anyString(), anyString(),
            anyString(), anyString(), anyListOf(OperationParameter.class)))
                    .thenReturn(operationResult);
    Subscription sub = createSubscription(false);
    String userId = "1";
    String operationId = "OP";
    try {
        am.executeServiceOperation(userId, sub, null,
                createTechnicalProductOperation(operationId), null);
    } catch (TechnicalServiceOperationException e) {
        assertTrue(e.getMessage().indexOf(error) > 0);
        assertEquals(2, e.getMessageParams().length);
        assertEquals(sub.getSubscriptionId(), e.getMessageParams()[0]);
        assertEquals(error, e.getMessageParams()[1]);
        throw e;
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:ApplicationServiceBeanTest.java

示例12: getOperationParameterValues

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Test
public void getOperationParameterValues() throws Exception {
    TechnicalProductOperation tpo = createTechnicalProductOperation("op1",
            REQUEST_SELECT, REQUEST_SELECT);
    Subscription sub = createSubscription(false);
    when(operationPort.getParameterValues(anyString(), anyString(),
            anyString())).thenReturn(initOperationParameters(tpo, 3));

    Map<String, List<String>> result = am
            .getOperationParameterValues(USER_ID, tpo, sub);

    for (org.oscm.domobjects.OperationParameter op : tpo.getParameters()) {
        assertTrue(result.containsKey(op.getId()));
        List<String> list = result.get(op.getId());
        assertTrue(list.contains(op.getId() + "_value0"));
        assertTrue(list.contains(op.getId() + "_value1"));
        assertTrue(list.contains(op.getId() + "_value2"));
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:ApplicationServiceBeanTest.java

示例13: executeServiceOperation

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Override
public OperationResult executeServiceOperation(String userId,
        String instanceId, String transactionId, String operationId,
        List<OperationParameter> parameters) {
    OperationResult result = new OperationResult();
    final RequestLogEntry entry = createLogEntry("executeServiceOperation");
    entry.addParameter("userId", userId);
    entry.addParameter("instanceId", instanceId);
    entry.addParameter("transactionId", transactionId);
    entry.addParameter("operationId", operationId);
    entry.addParameter("parameters", parameters);
    if (CAUSE_ERROR.equalsIgnoreCase(operationId)) {
        String message = "User '%s' is not allowed to execute the operation for instance '%s'.";
        message = String.format(message, userId, instanceId);
        entry.setResult(message);
        result.setErrorMessage(message);
    }
    return result;
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:20,代码来源:OperationServiceBean.java

示例14: getParameterValues

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
@Override
public List<OperationParameter> getParameterValues(
        @WebParam(name = "userId") String userId,
        @WebParam(name = "instanceId") String instanceId,
        @WebParam(name = "operationId") String operationId) {
    return operationBean
            .getParameterValues(userId, instanceId, operationId);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:9,代码来源:AsynchronousOperationProxy.java

示例15: toController

import org.oscm.operation.data.OperationParameter; //导入依赖的package包/类
List<org.oscm.app.data.OperationParameter> toController(Properties prop) {
    List<org.oscm.app.data.OperationParameter> paramList = new ArrayList<org.oscm.app.data.OperationParameter>();
    if (prop != null) {
        Set<Object> keys = prop.keySet();
        for (Object key : keys) {
            org.oscm.app.data.OperationParameter param = new org.oscm.app.data.OperationParameter();
            param.setName((String) key);
            param.setValue((String) prop.get(key));
            paramList.add(param);
        }
    }
    return paramList;
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:14,代码来源:OperationServiceBean.java


注:本文中的org.oscm.operation.data.OperationParameter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。