    @Test
    public void TestStartServer() {

        logger.info("Testing starting and stopping server.");
        BundleContext mockContext = createMockContext(new File(TMP_FOLDER_NAME));
        LDAPManager manager = new LDAPManager(mockContext);
        HashMap config = new HashMap();
        config.put("admin.port", AvailablePortFinder.getNextAvailable());
        config.put("ldaps.port", AvailablePortFinder.getNextAvailable());
        config.put("ldap.port", AvailablePortFinder.getNextAvailable());
        manager.setAdminPort(adminPort);
        manager.setLDAPPort(ldapPort);
        manager.setLDAPSPort(ldapsPort);
        manager.setDataPath(new File(TMP_FOLDER_NAME).getAbsolutePath() + File.separator + "ldap");
        assertNotNull(manager);
        try {
            logger.info("Starting Server.");
            manager.startServer();
            manager.updateCallback(config);
            Assert.assertEquals(
                    "Admin port of " + manager.getAdminPort() + " expected " + config.get(
                            "admin.port"), config.get("admin.port"), manager.getAdminPort());
            Assert.assertEquals(
                    "LDAPS port of " + manager.getLDAPSPort() + " expected " + config.get(
                            "ldaps.port"), config.get("ldaps.port"), manager.getLDAPSPort());
            Assert.assertEquals("LDAP port of " + manager.getLDAPPort() + " expected " + config.get(
                    "ldap.port"), config.get("ldap.port"), manager.getLDAPPort());
            logger.info("Successfully started server, now stopping.");
            manager.stopServer();
        } catch (LDAPException le) {
            le.printStackTrace();
            fail(le.getMessage());
        } finally {
            try {
                manager.stopServer();
            } catch (LDAPException le) {
                le.printStackTrace();
                fail(le.getMessage());
            }
        }

    }