Examples of Config


Examples of org.jruby.management.Config

        this.kcode              = config.getKCode();
        this.beanManager        = new BeanManager(this, config.isManagementEnabled());
        this.jitCompiler        = new JITCompiler(this);
        this.parserStats        = new ParserStats(this);
       
        this.beanManager.register(new Config(this));
        this.beanManager.register(parserStats);
        this.beanManager.register(new ClassCache(this));
    }
View Full Code Here

Examples of org.jtestserver.client.Config

import org.junit.Before;

public class TestJVM extends TestVmManager<JVMConfig> {
    @Before
    public void setUp() throws IOException {
        Config config = new CustomConfigReader(ConfigReader.JVM_TYPE).read(AllTests.CONFIG_DIRECTORY);
        this.config = (JVMConfig) config.getVMConfig();
        vmManager = new JVM();
    }
View Full Code Here

Examples of org.kohsuke.args4j.Config

        parse(new InputSource(xml.toExternalForm()),parser,bean);
    }

  public void parse(InputSource xml, CmdLineParser parser, Object bean) {
    try {
      Config config = Config.parse(xml);
      for(Config.ConfigElement ce : config.options) {
        Option option = new OptionImpl(ce);
                parser.addOption(Setters.create(parser, findMethodOrField(bean, ce.field, ce.method),bean), option);
      }
      for (Config.ConfigElement ce : config.arguments) {
View Full Code Here

Examples of org.kuali.rice.core.api.config.property.Config

    DictionaryValidationResult dictionaryValidationResult = new DictionaryValidationResult();
    dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);

    ValidCharactersConstraintProcessor processor = new ValidCharactersConstraintProcessor();
    // setup mocks
    Config config = mock(Config.class);
    final String dtFormat = "dd MMM yyyy hh:mm a";
    when(config.getProperty(CoreConstants.STRING_TO_DATE_FORMATS))
        .thenReturn(dtFormat);
    ConfigContext.overrideConfig(Thread.currentThread()
        .getContextClassLoader(), config);
    DateTimeService dtSvc = mock(DateTimeService.class);
    SimpleDateFormat sdf = new SimpleDateFormat(dtFormat);
View Full Code Here

Examples of org.magicbox.repository.Config

    public DbUnit() {
    }

    public static IDatabaseConnection setUpConnection() {
        Config config = new Config();
        System.out.println("DbUnit setUpConnection");
        if (dbConn == null) {
            Connection jdbcConnection = null;
            try {
                // Class.forName(config.getDbDriver());
                Class.forName(config.getDbDriverProduction());
                // Class.forName(config.getDbDriverDebug());
                jdbcConnection = DriverManager.getConnection(config.getDbUrl(), config.getDbUser(), config.getDbPass());

            } catch (ClassNotFoundException e) {
                e.printStackTrace();

            } catch (SQLException e) {
View Full Code Here

Examples of org.meb.speedway.model.common.Config

  public String importEventSources() {
    SimpleDateFormat eventDateFmt = new SimpleDateFormat(Patterns.DATE_LONG);
    SimpleDateFormat eventDateFmtR = new SimpleDateFormat(Patterns.DATE_LONG_R);
    SimpleDateFormat updateDateFmt = new SimpleDateFormat(Patterns.TIMESTAMP_R);
    SimpleDateFormat filterFmt = new SimpleDateFormat("yyyyMMddHHmm");
    Config markDateConfig = em.find(Config.class, "evtsrc.read.date");
    Date markDate = markDateConfig.getDate();
    Date maxUpdateDate = markDate;

    StringBuilder log = new StringBuilder();
    String url = "http://spdwldr00.appspot.com/event/list?f=" + filterFmt.format(markDate);
    Document doc = null;
    try {
      doc = Jsoup.connect(url).get();
    } catch (IOException e) {
      log.append("[ERROR]: unable to connect to: ").append(url).append(": ")
          .append(e.getMessage()).append("\n");
      return log.toString();
    }

    int persisted = 0;
    int merged = 0;
    int skipped = 0;
    int errors = 0;
    BaseDao<IntEvent> dao = daoResolver.resolve(IntEvent.class);
    Elements trs = doc.select("tbody tr");
    for (int i = 0; i < 1; i++) {
      Element tr = trs.get(i);
      Elements tds = tr.select("td");

      String eventUri = tds.get(6).text();
      if (StringUtils.isNotBlank(eventUri)) {
        eventUri = eventUri.trim();
      } else {
        log.append("[ERROR]: event uri is blank").append("\n");
        errors++;
        continue;
      }

      // create new task to be persisted/merged
      Date operDate = new Date();
      IntEvent intEvent = new IntEvent();
      intEvent.setStatus(IntEvent.Status.REGISTERED);
      intEvent.setEventUri(eventUri);
      intEvent.getFingerprint().setInsertDate(operDate);
      intEvent.getFingerprint().setUpdateDate(operDate);
      intEvent.setEventGroup(tds.get(2).text());
      intEvent.setEventName(tds.get(3).text());
      String dateString = tds.get(4).text() + " " + tds.get(5).text();
      try {
        intEvent.setEventDate(eventDateFmt.parse(dateString));
      } catch (ParseException e) {
        log.append("[ERROR]: unable to parse date string: ").append(dateString)
            .append(": ").append(e.getMessage()).append("\n");
        errors++;
        continue;
      }

      String updateDateString = tds.get(1).text();
      try {
        Date updateDate = updateDateFmt.parse(updateDateString);
        if (updateDate.compareTo(maxUpdateDate) > 0) {
          maxUpdateDate = updateDate;
        }
      } catch (ParseException e) {
        log.append("[WARN]: unable to parse update date string: ").append(dateString)
            .append(": ").append(e.getMessage()).append("\n");
      }

      // find persistent task with matching event uri
      EventTaskQuery query = new EventTaskQuery();
      query.getEntity().setEventUri(eventUri);
      IntEvent persistent = dao.findUnique(query);
      StringBuilder detailLog = null;
      try {
        boolean changed = false;
        if (persistent == null) {
          dao.persist(intEvent);
          log.append("[INFO]: persisted: ");
          changed = true;
          persisted++;
        } else {
          CompareToBuilder cmp = new CompareToBuilder();
          cmp.append(intEvent.getEventDate(), persistent.getEventDate());
          cmp.append(intEvent.getEventGroup(), persistent.getEventGroup());
          cmp.append(intEvent.getEventName(), persistent.getEventName());
          if (cmp.toComparison() != 0) {
            Date eventDate = intEvent.getEventDate();
            String eventName = intEvent.getEventName();
            String eventGroup = intEvent.getEventGroup();
            detailLog = new StringBuilder();
            Utils.append(detailLog, "|",
                DateUtils.format(persistent.getEventDate(), eventDateFmtR, "null"),
                " --> ", DateUtils.format(eventDate, eventDateFmtR, "null"));
            Utils.append(detailLog, "|", persistent.getEventGroup(), " --> ",
                eventGroup);
            Utils.append(detailLog, "|", persistent.getEventName(), " --> ", eventName);

            persistent.setEventDate(eventDate);
            persistent.setEventGroup(eventGroup);
            persistent.setEventName(eventName);
            intEvent = dao.merge(persistent);
            log.append("[INFO]: merged: ");
            changed = true;
            merged++;
          } else {
            skipped++;
          }
        }
        if (changed) {
          log.append(eventDateFmtR.format(intEvent.getEventDate())).append(", ")
              .append(intEvent.getEventGroup()).append(", ")
              .append(intEvent.getEventName())
              .append(detailLog == null ? "" : detailLog.toString()).append("\n");
        }
      } catch (Exception e) {
        detailLog = null;
        log.append("[ERROR]: unable to persist/merge").append("\n");
        errors++;
        continue;
      }

    }
    log.append(String.format("Processed: persisted: %d, merged: %d, skipped: %d, errors: %d\n",
        persisted, merged, skipped, errors));
    markDateConfig.setDate(maxUpdateDate);
    markDateConfig = em.merge(markDateConfig);
    log.append("Updated ").append(markDateConfig.getCode()).append(" to ")
        .append(updateDateFmt.format(markDateConfig.getDate()));
    em.flush();
    throw new RuntimeException("ERROR");

    // return log.toString();
  }
View Full Code Here

Examples of org.neo4j.batchimport.utils.Config

    public static void main(String[] args) throws IOException {
        System.err.println("Usage: Importer data/dir nodes.csv relationships.csv [node_index node-index-name fulltext|exact nodes_index.csv rel_index rel-index-name fulltext|exact rels_index.csv ....]");
        System.err.println("Using: Importer "+join(args," "));
        System.err.println();

        final Config config = Config.convertArgumentsToConfig(args);

        File graphDb = new File(config.getGraphDbDirectory());
        if (graphDb.exists() && !config.keepDatabase()) {
            FileUtils.deleteRecursively(graphDb);
        }

        Importer importer = new Importer(graphDb, config);
        importer.doImport();
View Full Code Here

Examples of org.neo4j.kernel.Config

        }

        @Override
        protected Void executeInTransaction( GraphDatabaseService db, Transaction tx )
        {
            Config config = getConfig( db );
            LockManager lockManager = config.getLockManager();
            LockReleaser lockReleaser = config.getLockReleaser();
            for ( int i = 0; i < amount; i++ )
            {
                Object resource = new LockableNode( i );
                lockManager.getWriteLock( resource );
                lockReleaser.addLockToTransaction( resource, LockType.WRITE );
View Full Code Here

Examples of org.neo4j.kernel.configuration.Config

        Map<String, String> params = getDefaultParams();
        params.put( GraphDatabaseSettings.use_memory_mapped_buffers.name(), Settings.FALSE );
        params.put( InternalAbstractGraphDatabase.Configuration.store_dir.name(), storeDir );
        params.putAll( stringParams );

        Config config = new Config( params, GraphDatabaseSettings.class );
        boolean dump = config.get( GraphDatabaseSettings.dump_configuration );
        this.idGeneratorFactory = new DefaultIdGeneratorFactory();

        StoreFactory sf = new StoreFactory( config, idGeneratorFactory, new DefaultWindowPoolFactory(), fileSystem,
                StringLogger.DEV_NULL, null );
View Full Code Here

Examples of org.neo4j.shell.tools.imp.util.Config

    private String doExport(ProgressReporter reporter, boolean types) throws IOException, XMLStreamException {
        try (Transaction tx = db.beginTx()) {
            StringWriter writer = new StringWriter();
            XmlGraphMLWriter xmlGraphMLWriter = new XmlGraphMLWriter();
            Config config = Config.config();
            xmlGraphMLWriter.write(new DatabaseSubGraph(db), writer, reporter, types ? config.withTypes() : config);
            tx.success();
            return writer.toString().trim();
        }
    }
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.