Examples of ConfigFile


Examples of net.crystalyx.bukkit.simplyperms.io.ConfigFile

      ConfigSQL configsql = new ConfigSQL(this);
      if (configsql.checkDatabase()) {
        config = configsql;
      } else {
        debug("Fail to connect to database !");
        config = new ConfigFile(this);
      }
    }
    else {
      config = new ConfigFile(this);
    }
  }
View Full Code Here

Examples of net.tralfamadore.config.ConfigFile

        assertEquals(jpaEntityManager, jpaEntityManagerProvider.get());
    }

    @Test
    public void testGetWithoutEntityManager() throws Exception {
        final ConfigFile config = new ConfigFile(false);
        config.getPersistenceProperties().put("javax.persistence.jdbc.driver", "org.apache.derby.jdbc.EmbeddedDriver");
        config.getPersistenceProperties().put("javax.persistence.jdbc.url", "jdbc:derby:cmf;create=true");

        new NonStrictExpectations() {{
            CmfContext.getInstance(); result = cmfContext;
            cmfContext.getConfigFile(); result = config;
            Persistence.createEntityManagerFactory(EntityManagerProvider.PERSISTENCE_UNIT_NAME,
                    config.getPersistenceProperties()); result = entityManagerFactory;
            entityManagerFactory.createEntityManager(); result = jpaEntityManager;
        }};

        JpaEntityManagerProvider jpaEntityManagerProvider = new JpaEntityManagerProvider();
        assertEquals(jpaEntityManager, jpaEntityManagerProvider.get());
View Full Code Here

Examples of net.tralfamadore.config.ConfigFile

        }};
    }

    @Test
    public void testGetWithoutEntityManagerEmbeddedMem() throws Exception {
        final ConfigFile config = new ConfigFile(false);
        config.getPersistenceProperties().put("javax.persistence.jdbc.driver", "org.apache.derby.jdbc.EmbeddedDriver");
        config.getPersistenceProperties().put("javax.persistence.jdbc.url", "jdbc:derby:memory:cmf;create=true");

        new NonStrictExpectations() {{
            CmfContext.getInstance(); result = cmfContext;
            cmfContext.getConfigFile(); result = config;
            Persistence.createEntityManagerFactory(EntityManagerProvider.PERSISTENCE_UNIT_NAME,
                    config.getPersistenceProperties()); result = entityManagerFactory;
            entityManagerFactory.createEntityManager(); result = jpaEntityManager;
        }};

        JpaEntityManagerProvider jpaEntityManagerProvider = new JpaEntityManagerProvider();
        assertEquals(jpaEntityManager, jpaEntityManagerProvider.get());
View Full Code Here

Examples of net.tralfamadore.config.ConfigFile

    }

    @Override
    public EntityManager get() {
        if(em == null) {
            ConfigFile configFile = CmfContext.getInstance().getConfigFile();

            Map<String,String> properties = new HashMap<String,String>();

            for(Map.Entry<String,String> entry : configFile.getPersistenceProperties().entrySet()) {
                properties.put(entry.getKey(), entry.getValue());
            }

            emFactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
            em = emFactory.createEntityManager();
View Full Code Here

Examples of org.archive.spring.ConfigFile

        protected AbstractCookieStore bdbCookieStore() throws IOException {
            if (bdbCookieStore == null) {
                bdbCookieStore = new BdbCookieStore();
                ConfigPath basePath = new ConfigPath("testBase",
                        tmpdir.getAbsolutePath());
                ConfigFile cookiesSaveFile = new ConfigFile("cookiesSaveFile", "cookies.txt");
                cookiesSaveFile.setBase(basePath);
                bdbCookieStore.setCookiesSaveFile(cookiesSaveFile);
                bdbCookieStore.setBdbModule(bdb());
                bdbCookieStore.start();
            }
            return bdbCookieStore;
View Full Code Here

Examples of org.archive.spring.ConfigFile

    protected AbstractCookieStore bdbCookieStore() throws IOException {
        if (bdbCookieStore == null) {
            bdbCookieStore = new BdbCookieStore();
            ConfigPath basePath = new ConfigPath("testBase",
                    getTmpDir().getAbsolutePath());
            ConfigFile cookiesSaveFile = new ConfigFile("cookiesSaveFile", "cookies.txt");
            cookiesSaveFile.setBase(basePath);
            bdbCookieStore.setCookiesSaveFile(cookiesSaveFile);
            bdbCookieStore.setBdbModule(bdb());
            bdbCookieStore.start();
        }
        return bdbCookieStore;
View Full Code Here

Examples of org.asteriskjava.config.ConfigFile

        System.err.println("mailboxes: " + server.getVoicemailboxes());
    }

    public void testGetConfig() throws Exception
    {
        ConfigFile config;

        config = server.getConfig("voicemail.conf");
        assertEquals("voicemail.conf", config.getFilename());

        System.err.println(config.getCategories());
    }
View Full Code Here

Examples of org.tmatesoft.hg.internal.ConfigFile

  Between two subsequent revisions (i.e. direct child in remote of a local root)
  cmd=between&pairs=71ddbf8603e8e09d54ac9c5fe4bb5ae824589f1d-8c8e3f372fa1fbfcf92b004b6f2ada2dbaf60028
   empty result
   */
  public static void main(String[] args) throws Exception {
    ConfigFile cfg =  new ConfigFile(new BasicSessionContext(null));
    cfg.addLocation(new File(System.getProperty("user.home"), ".hgrc"));
    String svnkitServer = cfg.getSection("paths").get("svnkit");
//    URL url = new URL(svnkitServer + "?cmd=branches&nodes=30bd389788464287cee22ccff54c330a4b715de5");
//    URL url = new URL(svnkitServer + "?cmd=between");
    URL url = new URL(svnkitServer + "?cmd=changegroup&roots=71ddbf8603e8e09d54ac9c5fe4bb5ae824589f1d");
//    URL url = new URL("http://localhost:8000/" + "?cmd=between");
//    URL url = new URL(svnkitServer + "?cmd=stream_out");
View Full Code Here

Examples of org.tmatesoft.hg.internal.ConfigFile

    return new HgRemoteRepository(getSessionContext(), rd);
  }

  private ConfigFile getGlobalConfig() {
    if (globalCfg == null) {
      globalCfg = new ConfigFile(getSessionContext());
      try {
        globalCfg.addLocation(new File(System.getProperty("user.home"), ".hgrc"));
      } catch (HgIOException ex) {
        // XXX perhaps, makes sense to let caller/client know that we've failed to read global config?
        getSessionContext().getLog().dump(getClass(), Warn, ex, null);
View Full Code Here

Examples of org.tmatesoft.hg.internal.ConfigFile

   * @return access to configuration options, never <code>null</code>
   */
  public HgRepoConfig getConfiguration() /* XXX throws HgInvalidControlFileException? Description of the exception suggests it is only for files under ./hg/*/ {
    if (repoConfig == null) {
      try {
        ConfigFile configFile = impl.readConfiguration();
        repoConfig = new HgRepoConfig(configFile);
      } catch (HgIOException ex) {
        String m = "Errors while reading user configuration file";
        getSessionContext().getLog().dump(getClass(), Warn, ex, m);
        return new HgRepoConfig(new ConfigFile(getSessionContext())); // empty config, do not cache, allow to try once again
        //throw new HgInvalidControlFileException(m, ex, null);
      }
    }
    return repoConfig;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.