Java Code Examples for org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager#copyToComponentLib()

The following examples show how to use org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager#copyToComponentLib() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaServiceTaskDeploymentUndeploymentTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public void envSetup() throws Exception {
    init();
    final String artifactLocation = FrameworkPathUtil.getSystemResourceLocation() + File
            .separator
                                    + BPMNTestConstants.DIR_ARTIFACTS + File.separator
                                    + BPMNTestConstants.DIR_BPMN + File.separator
                                    + "testArtifactid-1.0.jar";

    ServerConfigurationManager Loader = new ServerConfigurationManager(bpsServer);
    File javaArtifact = new File(artifactLocation);
    Loader.copyToComponentLib(javaArtifact);
    Loader.restartForcefully();

    //reinitialising, as session cookies and other configuration which expired during restart is
    // needs to be reset
    init();
}
 
Example 2
Source File: DS1063EmailUsernameTestCase.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {

    super.init();
    List<File> sqlFileLis = new ArrayList<File>();
    sqlFileLis.add(selectSqlFile("CreateEmailUsersTable.sql"));
    deployService(serviceName, createArtifact(
            getResourceLocation() + File.separator + "samples" + File.separator + "dbs" + File.separator + "rdbms"
                    + File.separator + serviceName + ".dbs", sqlFileLis));

    backendUrl = dssContext.getContextUrls().getBackEndUrl();

    /* login to the server as super user and add user with email user name for the test case */
    userManagementClient = new UserManagementClient(backendUrl, sessionCookie);

    userManagementClient.addRole("sampleRole", new String[] {}, new String[] { "admin" });
    userManagementClient
            .addUser("[email protected]", "test123", new String[] { "sampleRole" }, "emailUserProfile");

    serverConfigurationManager = new ServerConfigurationManager(dssContext);
    serverConfigurationManager.copyToComponentLib(new File(
            getResourceLocation() + File.separator + "jar" + File.separator + "msgContextHandler-1.0.0.jar"));

    String carbonHome = System.getProperty("carbon.home");
    File sourceFile = new File(
            getResourceLocation() + File.separator + "serverConfigs" + File.separator + "axis2.xml");
    File destinationFile = new File(
            carbonHome + File.separator + "conf" + File.separator + "axis2" + File.separator + "axis2.xml");

    serverConfigurationManager
            .applyConfiguration(sourceFile, destinationFile);//this will restart the server as well
    LoginLogoutClient loginLogoutClient = new LoginLogoutClient(dssContext);
    sessionCookie = loginLogoutClient.login();

    serviceEndPoint = getServiceUrlHttp(serviceName);

}
 
Example 3
Source File: DS1063EmailUsernameTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@BeforeClass(alwaysRun = true)
public void serviceDeployment() throws Exception {

    super.init();
    List<File> sqlFileLis = new ArrayList<File>();
    sqlFileLis.add(selectSqlFile("CreateEmailUsersTable.sql"));
    deployService(serviceName,
            createArtifact(getResourceLocation() + File.separator + "samples" + File.separator
                    + "dbs" + File.separator + "rdbms" + File.separator
                    + serviceName + ".dbs", sqlFileLis));

    backendUrl = dssContext.getContextUrls().getBackEndUrl();

    /* login to the server as super user and add user with email user name for the test case */
    userManagementClient = new UserManagementClient(backendUrl,sessionCookie);

    userManagementClient.addRole("sampleRole", new String[]{},new String[]{"admin"});
    userManagementClient.addUser("[email protected]","test123",new String[]{"sampleRole"},"emailUserProfile");

    serverConfigurationManager = new ServerConfigurationManager(dssContext);
    serverConfigurationManager.copyToComponentLib(new File(getResourceLocation()
            + File.separator + "jar" + File.separator
            + "msgContextHandler-1.0.0.jar"));

    String carbonHome = System.getProperty("carbon.home");
    File sourceFile = new File(getResourceLocation()
            + File.separator + "serverConfigs" + File.separator
            + "axis2.xml");
    File destinationFile = new File(carbonHome + File.separator + "conf" + File.separator + "axis2"+ File.separator + "axis2.xml");

    serverConfigurationManager.applyConfiguration(sourceFile, destinationFile);//this will restart the server as well
    LoginLogoutClient loginLogoutClient = new LoginLogoutClient(dssContext);
    sessionCookie = loginLogoutClient.login();

    serviceEndPoint = getServiceUrlHttp(serviceName);

}