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


Java VOSubscription.setSubscriptionId方法代码示例

本文整理汇总了Java中org.oscm.vo.VOSubscription.setSubscriptionId方法的典型用法代码示例。如果您正苦于以下问题:Java VOSubscription.setSubscriptionId方法的具体用法?Java VOSubscription.setSubscriptionId怎么用?Java VOSubscription.setSubscriptionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscm.vo.VOSubscription的用法示例。


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

示例1: testGetMarketplaceForSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void testGetMarketplaceForSubscription() throws Exception {
    VOMarketplace marketplace = factory.createMarketplaceVO(
            supplier.getOrganizationId(), false, "globalMp");
    marketplace = createAndValidateMarketplace(marketplace);

    VOService freeService = createAndActivateFreeService(marketplace);

    // subscribe the service
    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService();
    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId(
            Long.toHexString(System.currentTimeMillis()));
    subscription = subSvc.subscribeToService(subscription, freeService,
            null, null, null, new ArrayList<VOUda>());

    VOMarketplace marketplace2 = mpService_Supplier
            .getMarketplaceForSubscription(subscription.getKey(), "en");
    assertNotNull(marketplace2);
    assertEquals(marketplace.getKey(), marketplace2.getKey());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:MarketplaceServiceWSTest.java

示例2: subscribeToChargeableService_NoPayment

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService_NoPayment() throws Exception {
    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService();
    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    PaymentInformationException expected = null;

    try {
        subSvc.subscribeToService(subscription, chargeableService, null,
                null, customerBillingContact, new ArrayList<VOUda>());
    } catch (PaymentInformationException e) {
        expected = e;
        ApplicationExceptionBean faultInfo = expected.getFaultInfo();
        assertNotNull(faultInfo);
        assertEquals("ex.PaymentInformationException",
                faultInfo.getMessageKey());
    }
    assertNotNull("Exception expected", expected);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:SubscriptionServiceWSTest.java

示例3: subscribeToChargeableService_NoBillingContact

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService_NoBillingContact()
        throws Exception {
    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    PaymentInformationException expected = null;

    try {
        subscrServiceForCustomer.subscribeToService(subscription,
                chargeableService, null, customerPaymentInfo, null,
                new ArrayList<VOUda>());
    } catch (PaymentInformationException e) {
        expected = e;
        ApplicationExceptionBean faultInfo = expected.getFaultInfo();
        assertNotNull(faultInfo);
        assertEquals("ex.PaymentInformationException",
                faultInfo.getMessageKey());
    }
    assertNotNull("Exception expected", expected);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:SubscriptionServiceWSTest.java

示例4: subscribeToChargeableService_WrongUser

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService_WrongUser() throws Exception {
    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService();
    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    OperationNotPermittedException expected = null;

    try {
        subSvc.subscribeToService(subscription, chargeableService, null,
                customerPaymentInfo, customerBillingContact,
                new ArrayList<VOUda>());
    } catch (OperationNotPermittedException e) {
        expected = e;
        ApplicationExceptionBean faultInfo = expected.getFaultInfo();
        assertNotNull(faultInfo);
        assertEquals("ex.OperationNotPermittedException",
                faultInfo.getMessageKey());
    }

    assertNotNull("Exception expected", expected);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:25,代码来源:SubscriptionServiceWSTest.java

示例5: modifyUnknownSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void modifyUnknownSubscription() throws Exception {

    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId("UNKNOWN_SUBSCRIPTION");

    try {
        subscrServiceForCustomer.modifySubscription(subscription, null,
                new ArrayList<VOUda>());
        fail("ObjectNotFoundException expected");
    } catch (ObjectNotFoundException e) {
        assertTrue(
                "Wrong exception message",
                e.getMessage()
                        .contains(
                                "Could not find object of type 'SUBSCRIPTION' with business key 'UNKNOWN_SUBSCRIPTION'"));
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:SubscriptionServiceWSTest.java

示例6: subscribeToService_TriggerProcessPending

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test(expected = OperationPendingException.class)
public void subscribeToService_TriggerProcessPending() throws Exception {
    VOTriggerDefinition triggerDef = WebserviceTestBase
            .createTriggerDefinition();
    triggerDef.setType(TriggerType.SUBSCRIBE_TO_SERVICE);
    setup.createTriggerDefinition(triggerDef);

    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService(setup.getSupplierUserKey(),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);
    subscription = subSvc.subscribeToService(subscription, freeService,
            null, null, null, new ArrayList<VOUda>());

    VOSubscription subscription2 = new VOSubscription();
    subscription2.setSubscriptionId(subscriptionId);

    subSvc.subscribeToService(subscription2, freeService, null, null, null,
            new ArrayList<VOUda>());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:SubscriptionServiceWSTest.java

示例7: createSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
private VOSubscription createSubscription() {
    // Subscribe to service
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);
    return subscription;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:AccountServiceWSTest.java

示例8: subscribeToFreeService

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToFreeService() throws Exception {
    // given
    List<String> operations = new ArrayList<String>();
    operations.add(SUBSCRIBE_SERVICE);
    long fromDate = new Date().getTime();
    OperatorService operatorService = WebserviceTestBase.getOperator();

    createdSubscription = new VOSubscription();
    createdSubscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    createdSubscription.setUnitName("default");

    WebserviceTestBase.storeGlobalConfigurationSetting(
            ConfigurationKey.AUDIT_LOG_ENABLED, true);
    try {
        // when
        createdSubscription = subscrServiceForCustomer.subscribeToService(
                createdSubscription, freeService, null, null, null,
                new ArrayList<VOUda>());
        waitForLogStored();
        // then
        byte[] auditLogs = operatorService.getUserOperationLog(operations,
                fromDate, fromDate + 86400000L);
        verifySubscriptionAndAuditLogs(createdSubscription, freeService,
                auditLogs);
        assertEquals(customerUser.getUserId(),
                createdSubscription.getOwnerId());
        assertEquals("default", createdSubscription.getUnitName());
    } finally {
        WebserviceTestBase.storeGlobalConfigurationSetting(
                ConfigurationKey.AUDIT_LOG_ENABLED, false);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:35,代码来源:SubscriptionServiceWSTest.java

示例9: subscribeToChargeableService

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService() throws Exception {
    createdSubscription = new VOSubscription();
    createdSubscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    createdSubscription = subscrServiceForCustomer.subscribeToService(
            createdSubscription, chargeableService, null,
            customerPaymentInfo, customerBillingContact,
            new ArrayList<VOUda>());
    assertEquals(customerUser.getUserId(), createdSubscription.getOwnerId());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:SubscriptionServiceWSTest.java

示例10: subscribeToChargeableService_WrongService

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService_WrongService() throws Exception {
    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService();
    VOSubscription subscription = new VOSubscription();
    subscription.setSubscriptionId(Long.toHexString(System
            .currentTimeMillis()));
    VOService dummy = new VOService();
    ObjectNotFoundException expected = null;

    try {
        subSvc.subscribeToService(subscription, dummy, null,
                customerPaymentInfo, customerBillingContact,
                new ArrayList<VOUda>());
    } catch (ObjectNotFoundException e) {
        expected = e;
        ApplicationExceptionBean faultInfo = expected.getFaultInfo();
        assertNotNull(faultInfo);
        assertEquals("ex.ObjectNotFoundException.SERVICE",
                faultInfo.getMessageKey());
        assertNotNull(faultInfo.getMessageParams());
        assertEquals(1, faultInfo.getMessageParams().length);
        assertEquals("0", faultInfo.getMessageParams()[0]);
        assertEquals(ClassEnum.SERVICE, expected.getDomainObjectClassEnum());
    }

    assertNotNull("Exception expected", expected);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:30,代码来源:SubscriptionServiceWSTest.java

示例11: subscribeToChargeableService_DuplicateID

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void subscribeToChargeableService_DuplicateID() throws Exception {
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);

    createdSubscription = subscrServiceForCustomer.subscribeToService(
            subscription, chargeableService, null, customerPaymentInfo,
            customerBillingContact, new ArrayList<VOUda>());

    NonUniqueBusinessKeyException expected = null;
    try {
        subscrServiceForCustomer.subscribeToService(subscription,
                chargeableService, null, customerPaymentInfo,
                customerBillingContact, new ArrayList<VOUda>());
    } catch (NonUniqueBusinessKeyException e) {
        expected = e;
        ApplicationExceptionBean faultInfo = expected.getFaultInfo();
        assertNotNull(faultInfo);
        assertEquals("ex.NonUniqueBusinessKeyException.SUBSCRIPTION",
                faultInfo.getMessageKey());
        assertNotNull(faultInfo.getMessageParams());
        assertEquals(1, faultInfo.getMessageParams().length);
        assertEquals(createdSubscription.getSubscriptionId(),
                faultInfo.getMessageParams()[0]);
        assertEquals(ClassEnum.SUBSCRIPTION,
                expected.getDomainObjectClassEnum());
    }

    assertNotNull("Exception expected", expected);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:33,代码来源:SubscriptionServiceWSTest.java

示例12: unsubscribeFromService_TriggerProcessPending

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void unsubscribeFromService_TriggerProcessPending() throws Exception {
    // given
    VOTriggerDefinition triggerDef = WebserviceTestBase
            .createTriggerDefinition();
    triggerDef.setType(TriggerType.UNSUBSCRIBE_FROM_SERVICE);
    setup.createTriggerDefinition(triggerDef);

    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService(setup.getSupplierUserKey(),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);
    subscription = subSvc.subscribeToService(subscription, freeService,
            null, null, null, new ArrayList<VOUda>());
    subSvc.unsubscribeFromService(subscriptionId);

    try {
        // when: try to delete again the same subscription
        subSvc.unsubscribeFromService(subscriptionId);
        fail();
    } catch (OperationPendingException e) {
        // then
        assertNotNull("Exception expected", e);
    } finally {
        setup.deleteTriggersForUser();
        subSvc.unsubscribeFromService(subscriptionId);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:31,代码来源:SubscriptionServiceWSTest.java

示例13: modifySubscription_TriggerProcessPending

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void modifySubscription_TriggerProcessPending() throws Exception {
    // given
    VOTriggerDefinition triggerDef = WebserviceTestBase
            .createTriggerDefinition();
    triggerDef.setType(TriggerType.MODIFY_SUBSCRIPTION);
    setup.createTriggerDefinition(triggerDef);

    // add a pending subscription modification process
    SubscriptionService subSvc = ServiceFactory.getDefault()
            .getSubscriptionService(setup.getSupplierUserKey(),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);
    subscription = subSvc.subscribeToService(subscription, freeService,
            null, null, null, new ArrayList<VOUda>());
    subSvc.modifySubscription(subscription, new ArrayList<VOParameter>(),
            new ArrayList<VOUda>());

    try {
        // when: try to modify again the same subscription
        subSvc.modifySubscription(subscription,
                new ArrayList<VOParameter>(), new ArrayList<VOUda>());
        fail();
    } catch (OperationPendingException e) {
        // then
        assertNotNull("Exception expected", e);
    } finally {
        setup.deleteTriggersForUser();
        subSvc.unsubscribeFromService(subscriptionId);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:34,代码来源:SubscriptionServiceWSTest.java

示例14: createSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
private VOSubscription createSubscription() {
    // Subscribe to service
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);

    return subscription;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:9,代码来源:SubscriptionServiceWSTest.java

示例15: createSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
private VOSubscription createSubscription() {
    VOSubscription subscription = new VOSubscription();
    String subscriptionId = Long.toHexString(System.currentTimeMillis());
    subscription.setSubscriptionId(subscriptionId);
    return subscription;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:7,代码来源:SubscriptionServiceWSTest.java


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