當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。