本文整理汇总了Java中org.isisaddons.module.security.dom.tenancy.ApplicationTenancy.setPath方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationTenancy.setPath方法的具体用法?Java ApplicationTenancy.setPath怎么用?Java ApplicationTenancy.setPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.isisaddons.module.security.dom.tenancy.ApplicationTenancy
的用法示例。
在下文中一共展示了ApplicationTenancy.setPath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
numerator = new Numerator();
numerator.setFormat("XXX-%05d");
numerator.setLastIncrement(BigInteger.TEN);
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath("/");
context.checking(new Expectations() {
{
allowing(mockClockService).now();
will(returnValue(LocalDate.now()));
}
});
}
示例2: setup
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Before
public void setup() {
propertyBookmark = new Bookmark("PROP", "123");
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath("/");
context.checking(new Expectations() {
{
allowing(mockBookmarkService).bookmarkFor(mockProperty);
will(returnValue(propertyBookmark));
}
});
numeratorRepository = new NumeratorRepository() {
@Override
protected <T> T firstMatch(Query<T> query) {
finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
return null;
}
@Override
protected List<Numerator> allInstances() {
finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
return null;
}
@Override
protected <T> List<T> allMatches(Query<T> query) {
finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
return null;
}
};
numeratorRepository.bookmarkService = mockBookmarkService;
}
示例3: testFindCountryTenancyFor
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Test
public void testFindCountryTenancyFor() {
// given
ApplicationTenancy atGlobalLevel = new ApplicationTenancy();
atGlobalLevel.setPath("/");
ApplicationTenancy atGlobalLevel_ = new ApplicationTenancy();
atGlobalLevel_.setPath("/_");
ApplicationTenancy atCountryLevel = new ApplicationTenancy();
atCountryLevel.setPath("/ABC");
ApplicationTenancy atCountryLevel_ = new ApplicationTenancy();
atCountryLevel_.setPath("/ABC/_");
ApplicationTenancy atPropertyLevel = new ApplicationTenancy();
atPropertyLevel.setPath("/ABC/DEF");
atPropertyLevel.setParent(atCountryLevel);
ApplicationTenancy atLandLordLevel = new ApplicationTenancy();
atLandLordLevel.setPath("/ABC/DEF/GHI");
atLandLordLevel.setParent(atPropertyLevel);
// when, then
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atGlobalLevel).getPath()).isEqualTo("/");
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atGlobalLevel_).getPath()).isEqualTo("/_");
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atCountryLevel).getPath()).isEqualTo("/ABC");
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atCountryLevel_).getPath()).isEqualTo("/ABC/_");
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atPropertyLevel).getPath()).isEqualTo("/ABC");
assertThat(estatioApplicationTenancyRepository.findCountryTenancyFor(atLandLordLevel).getPath()).isEqualTo("/ABC");
}
示例4: setUp
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
format = "0%6d";
lastIncrement = BigInteger.TEN;
invoiceRepository = new InvoiceRepository();
estatioNumeratorRepository = new NumeratorForCollectionRepository();
estatioNumeratorRepository.numeratorRepository = mockNumeratorRepository;
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath("/");
}
示例5: setUp
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Before
public void setUp() {
name= "SOME_NAME";
atPath = "/SOME/PATH";
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath(atPath);
}
示例6: tenancy
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
private static ApplicationTenancy tenancy(final String path, final String name) {
ApplicationTenancy applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath(path);
applicationTenancy.setName(name);
return applicationTenancy;
}
示例7: applicationTenancyOf
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
static ApplicationTenancy applicationTenancyOf(final String path) {
final ApplicationTenancy applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath(path);
return applicationTenancy;
}
示例8: newApplicationTenancy
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
private ApplicationTenancy newApplicationTenancy(final String path) {
ApplicationTenancy applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath(path);
return applicationTenancy;
}
示例9: happyCase
import org.isisaddons.module.security.dom.tenancy.ApplicationTenancy; //导入方法依赖的package包/类
@Test
public void happyCase() {
// given
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath("/FRA/PDH");
final Property property = new Property() {
@Override public ApplicationTenancy getApplicationTenancy() {
return applicationTenancy;
}
};
// when
landLordFra = new Party() {
@Override public ApplicationTenancy getApplicationTenancy() {
ApplicationTenancy applicationTenancyParty = new ApplicationTenancy();
applicationTenancyParty.setPath("/FRA");
return applicationTenancyParty;
}
};
tenantFra = new Party() {
@Override public ApplicationTenancy getApplicationTenancy() {
ApplicationTenancy applicationTenancyParty = new ApplicationTenancy();
applicationTenancyParty.setPath("/FRA");
return applicationTenancyParty;
}
};
error = leaseMenu.validateNewLease(property, null, null, null, new LocalDate(2010, 01, 01), null, new LocalDate(2020, 01, 01), landLordFra, tenantFra);
// then
assertThat(error).isNull();
// and when
landLordIta = new Party() {
@Override public ApplicationTenancy getApplicationTenancy() {
ApplicationTenancy applicationTenancyParty = new ApplicationTenancy();
applicationTenancyParty.setPath("/ITA");
return applicationTenancyParty;
}
};
error = leaseMenu.validateNewLease(property, null, null, null, new LocalDate(2010, 01, 01), null, new LocalDate(2020, 01, 01), landLordIta, tenantFra);
// then
assertThat(error).isEqualTo("Landlord not valid. (wrong application tenancy)");
// and when
tenantIta = new Party() {
@Override public ApplicationTenancy getApplicationTenancy() {
ApplicationTenancy applicationTenancyParty = new ApplicationTenancy();
applicationTenancyParty.setPath("/ITA");
return applicationTenancyParty;
}
};
error = leaseMenu.validateNewLease(property, null, null, null, new LocalDate(2010, 01, 01), null, new LocalDate(2020, 01, 01), landLordFra, tenantIta);
// then
assertThat(error).isEqualTo("Tenant not valid. (wrong application tenancy)");
}