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


Java ResourceType類代碼示例

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


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

示例1: process_CatchMissingResourceException

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test
public void process_CatchMissingResourceException() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSERVER_DELETION);
    paramHandler.setVserverId("serverId");

    doThrow(
            new MissingResourceException("test", ResourceType.VSERVER,
                    "serverId")).when(vServerProcessor).validateParameters(
            paramHandler);

    // when
    vServerProcessor.process("controllerId", "instanceId", paramHandler);

    // then
    assertEquals(FlowState.VSERVER_DELETING, paramHandler.getState());
    assertEquals("", paramHandler.getVserverId());
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:19,代碼來源:VServerProcessorBeanTest.java

示例2: process_CatchMissingResourceException

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test
public void process_CatchMissingResourceException() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSYSTEM_DELETION);
    paramHandler.setVsysId("systemId");

    doThrow(
            new MissingResourceException("test", ResourceType.VSYSTEM,
                    "systemId")).when(vSystemProcessor).validateParameters(
            paramHandler);

    // when
    vSystemProcessor.process("controllerId", "instanceId", paramHandler);

    // then
    assertEquals(FlowState.DESTROYED, paramHandler.getState());
    assertEquals("", paramHandler.getVsysId());
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:19,代碼來源:VSystemProcessorBeanTest.java

示例3: createMissingResourceException

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
public void createMissingResourceException(String message,
		HashMap<String, String> values) throws MissingResourceException {
	ResourceType type = ResourceType.UNKNOWN;
	String id = null;
	if (message != null) {
		message = message.trim();
		if (message.startsWith("VSYS10050")) {
			type = ResourceType.VSYSTEM;
			id = values.get(LParameter.LPLATFORM_ID);
		} else if (message.startsWith("VSYS10069")
				|| message.startsWith("VSYS10060")) {
			type = ResourceType.VSERVER;
			id = values.get(LParameter.LSERVER_ID);
		}
	}
	throw new MissingResourceException(message, type, id);
}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:18,代碼來源:RORClient.java

示例4: createMissingResourceException_VSYS10060

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test
public void createMissingResourceException_VSYS10060() throws Exception {
	// given
	String errormessage = "VSYS10060";
	HashMap<String, String> parameters = new HashMap<String, String>();
	parameters.put(LParameter.LSERVER_ID, "SERVER01");

	// when
	try {
		vdcClient.createMissingResourceException(errormessage, parameters);
	}
	// then
	catch (MissingResourceException e) {
		assertEquals(errormessage, e.getMessage());
		assertEquals("SERVER01", e.getResouceId());
		assertEquals(ResourceType.VSERVER, e.getResouceType());
	}
}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:19,代碼來源:RORClientTest.java

示例5: createMissingResourceException_VSYS10050

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test
public void createMissingResourceException_VSYS10050() throws Exception {
	// given
	String errormessage = "VSYS10050";
	String platformID = "PLATFORM1";
	HashMap<String, String> parameters = new HashMap<String, String>();
	parameters.put(LParameter.LPLATFORM_ID, platformID);

	// when
	try {
		vdcClient.createMissingResourceException(errormessage, parameters);
	}
	// then
	catch (MissingResourceException e) {
		assertEquals(errormessage, e.getMessage());
		assertEquals(platformID, e.getResouceId());
		assertEquals(ResourceType.VSYSTEM, e.getResouceType());
	}
}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:20,代碼來源:RORClientTest.java

示例6: getSuspendException

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
/**
 * Creates a SuspendException related to this exception.
 * 
 * @return the SuspendException
 */
public SuspendException getSuspendException() {
    if (ResourceType.UNKNOWN.equals(getResouceType())) {
        return new SuspendException(Messages.getAll(
                "error_resource_missing_unknown_type", new Object[] {
                        getResouceType(), getResouceId(), getMessage() }));
    } else {
        return new SuspendException(Messages.getAll(
                "error_resource_missing", new Object[] { getResouceType(),
                        getResouceId() }));
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:17,代碼來源:MissingResourceException.java

示例7: process

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Override
public void process(String controllerId, String instanceId,
        PropertyHandler paramHandler) throws Exception {
    if (paramHandler.isVirtualSystemProvisioning()) {
        try {
            validateParameters(paramHandler);
            dispatch(controllerId, instanceId, paramHandler);
        } catch (MissingResourceException e) {
            ResourceType resourceType = e.getResouceType();
            if (ResourceType.VSYSTEM.equals(resourceType)
                    && Operation.VSYSTEM_DELETION.equals(paramHandler
                            .getOperation())
                    && paramHandler.getVsysId() != null
                    && paramHandler.getVsysId().equals(e.getResouceId())) {
                logger.warn(
                        "Ignoring missing resource since virtual system {} is to be deleted anyway",
                        paramHandler.getVsysId());
                // adapt internal knowledge about the instance an try to
                // finalize the deletion process
                paramHandler.setState(FlowState.VSYSTEM_DELETING);
                paramHandler.setVsysId("");
                dispatch(controllerId, instanceId, paramHandler);
            } else if (ResourceType.VSYSTEM.equals(resourceType)
                    && Operation.VSYSTEM_OPERATION.equals(paramHandler
                            .getOperation())) {
                throw new InstanceNotAliveException(Messages.getAll(
                        "error_suspend_instance_error", e.getMessage()));
            } else {
                throw e.getSuspendException();
            }
        }
    } else {
        throw new RuntimeException("Wrong processoer");
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:36,代碼來源:VSystemProcessorBean.java

示例8: process_ThrowSuspendException_ResourceTypeFalse

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_ResourceTypeFalse()
        throws Exception {
    // given
    doThrow(
            new MissingResourceException("test", ResourceType.UNKNOWN,
                    "serverId")).when(vServerProcessor).validateParameters(
            paramHandler);

    // when
    vServerProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:13,代碼來源:VServerProcessorBeanTest.java

示例9: process_ThrowSuspendException_NoResourceType

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_NoResourceType() throws Exception {
    // given
    doThrow(
            new MissingResourceException("test", ResourceType.VSERVER,
                    "serverId")).when(vServerProcessor).validateParameters(
            paramHandler);

    // when
    vServerProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:12,代碼來源:VServerProcessorBeanTest.java

示例10: process_ThrowSuspendException_NoServerId

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_NoServerId() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSERVER_DELETION);
    paramHandler.setVserverId(null);
    doThrow(
            new MissingResourceException("test", ResourceType.VSERVER,
                    "serverId")).when(vServerProcessor).validateParameters(
            paramHandler);

    // when
    vServerProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:14,代碼來源:VServerProcessorBeanTest.java

示例11: process_ThrowSuspendException_ServerIdFalse

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_ServerIdFalse() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSERVER_DELETION);
    paramHandler.setVserverId("serverIdTest");
    doThrow(
            new MissingResourceException("test", ResourceType.VSERVER,
                    "serverId")).when(vServerProcessor).validateParameters(
            paramHandler);

    // when
    vServerProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:14,代碼來源:VServerProcessorBeanTest.java

示例12: process_ThrowSuspendException_ResourceTypeFalse

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_ResourceTypeFalse()
        throws Exception {
    // given
    doThrow(
            new MissingResourceException("test", ResourceType.UNKNOWN,
                    "systemId")).when(vSystemProcessor).validateParameters(
            paramHandler);

    // when
    vSystemProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:13,代碼來源:VSystemProcessorBeanTest.java

示例13: process_ThrowSuspendException_NoResourceType

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_NoResourceType() throws Exception {
    // given
    doThrow(
            new MissingResourceException("test", ResourceType.VSYSTEM,
                    "systemId")).when(vSystemProcessor).validateParameters(
            paramHandler);

    // when
    vSystemProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:12,代碼來源:VSystemProcessorBeanTest.java

示例14: process_ThrowSuspendException_NoServerId

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_NoServerId() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSYSTEM_DELETION);
    paramHandler.setVsysId(null);
    doThrow(
            new MissingResourceException("test", ResourceType.VSYSTEM,
                    "systemId")).when(vSystemProcessor).validateParameters(
            paramHandler);

    // when
    vSystemProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:14,代碼來源:VSystemProcessorBeanTest.java

示例15: process_ThrowSuspendException_ServerIdFalse

import org.oscm.app.iaas.data.ResourceType; //導入依賴的package包/類
@Test(expected = SuspendException.class)
public void process_ThrowSuspendException_ServerIdFalse() throws Exception {
    // given
    paramHandler.setOperation(Operation.VSYSTEM_DELETION);
    paramHandler.setVsysId("serverIdTest");
    doThrow(
            new MissingResourceException("test", ResourceType.VSYSTEM,
                    "systemId")).when(vSystemProcessor).validateParameters(
            paramHandler);

    // when
    vSystemProcessor.process("controllerId", "instanceId", paramHandler);
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:14,代碼來源:VSystemProcessorBeanTest.java


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