本文整理汇总了Java中org.wso2.carbon.automation.engine.context.TestUserMode.TENANT_USER属性的典型用法代码示例。如果您正苦于以下问题:Java TestUserMode.TENANT_USER属性的具体用法?Java TestUserMode.TENANT_USER怎么用?Java TestUserMode.TENANT_USER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wso2.carbon.automation.engine.context.TestUserMode
的用法示例。
在下文中一共展示了TestUserMode.TENANT_USER属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
@BeforeClass(alwaysRun = true)
public void initialize() throws Exception {
super.init(userMode);
String resourceFileLocation;
resourceFileLocation = getResourceLocation();
//DataSource already exist by default for super user.
if (userMode == TestUserMode.TENANT_ADMIN || userMode == TestUserMode.TENANT_USER) {
addDataSources();
}
deployService(serviceName,
new DataHandler(new URL("file:///" + resourceFileLocation +
File.separator + "samples" + File.separator +
"dbs" + File.separator + "inmemory" + File.separator +
"InMemoryDSSample.dbs")));
log.info(serviceName + " uploaded");
serviceUrl = getServiceUrlHttp(serviceName);
}
示例2: validateServiceUrl
private void validateServiceUrl(String serviceUrl, Tenant tenant) {
//if user mode is null can not validate the service url
if (userMode != null) {
if ((userMode == TestUserMode.TENANT_ADMIN || userMode == TestUserMode.TENANT_USER)) {
Assert.assertTrue(serviceUrl.contains("/t/" + tenant.getDomain() + "/"), "invalid service url for tenant. " + serviceUrl);
} else {
Assert.assertFalse(serviceUrl.contains("/t/"), "Invalid service url for user. " + serviceUrl);
}
}
}
示例3: serviceDeployment
@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {
super.init(TestUserMode.TENANT_USER);
List<File> sqlFileLis = new ArrayList<File>();
sqlFileLis.add(selectSqlFile("RequestBoxTestTables.sql"));
deployService(serviceName,
createArtifact(getResourceLocation() + File.separator + "dbs" + File.separator
+ "rdbms" + File.separator + "h2" + File.separator
+ "RequestBoxTenantTest.dbs", sqlFileLis));
serviceEndPoint = getServiceUrlHttp(serviceName);
}
示例4: serviceDeployment
@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {
super.init(TestUserMode.TENANT_USER);
List<File> sqlFileLis = new ArrayList<>();
sqlFileLis.add(selectSqlFile("CreateODataTables.sql"));
sqlFileLis.add(selectSqlFile("Customers.sql"));
deployService(serviceName,
createArtifact(getResourceLocation() + File.separator + "dbs" + File.separator + "odata" +
File.separator + "ODataSampleTenantService.dbs", sqlFileLis));
webAppUrl = dssContext.getContextUrls().getWebAppURL();
int i = webAppUrl.indexOf("/t/");
webAppUrl = webAppUrl.substring(0,i);
}
示例5: isTenant
protected boolean isTenant() throws Exception {
if(userMode == null){
throw new Exception("UserMode Not Initialized. Can not identify user type");
}
return (userMode == TestUserMode.TENANT_ADMIN || userMode == TestUserMode.TENANT_USER);
}