Package com.sun.faban.harness.common

Examples of com.sun.faban.harness.common.RunId


            String runIdS = runDir.getName();
            try {
                if (!AccessController.isViewAllowed(user, runIdS) || runIdS.contains("analysis")) {
                    continue;
                }
                RunId runId = new RunId(runIdS);
                RunResult result = getInstance0(runId);
                if (result == null) {
                    continue;
                }
                runs.add(result);
View Full Code Here


     * Deletes a certain run.
     * @param RunId of run run to delete
     * @return true if delete succeeds, false otherwise
     */
    public boolean delete(String runIdStr) {
        RunId runId = new RunId(runIdStr);
        File f = runId.getResultDir();
        if (f.isDirectory()) {
            return(FileHelper.recursiveDelete(f));
        }
        return(true);
    }
View Full Code Here

        Set<String> runIds = tagEngine.search(tags);
        Double achievedMetric = 0.0;
        String achievedMetricUnit = " ";
        for (String runid : runIds) {
            try {
                RunId runId = new RunId(runid);
                RunResult res = getInstance(runId);
                if (res != null && achievedMetric < res.metric.value){
                    achievedMetric = res.metric.value;
                    achievedMetricUnit = res.metricUnit;
                }
View Full Code Here

        for (File runDir : dirs) {
            if (!runDir.isDirectory())
                continue;
            String runIdS = runDir.getName();
            try {
                RunId runId = new RunId(runIdS);
                if (!AccessController.isViewAllowed(user, runIdS))
                    continue;
                result0 = getInstance0(runId);
                FeedRecord feedRecord = new FeedRecord(runId, result0);
                feedList.add(feedRecord);
View Full Code Here

                                new ArrayList<FeedRecord>(runIds.size());
        RunResult res = null;
        boolean runRemoved = false;
        for (String runid : runIds) {
            try {
                RunId runId = new RunId(runid);
                if (!AccessController.isViewAllowed(user, runid))
                    continue;
                res = getInstance(runId);
                if (res == null){
                    tagEngine.removeRun(runid);
View Full Code Here

        RunId[] runIds = new RunId[runIdStrings.length];
        String benchName = null;
        String hostName = null;
        for (int i = 0; i < runIdStrings.length; i++) {
            RunId runId = new RunId(runIdStrings[i]);
            benchName = runId.getBenchName();
            hostName = runId.getHostName();
            benchNameSet.add(benchName);
            hostNameSet.add(hostName);
            runIds[i] = runId;
        }

        if (benchNameSet.size() == 1) {
            suggestion.append('-').append(benchName);
            if (hostNameSet.size() == 1) {
                if (hostName.length() > 0)
                    suggestion.append('-').append(hostName);
                for (RunId runId : runIds)
                    suggestion.append('_').append(runId.getRunSeq());
            } else {
                for (RunId runId : runIds) {
                    suggestion.append('_');
                    hostName = runId.getHostName();
                    if (hostName.length() > 0)
                        suggestion.append(hostName).append('.');
                    suggestion.append(runId.getRunSeq());
                }
            }
        } else {
            for (RunId runId : runIds)
                suggestion.append('_').append(runId);
View Full Code Here

            }
            return status[1];
        }

        private String getNextRunId(String runId) {
            RunId current = new RunId(runId);
            String seq = current.getRunSeq(); // Say "1A1"
            int i = 0;
            for (; i < seq.length(); i++) {
                if (Character.isLetter(seq.charAt(i)))
                    break;
            } // i now points to 'A'
            String origSeq = seq.substring(0, i + 1); // origSeq = "1A"
            String cDup = seq.substring(i + 1);       // cDup = "1"
            String nDup = null;
            if (cDup.length() == 0) {
                nDup = "0";
            } else {
                int x = Integer.parseInt(cDup, 16)// x = (int) 1
                nDup = Integer.toHexString(++x).toUpperCase(); // nDup - "2"
            }
            RunId next = new RunId(current.getHostName(),
                    current.getBenchName(), origSeq + nDup);
            return next.toString();
        }
View Full Code Here

         */
        public void updateTagsFile(HttpServletRequest req,
            HttpServletResponse resp) throws IOException{
            String tags = req.getParameter("tags");
            String runId = req.getParameter("runId");
            RunResult result = RunResult.getInstance(new RunId(runId));
            StringBuilder formattedTags = new StringBuilder();
            File runTagFile = new File(Config.OUT_DIR + runId + "/META-INF/tags");
            if (tags != null && !"".equals(tags)) {
                StringTokenizer t = new StringTokenizer(tags," \n,");
                ArrayList<String> tagList = new ArrayList<String>(t.countTokens());
View Full Code Here

         * @throws java.io.IOException
         */
        public void updateRunDesc(HttpServletRequest req,
            HttpServletResponse resp) throws IOException{
            String runId = req.getParameter("runId");
            RunResult result = RunResult.getInstance(new RunId(runId));
            result.description = req.getParameter("desc");
            ResultAction.editXML(result);
            Writer w = resp.getWriter();
            w.write("Tags updating completed");
            w.flush();
View Full Code Here

                                    HttpServletResponse.SC_NOT_ACCEPTABLE,
                                    "Origin file does not exist!");
                            break;
                        }

                        RunId origRun;
                        try {
                            origRun = new RunId(
                                    readStringFromFile(originFile).trim());
                        } catch (IndexOutOfBoundsException e) {
                            response.sendError(
                                    HttpServletResponse.SC_NOT_ACCEPTABLE,
                                    "Origin file error. " + e.getMessage());
                            break;
                        }

                        runId = origRun.getBenchName() + '.' +
                                                           origRun.getRunSeq();
                        String localHost = origRun.getHostName();
                        if (!localHost.equals(Config.FABAN_HOST)) {
                            logger.warning("Origin upload requested. Origin " +
                            "host" + localHost + " does not match this host " +
                                           Config.FABAN_HOST + '!');
                            response.sendError(
View Full Code Here

TOP

Related Classes of com.sun.faban.harness.common.RunId

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.