Examples of Config


Examples of at.kugel.tool.buildtray.config.Config

   @Test
   public void testBusySkipped() {
      IntegrationTestConfig serverMockConf = createConfig();
      serverMockConf.setServerlUrl4Test(getTestDataUrl("Jenkins-1.4_busy.xml"));
      Config mockConfig = decorateCheckBusy(serverMockConf, CheckBusy.SKIP);

      IntegrationStatusResult res = refreshWith(mockConfig);

      assertNull(res.error);
      assertNull(res.projectName);
View Full Code Here

Examples of backtype.storm.Config

    private static final String WORD_SPOUT = "WORD_SPOUT";
    private static final String LOOKUP_BOLT = "LOOKUP_BOLT";
    private static final String TOTAL_COUNT_BOLT = "TOTAL_COUNT_BOLT";

    public static void main(String[] args) throws Exception {
        Config config = new Config();

        Map<String, Object> hbConf = new HashMap<String, Object>();
        if(args.length > 0){
            hbConf.put("hbase.rootdir", args[0]);
        }
        config.put("hbase.conf", hbConf);

        WordSpout spout = new WordSpout();
        TotalWordCounter totalBolt = new TotalWordCounter();

        SimpleHBaseMapper mapper = new SimpleHBaseMapper().withRowKeyField("word");
View Full Code Here

Examples of be.xtnd.commons.Config

    scrollPane.getViewport().add(desktop);
      contentPane.add(scrollPane,BorderLayout.CENTER);
      contentPane.add(status(), BorderLayout.SOUTH);
    desktop.getRootPane().setGlassPane(glassPane);

    conf = new Config(config);
    conf.loadConfig(false);

    Object c = new Object();
    while(conf.loaded==false){
      try{
View Full Code Here

Examples of br.com.objectos.way.etc.Config

    Global global = FakeGlobals.GLOBAL_USER_A;

    String expect = EtcFiles.readLines("/model/global-usera.yaml");
    System.out.println(expect);

    Config config = configProvider.get();
    String res = config.toString(global);
    System.out.println(res);

    assertThat(res, equalTo(expect));
  }
View Full Code Here

Examples of cfdict.config.Config

public class CFDICTSqlCreator {

    public static void main(String[] args) {

        try {
            Config config = new Config("config/config.properties");
            System.out.println("[MODE " + config.getMode() + "]");
           
            Download dl = new Download(config);
            dl.process();
            Decompress dp = new Decompress(config);
            dp.process();
            Parser p = new Parser(config);
            Generator g;
            if (config.getMode().equals("INSERT"))
                g = new InsertGenerator(config, p.process());
            else
                g = new UpdateGenerator(config, p.process());           
            g.process();
           
           
           

            System.out.println("Debut de la mise a jour du fichier de configuration");
            // set the timestamp for next time update process
            config.setTimestamp();
            // set the mode to update
            config.setModeUpdate();
            // save the modification
            config.updateConfigFile();
            System.out.println("Fin de la mise a jour du fichier de configuration");

            System.out.println("Execution terminee, vous pouvez fermer cette fenetre.");
           
        } catch (FileNotFoundException ex) {
View Full Code Here

Examples of ch.bfh.swos.gandalf.model.Config

  @Inject
  private ConfigDao configdao;
 
  @Test
  public void test() {
    Config config = configdao.create();
    config.setName("PersistenceConfigServiceTest");
    config.setVal("True");
    Config managedConfig = configdao.update(config);
    Config foundConfig = configdao.read(managedConfig.getId());
    Assert.assertTrue(config.getName().equalsIgnoreCase(foundConfig.getName()));
    Assert.assertTrue(config.getVal().equalsIgnoreCase(foundConfig.getVal()));
    configdao.delete(foundConfig);
  }
View Full Code Here

Examples of ch.njol.skript.config.Config

      for (int l = 0; l < 2; l++) {
        Language.setUseLocal(l == 1);
        if (l == 1 && !Language.isUsingLocal())
          break;
       
        final Config aliasConfig;
        try {
          final File file = new File(Skript.getInstance().getDataFolder(), "aliases-" + Language.getName() + ".sk");
          if (!file.exists()) {
            Skript.error("Could not find the " + Language.getName() + " aliases file " + file.getName());
          }
          aliasConfig = new Config(file, false, true, "=");
        } catch (final IOException e) {
          Skript.error("Could not load the " + Language.getName() + " aliases config: " + e.getLocalizedMessage());
          return;
        }
       
        final ArrayList<String> aliasNodes = new ArrayList<String>();
       
        aliasConfig.validate(
            new SectionValidator()
                .addEntry("aliases", new Setter<String>() {
                  @Override
                  public void set(final String s) {
                    for (final String n : s.split(","))
                      aliasNodes.add(n.trim());
                  }
                }, false)
                .addEntry("item", new Setter<String>() {
                  @Override
                  public void set(final String s) {
                    final NonNullPair<String, Integer> g = Noun.stripGender(s, "item");
                    itemGender = Noun.getGenderID(g.getSecond());
                    final NonNullPair<String, String> p = Noun.getPlural(g.getFirst());
                    itemSingular = "" + p.getFirst().toLowerCase();
                    itemPlural = "" + p.getSecond().toLowerCase();
                  }
                }, false)
                .addEntry("block", new Setter<String>() {
                  @Override
                  public void set(final String s) {
                    final NonNullPair<String, Integer> g = Noun.stripGender(s, "block");
                    blockGender = Noun.getGenderID(g.getSecond());
                    final NonNullPair<String, String> p = Noun.getPlural(g.getFirst());
                    blockSingular = "" + p.getFirst().toLowerCase();
                    blockPlural = "" + p.getSecond().toLowerCase();
                  }
                }, false)
                .setAllowUndefinedSections(true));
       
        for (final Node node : aliasConfig.getMainNode()) {
          if (node instanceof SectionNode) {
            if (!aliasNodes.contains(node.getKey())) {
              Skript.error(m_invalid_section.toString(node.getKey()));
            }
          }
        }
       
        final Variations variations = new Variations();
        int num = 0;
        for (final String an : aliasNodes) {
          final Node node = aliasConfig.getMainNode().get(an);
          SkriptLogger.setNode(node);
          if (node == null) {
            Skript.error(m_section_not_found.toString(an));
            continue;
          }
View Full Code Here

Examples of code.satyagraha.gfm.support.api.Config

        Connector[] connectors = server.getConnectors();
        int port = connectors[0].getLocalPort();
        LOGGER.info("server port: " + port);

        Config config = mock(Config.class);
        String apiUrl = "http://localhost:" + port;
        given(config.getApiUrl()).willReturn(apiUrl);

        WebProxyConfig webProxyConfig = mock(WebProxyConfig.class);
        SSLSocketFactory sslSocketFactory = mock(SSLSocketFactory.class);
        ClientConnectionManager connectionManager = new ClientConnManagerDefault(sslSocketFactory);
        WebServiceClient webServiceClient = new WebServiceClientDefault(config, webProxyConfig, connectionManager);
View Full Code Here

Examples of com.acciente.induction.init.config.Config

   }

   public Config getConfig() throws ConfigLoaderException
   {
      InputStream oResourceStream = null;
      Config      oConfig;

      if ( _sResourceName == null )
      {
         throw new ConfigLoaderException( "config-load: no resource to load the config specified!" );
      }

      try
      {
         oResourceStream = _oResourceLoader.getResourceAsStream( _sResourceName );

         if ( oResourceStream == null )
         {
            throw new ConfigLoaderException( "config-load: error opening: " + _sResourceName );
         }

         // load the configuration into a new Config object
         DigesterFactory.getDigester( oConfig = new Config(), _oResourceLoader ).parse( oResourceStream );
      }
      catch ( IOException e )
      {
         throw new ConfigLoaderException( "config-load: I/O error on: " + _sResourceName, e );
      }
View Full Code Here

Examples of com.adaptrex.core.ext.data.Config

     *
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<Object> getEntityList(AdaptrexSession session, Store store) {
  Config config = store.getConfig();
  List<Object> list = new ArrayList<Object>();

  EntityManager em = (EntityManager) session.getNativeSession();

  Map<String, Object> parameters = new HashMap<String, Object>(config.getParams());

  try {
      Class<?> clazz = config.getClazz();
      String className = clazz.getSimpleName();
      String alias = className.toLowerCase().substring(0, 1);

      /*
       * Core JPQL
       */
      String jpql = "SELECT " + alias + " FROM " + className + " " + alias;

      /*
       * Where
       */
      String where = "";
      if (config.getWhere() != null) {
    where += config.getWhere();
      }

      /*
       * Filter
       */
      for (Filter filter : config.getFilters()) {
    if (!where.isEmpty()) {
        where += " AND ";
    }

    String val = String.valueOf(filter.getValue());
    String prop = filter.getProperty();


    /*
     * Handle between inclusive
     */
    if (val.contains(">=<")) {
        String[] filterParts = val.split(">=<");

        where += "(" + alias + "." + filter.getProperty() + " BETWEEN :"
          + prop + "_low AND :" + prop + "_high)"
          + "";
        parameters.put(prop + "_low", filterParts[0]);
        parameters.put(prop + "_high", filterParts[1]);

        /*
         * Handle "OR"
         */
    } else if (String.valueOf(filter.getValue()).contains("||")) {
        String whereOr = "";
        int i = 1;

        for (String orPart : String.valueOf(filter.getValue()).split("\\|\\|")) {
      whereOr += whereOr.isEmpty() ? "(" : " OR ";
      whereOr += alias + "." + filter.getProperty() + " = :" + filter.getProperty() + i;
      parameters.put(filter.getProperty() + i, orPart);
      i++;
        }
        whereOr += ")";
        where += whereOr;

    } else {
        String eqType = String.valueOf(filter.getValue()).contains("%") ? " like " : " = ";
        if (eqType.contains("like")) {
      where += "lower(" + alias + "." + filter.getProperty() + ")" + eqType + ":" + filter.getProperty();
        } else {
      where += alias + "." + filter.getProperty() + eqType + ":" + filter.getProperty();
        }

        parameters.put(filter.getProperty(), filter.getValue());
    }
      }


      /*
       * Add where clause
       */
      if (!where.isEmpty()) {
    jpql += " WHERE " + where;
      }


      if (config.getSorters().size() > 0) {
    String sortClause = "";
    for (Sorter sorter : config.getSorters()) {
        if (!sortClause.isEmpty()) {
      sortClause += ",";
        }
        sortClause += alias + "." + sorter.getProperty() + " " + sorter.getDirection();
    }
    jpql += " ORDER BY " + sortClause;
      }

      log.debug("JPQL: " + jpql);
      Query q = em.createQuery(jpql, clazz);

      /*
       * Add params
       * TODO: This is tedius... we want to automatically determine the
       * type for the field we're trying to set the parameter for
       */
      for (String key : parameters.keySet()) {
    Object paramObj = parameters.get(key);

    Class<?> paramType = q.getParameter(key).getParameterType();
    String typeName = paramType.getSimpleName().toLowerCase();

    try {
        if (typeName.equals("boolean")) {
      String stringVal = (String) paramObj;
      paramObj = stringVal.equals("1") || stringVal.equals("true") || stringVal.equals("Y");

        } else if (typeName.equals("date")) {
      paramObj = dateFormat.parse((String) paramObj);

        } else {
      Method m = paramType.getDeclaredMethod("valueOf", String.class);
      paramObj = m.invoke(null, paramObj);
        }
    } catch (Exception e) {
    }

    log.debug("  Param: " + key + " = " + paramObj);
    q.setParameter(key, paramObj);
      }

      store.setTotalCount(q.getResultList().size());

      if (config.getPageSize() != null) {
    q.setMaxResults(config.getPageSize());
      }
      if (config.getStart() != null) {
    q.setFirstResult(config.getStart());
      }
      list = q.getResultList();
  } catch (Exception e) {
      log.warn("Error", e);
  }
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.