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


Java TestUserMode.TENANT_ADMIN属性代码示例

本文整理汇总了Java中org.wso2.carbon.automation.engine.context.TestUserMode.TENANT_ADMIN属性的典型用法代码示例。如果您正苦于以下问题:Java TestUserMode.TENANT_ADMIN属性的具体用法?Java TestUserMode.TENANT_ADMIN怎么用?Java TestUserMode.TENANT_ADMIN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.wso2.carbon.automation.engine.context.TestUserMode的用法示例。


在下文中一共展示了TestUserMode.TENANT_ADMIN属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:InMemoryDSSampleTestCase.java

示例2: 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());

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:EagerLoadingTestCase.java

示例3: setEnvironment

@BeforeTest(alwaysRun = true)
public void setEnvironment() throws Exception {

    super.init(TestUserMode.TENANT_ADMIN);
    serverManager = new ServerConfigurationManager(context);
    File sourceFile = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator +
                                "ESB" + File.separator + "json" + File.separator + "tenant-axis2.xml");

    File targetFile = new File(CarbonUtils.getCarbonHome() + File.separator + "conf"
            + File.separator + "axis2" + File.separator + "tenant-axis2.xml");

    serverManager.applyConfigurationWithoutRestart(sourceFile, targetFile, true);

    loadESBConfigurationFromClasspath("/artifacts/ESB/json/tenant-json-test-case.xml");
    //Give some time to load the configuration since this test is failing intermittently due to not deploying the artifact
    Thread.sleep(3000);
    serviceUrl = context.getContextUrls().getServiceUrl() + "/jsonproducer/";
    jsonClient = new JSONClient();
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:CARBON14965TenantJsonFormatter.java

示例4: 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);
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:10,代码来源:DSSIntegrationTest.java

示例5: serviceDeployment

@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {
	super.init(TestUserMode.TENANT_ADMIN);
	List<File> sqlFileLis = new ArrayList<>();
	sqlFileLis.add(selectSqlFile("CreateTables.sql"));
	sqlFileLis.add(selectSqlFile("Offices.sql"));
	deployService(serviceName, createArtifact(
			getResourceLocation() + File.separator + "dbs" + File.separator + "rdbms" + File.separator + "h2"
					+ File.separator + "GsonFormatterTenantModeTest.dbs", sqlFileLis));
	deployService(serviceName1, createArtifact(
			getResourceLocation() + File.separator + "dbs" + File.separator + "rdbms" + File.separator + "h2"
					+ File.separator + "H2SimpleJsonTest1.dbs", sqlFileLis));
	serviceEndPoint = getServiceUrlHttp(serviceName) + "/";
	serviceEndPoint1 = getServiceUrlHttp(serviceName1) + "/";
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:15,代码来源:CARBON15262JsonGsonFormatterTenantModeTest.java

示例6: setEnvironment

@BeforeClass(alwaysRun = true)
public void setEnvironment() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);
    secureAxisServiceClient = new SecureServiceClient();
    addSequence(getArtifactConfig("TestIn.xml"));
    addSequence(getArtifactConfig("reciveSeq.xml"));
    addSequence(getArtifactConfig("TestOut.xml"));
    addInboundEndpoint(getArtifactConfig("synapse2.xml"));

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:10,代码来源:HttpsInboundTransportTenantTestCase.java

示例7: inboundHttpTenantDispatchTests

@Test(groups = "wso2.esb", description = "Inbound HTTP Tenant Dispatch " +
        "(Shared Port between super tenant and regular tenant)" )
public void inboundHttpTenantDispatchTests() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);

    addSequence(getArtifactConfig("tenant/sequences", "main.xml"));
    addSequence(getArtifactConfig("tenant/sequences", "fault.xml"));
    addSequence(getArtifactConfig("tenant/sequences", "tenant.xml"));

    addApi(getArtifactConfig("tenant/api", "tenantAPI.xml"));
    addProxyService(getArtifactConfig("tenant/proxy-services", "TestProxy.xml"));
    addInboundEndpoint(getArtifactConfig("tenant/inbound-endpoints", "ie1.xml"));

    Thread.sleep(15000);
    logViewerClient.clearLogs();

    axis2Client.sendSimpleStockQuoteRequest("http://localhost:9090/t/wso2.com/tenantAPI", null, "WSO2");
    Assert.assertTrue(stringExistsInLog("TENANT_API"), "Dispatch to http://localhost:9090/t/wso2.com/tenantAPI");

    axis2Client.sendSimpleStockQuoteRequest("http://localhost:9090/t/wso2.com/", null, "WSO2");
    Assert.assertTrue(stringExistsInLog("SUB_TENANT"), "Dispatch to http://localhost:9090/t/wso2.com/");

    axis2Client.sendSimpleStockQuoteRequest("http://localhost:9090/services/t/wso2.com/TestProxy", null, "WSO2");
    Assert.assertTrue(stringExistsInLog("TENANT_PROXY_HIT"),
            "Dispatch to http://localhost:9090/services/t/wso2.com/TestProxy");

    /**
     * Test non existent tenant - should hit carbon super (or dispatch to any API with tenant like context on carbon super).
     */
    axis2Client.sendSimpleStockQuoteRequest("http://localhost:9090/t/idontexist", null, "WSO2");
    //matches with inbound regex but no api or proxy should be dispatched to super tenant main sequence
    Assert.assertTrue(stringExistsInLog("SUPER_MAIN"), "Dispatch to http://localhost:9090/t/idontexist");

    axis2Client.sendSimpleStockQuoteRequest("http://localhost:9090/t/idoexistassupertenantapi", null, "WSO2");
    Assert.assertTrue(stringExistsInLog("SUPER_TENANT_API_WITH_TENANT_CONTEXT"),
            "Dispatch to http://localhost:9090/t/idoexistassupertenantapi");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:37,代码来源:HttpInboundDispatchTestCase.java

示例8: setEnvironment

@BeforeClass(alwaysRun = true)
public void setEnvironment() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);

    addSequence(getArtifactConfig("TestIn.xml"));
    addSequence(getArtifactConfig("reciveSeq.xml"));
    addSequence(getArtifactConfig("TestOut.xml"));
    addInboundEndpoint(getArtifactConfig("synapse.xml"));
    addApi(getArtifactConfig("Test.xml"));
    addInboundEndpoint(getArtifactConfig("apidispatch.xml"));
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:11,代码来源:HttpInboundTransportTenantTestCase.java

示例9: setEnvironment

@BeforeClass(alwaysRun = true)
public void setEnvironment() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);
    String artifactPath = "artifacts" + File.separator + "ESB" + File.separator + "api" + File.separator
            + "Tenant.xml";
    loadESBConfigurationFromClasspath(artifactPath);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:7,代码来源:ESBJAVA5069AccessSwaggerTenantTestCase.java

示例10: uploadCarFileTest

@BeforeClass(alwaysRun = true)
protected void uploadCarFileTest() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);
    uploadCapp(carFileName
               , new DataHandler(new URL("file:" + File.separator + File.separator + getESBResourceLocation()
                                         + File.separator + "car" + File.separator + carFileName)));
    TimeUnit.SECONDS.sleep(30);
    log.info(carFileName + " uploaded successfully");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:9,代码来源:ESBJAVA3611EndpointTestCase.java

示例11: 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);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:6,代码来源:DSSIntegrationTest.java

示例12: destroy

@AfterClass(alwaysRun = true) public void destroy() throws Exception {
	super.reloadSessionCookie(TestUserMode.TENANT_ADMIN);
	deleteService(serviceName);
	cleanup();
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:5,代码来源:CARBON15262JsonGsonFormatterTenantModeTest.java

示例13: deployService

@BeforeClass(alwaysRun = true)
public void deployService() throws Exception {
    super.init(TestUserMode.TENANT_ADMIN);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:4,代码来源:JSONPayloadProperFormatTenantModeTestCase.java


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