Found this code inside InMemoryRealmService - and called from the
constructor..

Are we ever using InMemoryRealmService ?

    public void setup() throws RegistryException {

        String derbyDBName = "target/databasetest/CARBON_TEST";
        String dbDirectory = "target/databasetest";
        if ((new File(dbDirectory)).exists()) {
            deleteDBDir(new File(dbDirectory));
        }
        // create an in-memory realm
        try {
            // check whether the driver is loaded.
            Class.forName("org.h2.Driver");
        } catch (ClassNotFoundException e) {
            String msg = "Derby database embedded driver is not available
in the class path. "
                    + "Could not create the database for the user manager.";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }

        dataSource = new BasicDataSource();
        String connectionUrl = "jdbc:h2:" + derbyDBName;
        dataSource.setUrl(connectionUrl);
        dataSource.setDriverClassName("org.h2.Driver");

        try {
            DatabaseCreator creator = new DatabaseCreator(dataSource);
            creator.createRegistryDatabase();
            RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
            InputStream inStream = new FileInputStream(

"src/test/resources/user-test/user-mgt-registry-test.xml");
            try {
                bootstrapRealmConfig =
builder.buildRealmConfiguration(inStream);
            } finally {
                inStream.close();
            }
        } catch (Exception e) {
            String msg = "Failed to initialize the user manager. " +
e.getMessage();
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
        this.tenantManager = new JDBCTenantManager(dataSource, null);
    }

On Sun, Jul 14, 2013 at 6:58 PM, Prabath Siriwardena <[email protected]>wrote:

> $subject
>
> --
> Thanks & Regards,
> Prabath
>
> Mobile : +94 71 809 6732
>
> http://blog.facilelogin.com
> http://RampartFAQ.com
>



-- 
Thanks & Regards,
Prabath

Mobile : +94 71 809 6732

http://blog.facilelogin.com
http://RampartFAQ.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to