Examples of ConfigReader


Examples of fi.luomus.commons.config.ConfigReader

      writer.write("DBusername = username");
      writer.newLine();
      writer.write("DBpassword = password");
      writer.newLine();
      writer.close();
      r = new ConfigReader(TEMP);
      if (r == null) fail("didn't open the file");
    }
View Full Code Here

Examples of fi.luomus.commons.config.ConfigReader

      if (!f.delete()) throw new Exception("delete failed: ConfigReader blocks the file");
    }
   
    public void test_itFailsToOpenAFileThatDoesntExists() {
      try {
        new ConfigReader("thisfiledoesntexists");
      } catch (Exception e) {
        return;
      }
      fail("Didn't fail");
    }
View Full Code Here

Examples of fi.luomus.commons.config.ConfigReader

    assert(laji.equals("HIPCARL"));
  }

  private static void configExample() {
    try {
      Config config = new ConfigReader("C:/myconfigfile.properties");
      String password = config.get(Config.DB_PASSWORD);
      String something = config.get("something");
    } catch (FileNotFoundException e) {
      // yep
    }
  }
View Full Code Here

Examples of fi.luomus.commons.config.ConfigReader

public class TestConfig {
 
  public static Config getConfig()  {
    try {
      return new ConfigReader("C:/apache-tomcat/app-conf/pese_frameworktests.config");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      return null;
    }
  }
View Full Code Here

Examples of fi.luomus.commons.config.ConfigReader

  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    try {
      String configFile = resolveConfigFile();
      System.out.println(this.getClass().getCanonicalName() + " being initialized using configfile " + configFile);
      this.config = new ConfigReader(configFile);
      if (this.config.developmentMode()) {
        this.errorReporter = new ErrorReporingToSystemErr();
      } else {
        this.errorReporter = new ErrorReporterViaEmail(this.config);
      }
View Full Code Here

Examples of multididdy_tools.ConfigReader

        String[] children = dir.list();

        for (int i = 0; i < children.length; ++i) {
            Debug.p(children[i], 5);
            ConfigReader conf = new ConfigReader(pathToWeapons + "/" + children[i] + "/weapon.ini");
            Weapon newW = new Weapon();

            newW.directory = pathToWeapons + "/" + children[i];
            //könnte man noch die bilder für die animationen reinladen

            newW.name = conf.getString("name");
            newW.type = WeaponTypes.valueOf(conf.getString("type"));
            newW.power = conf.getInt("power");
            newW.speed = conf.getInt("speed");
            newW.range = conf.getInt("range");
            newW.defaultAmmo = conf.getInt("defaultAmmo");
            newW.costMana = conf.getInt("costMana");
            newW.costStamina = conf.getInt("costStamina");
            newW.explosion = conf.getBool("explosion");
            newW.explosionRange = conf.getInt("explosionRange");
            newW.animationFrames = conf.getValues("animationFrames");
            newW.explosionFrames = conf.getValues("explosionFrames");
            newW.shootingFrames = conf.getValues("shootingFrames");

            weapons.add(newW);

        }
    }
View Full Code Here

Examples of multididdy_tools.ConfigReader

        String[] children = dir.list();

        for (int i = 0; i < children.length; ++i) {
            Debug.p(children[i], 5);
            ConfigReader conf = new ConfigReader(pathToItems + "/" + children[i] + "/item.ini");
            Item newI = new Item();

            newI.directory = pathToItems + "/" + children[i];
            //könnte man noch die bilder für die animationen reinladen

            newI.name = conf.getString("name");
            newI.type = ItemTypes.valueOf(conf.getString("type"));
            newI.pAttribute = PlayerAttributes.valueOf(conf.getString("pAttribute"));
            newI.wAttribute = WeaponAttribute.valueOf(conf.getString("wAttribute"));   
            newI.value = conf.getInt("value");
            newI.spawnTime = conf.getInt("spawnTime");
           

            items.add(newI);

       
View Full Code Here

Examples of net.sf.maven.plugins.eclipseformat.ConfigReader

     *             if the test has an error.
     */
    public void testGetPropertiesInvalidFile() throws Exception {

        // invalid file
        reader = new ConfigReader(log, "/importorder-test", null, false);
        properties = reader.getProperties();
        assertNotNull("Invalid properties should not be null", properties);
        assertTrue("Invalid properties should be empty", properties.isEmpty());

        try {
            // invalid file
            reader = new ConfigReader(log, "/importorder-test", null, true);
            reader.getProperties();
            fail("Should fail, failOnError flag is true");
        } catch (Exception e) {
            assertEquals("Error type should match", MojoExecutionException.class, e.getClass());
        }
View Full Code Here

Examples of net.sf.maven.plugins.eclipseformat.ConfigReader

     *             if the test has an error.
     */
    public void testGetPropertiesEmptyFile() throws Exception {

        // file with empty values
        reader = new ConfigReader(log, "/code-formatter-test.xml", null, false);
        properties = reader.getProperties();
        assertNotNull("Empty properties should not be null", properties);
        assertEquals("Empty properties should have 1 entry", 1, properties.size());

    }
View Full Code Here

Examples of net.sf.maven.plugins.eclipseformat.ConfigReader

     *             if the test has an error.
     */
    public void testGetPropertiesDefaultFormat() throws Exception {

        // default
        reader = new ConfigReader(log, EclipseFormatMojo.CODE_FORMAT_CONFIG, null, false);
        properties = reader.getProperties();
        assertNotNull("Default code format properties should not be null", properties);
        assertFalse("Default code format properties should not be empty", properties.isEmpty());
        assertEquals("Tabulation char should match", "space", properties.getProperty(TABULATION_CHAR));
    }
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.