本文整理汇总了Java中org.wso2.carbon.automation.engine.context.TestUserMode.SUPER_TENANT_USER属性的典型用法代码示例。如果您正苦于以下问题:Java TestUserMode.SUPER_TENANT_USER属性的具体用法?Java TestUserMode.SUPER_TENANT_USER怎么用?Java TestUserMode.SUPER_TENANT_USER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wso2.carbon.automation.engine.context.TestUserMode
的用法示例。
在下文中一共展示了TestUserMode.SUPER_TENANT_USER属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startServerWithEagerLoading
@BeforeClass(alwaysRun = true)
protected void startServerWithEagerLoading() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
serverManager = new ServerConfigurationManager(context);
AutomationContext autoContext = new AutomationContext();
// upload a faulty sequence which refer registry resource doesn't exists
FileUtils.copyFileToDirectory(new File(FrameworkPathUtil.getSystemResourceLocation() +
"/artifacts/ESB/eager/loading/ESBJAVA3602-FaultySeq.xml"),
getSynapseDeploymentDir());
File carbonXml = new File(FrameworkPathUtil.getSystemResourceLocation() +
"/artifacts/ESB/eager/loading/ESBJAVA3602Carbon.xml");
serverManager.applyConfiguration(carbonXml, getCarbonXmlFile());
super.init(TestUserMode.TENANT_ADMIN);
logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie());
}
示例2: testPOSTRequestByUser
@Test(groups = {"wso2.esb"}, description = "POST request by user/tenant", dependsOnMethods = "testPOSTRequestBySuperAdmin")
public void testPOSTRequestByUser() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
applySecurity("1", "Axis2ServiceProxy", getUserRole()[0]);
String securedRestURL = getProxyServiceURLHttps("Axis2ServiceProxy") + "/echoString";
HttpsResponse response = HttpsURLConnectionClient.postWithBasicAuth(securedRestURL, "s=TestAutomation",
userInfo.getUserName(), userInfo.getPassword());
assertTrue(response.getData().contains("<ns:echoStringResponse xmlns:ns=\"http://service.carbon.wso2.org\">" +
"<ns:return>TestAutomation</ns:return></ns:echoStringResponse>")
, "response doesn't contain the expected output");
}
示例3: testPOSTRequestByInvalidUser
@Test(groups = {"wso2.esb"}, description = "POST request by invalid user",
dependsOnMethods = "testPOSTRequestByUser", expectedExceptions = IOException.class)
public void testPOSTRequestByInvalidUser() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
applySecurity("1", "Axis2ServiceProxy", getUserRole()[0]);
String securedRestURL = getProxyServiceURLHttps("Axis2ServiceProxy") + "/echoString";
HttpsResponse response =
HttpsURLConnectionClient.postWithBasicAuth(securedRestURL, "s=TestAutomation",
"invalidUser", "InvalidPassword");
assertFalse(response.getData().contains("<ns:echoStringResponse xmlns:ns=\"http://service.carbon.wso2.org\">" +
"<ns:return>TestAutomation</ns:return></ns:echoStringResponse>")
, "response doesn't contain the expected output");
}
示例4: init
@BeforeClass(alwaysRun = true)
public void init() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
updateESBConfiguration(RestEndpointSetter.setEndpoint(File.separator + "artifacts" + File.separator + "ESB" +
File.separator + "synapseconfig" + File.separator + "rest" +
File.separator + "student-service-synapse.xml"));
applySecurity("1", "StudentServiceProxy", getUserRole()[0]);
}
示例5: testGetQuoteByUser
@Test(groups = {"wso2.esb"}, description = "test pox security with user credentials",
dependsOnMethods = "testGetQuote")
public void testGetQuoteByUser() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
applySecurity("1", SERVICE_NAME, getUserRole()[0]);
String securedRestURL = getProxyServiceURLHttps(SERVICE_NAME) + "/getSimpleQuote";
HttpsResponse response = HttpsURLConnectionClient.getWithBasicAuth(securedRestURL, "symbol=IBM",
userInfo.getUserName(), userInfo.getPassword());
assertTrue(response.getData().contains(":name>IBM Company</"),
"getQuote doesn't return expected values");
assertTrue(response.getData().contains(":symbol>IBM</"),
"getQuote doesn't return expected values");
}