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


Java DisabledException类代码示例

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


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


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