Package org.moxie.maxml

Examples of org.moxie.maxml.MaxmlMap


    // define the test class fileset
    unitTests = new FileSet();
    unitTests.setProject(getProject());
    unitTests.setDir(testClassesDirectory);

    MaxmlMap attributes = config.getTaskAttributes(getTaskName());
    failureProperty = attributes.getString("failureProperty", "unit.test.failed");
    failOnError = attributes.getBoolean("failOnError", false);
    unitTests.createInclude().setName(attributes.getString("include", "**/*Test.class"));

    // classpath for tests
    // instrumented classes, unit test classes, and unit test libraries
    unitTestClasspath = new Path(getProject());
    unitTestClasspath.createPathElement().setPath(instrumentedBuild.getAbsolutePath());
View Full Code Here


    task.init();
   
    task.setDataFile(mxtest.getCoberturaData().getAbsolutePath());
    task.setDestDir(mxtest.getCoverageReports());
   
    MaxmlMap attributes = mxtest.getBuild().getConfig().getTaskAttributes("cobertura");
    if (attributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), task, attributes);
    }

    Path path = new Path(mxtest.getProject());
View Full Code Here

    instr.setTaskName("instr");
    instr.setProject(mxtest.getProject());
    instr.setMetadatafile(mxtest.getEmmaData());
    instr.setDestdir(mxtest.getInstrumentedBuild());
    instr.createInstrpath().setLocation(mxtest.getClassesDir());
    MaxmlMap instrAttributes = mxtest.getBuild().getConfig().getTaskAttributes("emma");
    if (instrAttributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), instr, instrAttributes);
    }
   
    emma.execute();
View Full Code Here

    reportTask report = (reportTask) emma.createReport();
    report.setTaskName("report");
    report.setProject(mxtest.getProject());
    report.init();

    MaxmlMap reportAttributes = mxtest.getBuild().getConfig().getTaskAttributes("emmareport");
    if (reportAttributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), report, reportAttributes);
    }

    report.setSourcepathRef(new Reference(mxtest.getProject(), Key.compileSourcePath.referenceId()));
View Full Code Here

    formatter.setProject(mxtest.getProject());
    formatter.setType(xml);
    junit.addFormatter(formatter);

    // configure properties from Moxie file
    MaxmlMap testAttributes = mxtest.getBuild().getConfig().getTaskAttributes("junit");
    if (testAttributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), junit, testAttributes);
    }

    junit.execute();

    XMLResultAggregator junitReport = new XMLResultAggregator();
    junitReport.setTaskName("test");
    junitReport.setProject(mxtest.getProject());
    junitReport.init();
       
    FileSet fileSet = new FileSet();
    fileSet.setProject(mxtest.getProject());
    fileSet.setDir(mxtest.getUnitTestOutputDir());
    fileSet.setIncludes("TEST-*.xml");    
    junitReport.addFileSet(fileSet);
   
    AggregateTransformer report = junitReport.createReport();
    // configure properties from Moxie file
    MaxmlMap reportAttributes = mxtest.getBuild().getConfig().getTaskAttributes("junitreport");
    if (reportAttributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), report, reportAttributes);
    }
    report.setTodir(mxtest.getTestReports());
   
View Full Code Here

      for (Template template : page.templates) {
        File data = new File(template.data);
        if (!data.exists()) {
          data = new File(doc.sourceDirectory, template.data);
        }
        MaxmlMap dataMap = Maxml.parse(data);
       
        // populate map with build properties by splitting them into maps
        for (Substitute sub : doc.substitutions) {
          if (sub.isProperty()) {
            String prop = sub.getPropertyName();
            MaxmlMap keyMap = dataMap;
            // recursively create/find the destination map
            while (prop.indexOf('.') > -1) {
              String m = prop.substring(0, prop.indexOf('.'));
              if (!keyMap.containsKey(m)) {
                keyMap.put(m, new MaxmlMap());
              }
              keyMap = keyMap.getMap(m);
              prop = prop.substring(m.length() + 1);
            }
           
            // inject property into map
            keyMap.put(prop, sub.value);
          }
        }
       
        // load and process the Freemarker template
        freemarker.template.Template ftl = fm.getTemplate(template.src);
View Full Code Here

    if (lastModified != configLastModified) {
      log.info((isLoaded ? "reloading" : "loading") + " config from " + configFile.getAbsolutePath());
      configLastModified = lastModified;

      try {
        MaxmlMap map = Maxml.parse(configFile);
        if (!isLoaded) {
          // only read these settings on a cold start
          httpPort = map.getInt("httpPort", httpPort);
          httpsPort = map.getInt("httpsPort", httpPort);
          proxyPort = map.getInt("proxyPort", proxyPort);
          shutdownPort = map.getInt("shutdownPort", shutdownPort);
          bindAddresses = map.getStrings("bindAddresses", bindAddresses);
          keystorePassword = map.getString("keystorePassword", keystorePassword);
          userAgent = map.getString("userAgent", userAgent);
          moxieRoot = new File(map.getString("rootFolder", "moxie"));
          setMoxieRoot(moxieRoot);
          localRepositories = map.getStrings("localRepositories", localRepositories);
          remoteRepositories = parseRemoteRepositories(map);
          for (RemoteRepository repository : remoteRepositories) {
            remoteRepositoryLookup.put(repository.id, repository);
            remoteRepositoryLookup.put(StringUtils.urlToFolder(repository.url), repository);
          }
         
          // do not reload these immutable settings
          isLoaded = true;
        }
        proxies = parseProxies(map);
        dateFormat = map.getString("dateFormat", dateFormat);
        redirects = parseRedirects(map);
        allowDeny = parseAllowDeny(map);
        atomCount = map.getInt("atomCount", atomCount);
        searchCount = map.getInt("searchCount", searchCount);
      } catch (Exception e) {
        log.log(Level.SEVERE, "failed to parse " + configFile, e);
      }
    }
  }
View Full Code Here

   * Configure the javac task from the mxjavac attributes
   * @param build
   */
  private void configure(Build build) {
    configured = true;
    MaxmlMap attributes = build.getConfig().getTaskAttributes(getTaskName());
    if (attributes == null) {
      build.getConsole().error(getTaskName() + " attributes are null!");
      return;
    }
    // clone the original attributes because we remove the compiler args
    attributes = DeepCopier.copy(attributes);
    Object args = attributes.remove(Key.compilerArgs.name());

    AttributeReflector.setAttributes(getProject(), this, attributes);

    if (args != null) {
      // set the compiler args, if any
View Full Code Here

    }

    console.debug("mxjavac configuration");

    // display specified mxjavac attributes
    MaxmlMap attributes = build.getConfig().getTaskAttributes(getTaskName());
    AttributeReflector.logAttributes(this, attributes, console);

    // project folder
    console.debug(1, "projectdir = {0}", build.getConfig().getProjectDirectory());
View Full Code Here

  List<RemoteRepository> parseRemoteRepositories(MaxmlMap map) {
    List<RemoteRepository> remotes = new ArrayList<RemoteRepository>();
    if (map.containsKey("remoteRepositories")) {
      for (Object o : map.getList("remoteRepositories", Collections.emptyList())) {
        MaxmlMap repoMap = (MaxmlMap) o;
        String id = repoMap.getString("id", null);
        String url = repoMap.getString("url", null);
        boolean allowSnapshots = repoMap.getBoolean("allowSnapshots", false);
        RemoteRepository repo = new RemoteRepository(id, url, allowSnapshots);
        repo.connectTimeout = repoMap.getInt("connectTimeout", repo.connectTimeout);
        repo.readTimeout = repoMap.getInt("readTimeout", repo.readTimeout);
        repo.username = repoMap.getString("username", null);
        repo.password = repoMap.getString("password", null);
        remotes.add(repo);
      }
    }
    return remotes;
  }
View Full Code Here

TOP

Related Classes of org.moxie.maxml.MaxmlMap

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.