• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DisabledException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: complete_should_fail_when_not_having_appropriate_role_type_test

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void complete_should_fail_when_not_having_appropriate_role_type_test() {

    Exception error = new Exception();

    // given
    Person personEmmaWithNoRoleAsPropertyManager = (Person) partyRepository.findPartyByReference(
            Person_enum.EmmaTreasurerGb.getRef());
    SortedSet<PartyRole> rolesforEmma = personEmmaWithNoRoleAsPropertyManager.getRoles();
    assertThat(rolesforEmma.size()).isEqualTo(1);
    assertThat(rolesforEmma.first().getRoleType()).isEqualTo(partyRoleTypeRepository.findByKey(PartyRoleTypeEnum.TREASURER.getKey()));

    // when
    try {
        queryResultsCache.resetForNextTransaction(); // workaround: clear MeService#me cache
        sudoService.sudo(Person_enum.EmmaTreasurerGb.getRef().toLowerCase(), (Runnable) () ->
                wrap(mixin(IncomingInvoice_complete.class, incomingInvoice)).act("PROPERTY_MANAGER", null, null));
    } catch (DisabledException e){
        error = e;
    }

    assertThat(error.getMessage()).isNotNull();
    assertThat(error.getMessage()).contains("Reason: Task assigned to 'PROPERTY_MANAGER' role");

}
 
开发者ID:estatio,项目名称:estatio,代码行数:26,代码来源:IncomingInvoiceApprovalState_IntegTest.java


示例2: disable_change_values_when_controlled_by_budget_works

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void disable_change_values_when_controlled_by_budget_works() {

    // given
    topmodelBudget2015 = Budget_enum.OxfBudget2015.findUsing(serviceRegistry);
    Assertions.assertThat(topmodelBudget2015).isNotNull();
    startDate = topmodelBudget2015.getStartDate();

    wrap(mixin(Budget_Calculate.class, topmodelBudget2015)).calculate(true);

    lastServiceChargeTerm = (LeaseTermForServiceCharge) LeaseItemForServiceCharge_enum.OxfTopModel001Gb.findUsing(serviceRegistry).getTerms().last();
    Assertions.assertThat(lastServiceChargeTerm).isNotNull();
    Assertions.assertThat(lastServiceChargeTerm.getStartDate()).isEqualTo(startDate);

    // expect
    expectedExceptions.expect(DisabledException.class);
    expectedExceptions.expectMessage("This term is controlled by a budget");

    // when
    wrap(lastServiceChargeTerm).changeValues(null, null);

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


示例3: if_no_background_service

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void if_no_background_service() throws Exception {

    // given
    assumeThat(backgroundCommandService, is(nullValue()));

    // when
    final TranslatableString reason = _createAndAttachDocumentAndScheduleRender(demoObject).disable$$();

    // then
    assertThat(reason).isNotNull();

    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    final DocumentTemplate anyTemplate = templateFs.getFmkTemplate();
    wrap(_createAndAttachDocumentAndScheduleRender(demoObject)).$$(anyTemplate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:20,代码来源:T_createAndAttachDocumentAndScheduleRender_IntegTest.java


示例4: not_editable

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void not_editable() throws Exception {
    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(employee).setName("new name");
}
 
开发者ID:bibryam,项目名称:rotabuilder,代码行数:9,代码来源:Employee_IntegTest.java


示例5: not_editable

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void not_editable() throws Exception {
    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(simpleObject).setName("new name");
}
 
开发者ID:Stephen-Cameron-Data-Services,项目名称:isis-agri,代码行数:9,代码来源:SimpleObject_IntegTest.java


示例6: cannotBeUpdatedDirectly

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannotBeUpdatedDirectly() throws Exception {

    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    quickObjectWrapped.setName("new name");
}
 
开发者ID:isisaddons-legacy,项目名称:isis-app-quickstart,代码行数:10,代码来源:QuickObjectIntegTest.java


示例7: cannotBeUpdatedDirectly

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannotBeUpdatedDirectly() throws Exception {

    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    simpleObjectWrapped.setName("new name");
}
 
开发者ID:isisaddons,项目名称:isis-app-simpledsl,代码行数:10,代码来源:SimpleObjectIntegTest.java


示例8: cannotModifyDirectly

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannotModifyDirectly() throws Exception {

    // then
    expectedExceptions.expect(DisabledException.class);
    expectedExceptions.expectMessage("Reason: Always disabled. Identifier: org.isisaddons.module.security.dom.user.ApplicationUser#username()");

    // when
    user.setUsername("fred");
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:11,代码来源:ApplicationUserIntegTest.java


示例9: cannotAddUsingSupportingMethod

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannotAddUsingSupportingMethod() throws Exception {

    // expect
    expectedException.expect(DisabledException.class);

    // when
    user.addToRoles(userRole);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:10,代码来源:ApplicationUserIntegTest.java


示例10: complete_works_when_having_appropriate_role_type_test

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void complete_works_when_having_appropriate_role_type_test() {

    Exception error = new Exception();

    // given
    Person personEmma = (Person) partyRepository.findPartyByReference(
            Person_enum.EmmaTreasurerGb.getRef());
    PartyRoleType roleAsPropertyManager = partyRoleTypeRepository.findByKey("PROPERTY_MANAGER");
    personEmma.addRole(roleAsPropertyManager);
    transactionService.nextTransaction();
    SortedSet<PartyRole> rolesforEmma = personEmma.getRoles();
    assertThat(rolesforEmma.size()).isEqualTo(2);
    assertThat(rolesforEmma.first().getRoleType()).isEqualTo(partyRoleTypeRepository.findByKey("PROPERTY_MANAGER"));

    // when
    try {
        queryResultsCache.resetForNextTransaction(); // workaround: clear MeService#me cache
        sudoService.sudo(Person_enum.EmmaTreasurerGb.getRef().toLowerCase(), (Runnable) () ->
                wrap(mixin(IncomingInvoice_complete.class, incomingInvoice)).act("PROPERTY_MANAGER", null, null));
    } catch (DisabledException e){
        error = e;
    }

    assertThat(error.getMessage()).isNull();
    assertThat(incomingInvoice.getApprovalState()).isEqualTo(IncomingInvoiceApprovalState.COMPLETED);

}
 
开发者ID:estatio,项目名称:estatio,代码行数:29,代码来源:IncomingInvoiceApprovalState_IntegTest.java


示例11: cannot_discard_when_has_linked_items

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannot_discard_when_has_linked_items() throws Exception {

    // expecting
    expectedExceptions.expect(DisabledException.class);

    // when
    final Order_discard mixin = mixin(Order_discard.class, order);

    sudoService.sudo(Person_enum.JonathanPropertyManagerGb.getSecurityUserName(), () -> {
        wrap(mixin).act("Discarding junk");
    });

}
 
开发者ID:estatio,项目名称:estatio,代码行数:15,代码来源:Order_withLinks_IntegTest.java


示例12: cannot_update_charge_dimension_when_has_linked_items

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannot_update_charge_dimension_when_has_linked_items() throws Exception {

    // expecting
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(orderItem).editCharge(fakeDataService.collections().anyOf(chargeRepository.allIncoming()));
}
 
开发者ID:estatio,项目名称:estatio,代码行数:10,代码来源:Order_withLinks_IntegTest.java


示例13: cannot_update_period_dimension_when_has_linked_items

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannot_update_period_dimension_when_has_linked_items() throws Exception {

    // expecting
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(orderItem).editPeriod("F2018");
}
 
开发者ID:estatio,项目名称:estatio,代码行数:10,代码来源:Order_withLinks_IntegTest.java


示例14: cannot_change_without_administrator_role

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test(expected = DisabledException.class)
public void cannot_change_without_administrator_role() throws Exception {
    sudoService.sudo("estatio-user", Lists.newArrayList("estatio-user"), new Runnable() {
        @Override public void run() {
            wrap(guaranteeWithFinancialAccount).changeGuaranteeType(GuaranteeType.UNKNOWN);                }
    });
}
 
开发者ID:estatio,项目名称:estatio,代码行数:8,代码来源:GuaranteeIntegration_IntegTest.java


示例15: whenAlreadyDisposed

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void whenAlreadyDisposed() throws Exception {

    //
    // given
    //
    final Property property = fs.getObject();

    //
    // and given
    //
    final LocalDate disposalDate = clockService.now().plusDays(fakeDataService.ints().between(10, 20));
    wrap(property).dispose(disposalDate);

    assertThat(property.getDisposalDate()).isEqualTo(disposalDate);

    //
    // expect
    //
    expectedExceptions.expect(DisabledException.class);
    expectedExceptions.expectMessage("already disposed");

    //
    // when
    //
    final LocalDate disposalDate2 = clockService.now().plusDays(fakeDataService.ints().between(30, 40));
    wrap(property).dispose(disposalDate);

    //
    // then
    //
    assertThat(property.getDisposalDate()).isEqualTo(disposalDate);

}
 
开发者ID:estatio,项目名称:estatio,代码行数:35,代码来源:Property_IntegTest.java


示例16: onDateChange

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void onDateChange() throws Exception {

    //then
    expectedException.expect(DisabledException.class);
    expectedException.expectMessage("You need super user rights to change the dates");

    // when
    wrap(leaseTopModel).changeDates(null, null);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:11,代码来源:Lease_IntegTest.java


示例17: not_editable

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void not_editable() throws Exception {
    // expect
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(domainObject).setObjectType("new objectType");
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:DocFragment_IntegTest.java


示例18: disabledIfLeaseHasInvoiceForFixedInvoicingFrequencyTerm

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
/**
 * <pre>
 *    Given
 *    a lease term with fixed invoicing frequency (eg LeaseTermForFixed, LeaseTermForTax)
 *    with start and end dates
 *    and with at least one invoice
 * 
 *    When
 *    I attempt to change the start dates
 *    Or
 *    I attempt to change the end dates
 * 
 *    Then
 *    this is disallowed
 * </pre>
 */
@Test
@Ignore // LeaseTerm#changeDates() is hidden everywhere until use case emerges
public void disabledIfLeaseHasInvoiceForFixedInvoicingFrequencyTerm() throws Exception {

    // given

    // TODO: if this test is ever reinstated, then its fixtures will need sorting out.
    // previously, it had this code:
    //
    // EstatioFixtureScript.withSkipPrereqs(
    //        new Runnable() {
    //
    //            @Override
    //            public void run() {
    //                runFixtureScript(new InvoiceForLease_enum.OxfMiracle005Gb.builder());
    //            }
    //        }
    //        );
    //
    // however, the withSkipPrereqs has now been removed (this was the only test that used it).

    // have to obtain again because runScript commits and so JDO
    // clears out all enlisted objects.
    lease = leaseRepository.findLeaseByReference(Lease_enum.OxfMiracl005Gb.getRef());
    final LeaseTerm leaseTerm = findFirstLeaseTerm(lease, LeaseItemType.RENT_DISCOUNT_FIXED);

    // and given
    assertThat(leaseTerm.valueType(), is(LeaseTermValueType.FIXED));

    // and given
    Assert.assertThat(invoiceForLeaseRepository.findByLease(lease), not(empty()));

    // then
    expectedExceptions.expect(DisabledException.class);
    expectedExceptions.expectMessage("Cannot change dates because this lease term has invoices and is fixed");

    // when
    final LocalDate newStartDate = leaseTerm.getStartDate().minusMonths(1);
    wrap(leaseTerm).changeDates(newStartDate, lease.getEndDate());
}
 
开发者ID:estatio,项目名称:estatio,代码行数:57,代码来源:LeaseTerm_IntegTest.java


示例19: cannot_update_budget_dimension_when_has_linked_items

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannot_update_budget_dimension_when_has_linked_items() throws Exception {

    // expecting
    expectedExceptions.expect(DisabledException.class);

    // when
    final List<BudgetItem> list = budgetItemRepository.allBudgetItems();

    assertThat(list).isNotEmpty();
    wrap(orderItem).editBudgetItem(fakeDataService.collections().anyOf(list));

}
 
开发者ID:estatio,项目名称:estatio,代码行数:14,代码来源:Order_withLinks_IntegTest.java


示例20: cannot_update_project_dimension_when_has_linked_items

import org.apache.isis.applib.services.wrapper.DisabledException; //导入依赖的package包/类
@Test
public void cannot_update_project_dimension_when_has_linked_items() throws Exception {

    // expecting
    expectedExceptions.expect(DisabledException.class);

    // when
    wrap(orderItem).editProject(fakeDataService.collections().anyOf(projectRepository.listAll()));

}
 
开发者ID:estatio,项目名称:estatio,代码行数:11,代码来源:Order_withLinks_IntegTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EventListener类代码示例发布时间:2022-05-23
下一篇:
Java PropertyImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap