Package com.tll.config

Examples of com.tll.config.Config


  @Override
  @BeforeClass
  protected void beforeClass() {
    // create the db shell first (before test injector creation) to avoid db4o
    // file lock when objectcontainer is instantiated
    final Config cfg = Config.load();
    cfg.setProperty(Db4oDaoModule.ConfigKeys.DB4O_EMPLOY_SPRING_TRANSACTIONS.getKey(), false);
    final Injector i = buildInjector(new TestDb4oDaoModule(cfg), new Db4oDbShellModule() );
    final IDbShell dbs = i.getInstance(IDbShell.class);
    dbs.delete();
    dbs.create();
View Full Code Here


  @Override
  protected void beforeClass() {
    // create the db shell first (before test injector creation) to avoid db4o
    // file lock when objectcontainer is instantiated
    final Config cfg = getConfig();
    final Injector i = buildInjector(new TestDb4oDaoModule(cfg), new Db4oDbShellModule() );
    final IDbShell dbs = i.getInstance(IDbShell.class);
    dbs.drop();
    dbs.create();
View Full Code Here

   * Constructor
   */
  public Db4oDbShellTest() {
    super();
    // kill the existing db4o file if present
    final Config cfg = Config.load();
    final Injector i = buildInjector(new TestDb4oDaoModule(cfg));
    final File f = new File(i.getInstance(Key.get(URI.class, Db4oFile.class)));
    f.delete();
  }
View Full Code Here

  /**
   * Tests that a valid URI is provided given an absolute file path where the
   * file does not exist.
   */
  public void testResolveAbsoluteDb4oFilePathNonExistent() {
    Config cfg = new Config();
   
    String fpath = System.getProperty("java.io.tmpdir") + "/dbfile.tmp";
    File f = new File(fpath);
    Assert.assertFalse(f.exists());
   
    cfg.setProperty(Db4oConfigKeys.DB4O_FILEREF.getKey(), fpath);
    cfg.setProperty(Db4oConfigKeys.DB4O_FILENAME.getKey(), "fail");
   
    URI uri = Db4oDbShell.resolveDb4oFileLocationFromConfig(cfg);
    Assert.assertNotNull(uri, "Null uri");
    Assert.assertEquals(uri.getPath(), f.toURI().getPath());
  }
View Full Code Here

  /**
   * Tests that a valid URI is provided given an absolute file path.
   */
  public void testResolveAbsoluteDb4oFilePathExistent() throws Exception {
    Config cfg = new Config();
   
    File f = File.createTempFile("dbfile", ".tmp");
   
    String fpath = f.getPath();
    cfg.setProperty(Db4oConfigKeys.DB4O_FILEREF.getKey(), fpath);
    cfg.setProperty(Db4oConfigKeys.DB4O_FILENAME.getKey(), "fail");
   
    URI uri = Db4oDbShell.resolveDb4oFileLocationFromConfig(cfg);
    Assert.assertNotNull(uri, "Null uri");
    Assert.assertEquals(uri.getPath(), f.toURI().getPath());
  }
View Full Code Here

    final ServletContext servletContext = event.getServletContext();

    // load *all* found config properties
    // NOTE: this is presumed to be the first contact point with the config
    // instance!
    final Config config;
    try {
      config = Config.load(new ConfigRef(true));
    }
    catch(final IllegalArgumentException e) {
      throw new Error("Unable to load config: " + e.getMessage(), e);
    }

    // pre dependency injection initializing
    log.debug("Performing pre-injection initialization..");
    beforeInjection(event);

    // load the dependency handler definitions
    log.debug("Creating dependency handlers..");
    loadDependencyHandlers(servletContext);

    final String stage = config.getString("stage", "prod");
    log.info("Bootstrapping app [stage: " + stage + "]..");

    // create the dependency injector
    log.debug("Creating dependency injector..");
    final Injector injector = createInjector(servletContext, "dev".equals(stage) ? Stage.DEVELOPMENT : Stage.PRODUCTION, config);
View Full Code Here

  "dao", "db4o", "model" })
public class SmbizEGraphDb4oStubTest extends AbstractDbAwareTest {

  @Override
  protected Config doGetConfig() {
    Config c = Config.load(new ConfigRef("db4o-config.properties"));
    c.setProperty("db.transaction.bindToSpringAtTransactional", Boolean.FALSE);
    return c;
  }
View Full Code Here

  /**
   * Tests the di of the mail module.
   * @throws Exception
   */
  public void test() throws Exception {
    Config c = Config.load();
    Injector i;
    try {
      i = Guice.createInjector(Stage.DEVELOPMENT, new MailModule(c));
    }
    catch(Throwable t) {
View Full Code Here

  /**
   * Tests the di of the mail module.
   * @throws Exception
   */
  public void test() throws Exception {
    Config c = Config.load();
    Injector i;
    try {
      i = Guice.createInjector(Stage.DEVELOPMENT, new MailModule(c));
    }
    catch(Throwable t) {
View Full Code Here

    modules.add(new SmbizDb4oDaoModule(getConfig()));
  }

  @Override
  protected Config doGetConfig() {
    final Config c = Config.load(new ConfigRef("test-config.properties"));
    c.setProperty(Db4oDaoModule.ConfigKeys.DB4O_EMPLOY_SPRING_TRANSACTIONS.getKey(), false);
    return c;
  }
View Full Code Here

TOP

Related Classes of com.tll.config.Config

Copyright © 2018 www.massapicom. 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.