當前位置: 首頁>>代碼示例>>Java>>正文


Java SBuildFeatureDescriptor類代碼示例

本文整理匯總了Java中jetbrains.buildServer.serverSide.SBuildFeatureDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java SBuildFeatureDescriptor類的具體用法?Java SBuildFeatureDescriptor怎麽用?Java SBuildFeatureDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SBuildFeatureDescriptor類屬於jetbrains.buildServer.serverSide包,在下文中一共展示了SBuildFeatureDescriptor類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fillModel

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
@Override
protected void fillModel(@NotNull Map<String, Object> map,
                         @NotNull HttpServletRequest httpServletRequest,
                         @NotNull SBuildType sBuildType,
                         @NotNull SUser sUser) {

    /*
     * We need to send two things to the tab:
     * 1) the list of historical builds
     * 2) the parameters of the SinCity feature (if enabled)
     */
    List<FinishedBuildWithChanges> buildsWithChanges = FinishedBuildWithChanges.getListFromBuildType(sBuildType);
    map.put("buildsWithChanges", buildsWithChanges);

    SBuildFeatureDescriptor sinCityFeature = SinCityBuildFeature.getSinCityFeature(sBuildType);
    map.put("sinCityParameters", sinCityFeature == null ? null : sinCityFeature.getParameters());
}
 
開發者ID:sferencik,項目名稱:SinCity,代碼行數:18,代碼來源:ManualTriggerTab.java

示例2: handleBuildFinished

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
protected void handleBuildFinished(SRunningBuild build) {
    final SBuildType bt = build.getBuildType();
    if (bt == null) {
        return;
    }

    for (SBuildFeatureDescriptor feature : bt.getBuildFeatures()) {
        if (getType().equalsIgnoreCase(feature.getType())) {
            handleBuildFinished(build, feature);
            break;
        }
    }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:appengine-tck,代碼行數:14,代碼來源:ReportsFeature.java

示例3: main

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
public static void main(String[] args) {
    ReportsDescriptor descriptor = new ReportsDescriptorMock();
    ReportsConstants constants = new ReportsConstants();
    ReportsFeature feature = new ReportsFeature(null, descriptor, constants);
    SRunningBuild build = new SRunningBuildMock();
    SBuildFeatureDescriptor fd = new SBuildFeatureDescriptorMock();

    feature.handleTokens(PARAMS);
    feature.handleBuildFinished(build, fd);
}
 
開發者ID:GoogleCloudPlatform,項目名稱:appengine-tck,代碼行數:11,代碼來源:ReportsMain.java

示例4: storeBuildNumberInSauce

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
/**
 * Invokes the Sauce REST API to store the TeamCity build number and pass/fail status within
 * Sauce.
 * @param build
 * @param sessionId
 */
private void storeBuildNumberInSauce(SRunningBuild build, String sessionId) {
    Collection<SBuildFeatureDescriptor> features = build.getBuildType().getBuildFeatures();
    if (features.isEmpty()) return;
    for (SBuildFeatureDescriptor feature : features) {
        if (feature.getType().equals("sauce")) {
            SauceREST sauceREST = new SauceREST(getUsername(feature), getAccessKey(feature));
            Map<String, Object> updates = new HashMap<String, Object>();
            try {
                String json = sauceREST.getJobInfo(sessionId);
                JSONObject jsonObject = (JSONObject) new JSONParser().parse(json);
                String buildNumber = build.getBuildTypeExternalId() + build.getBuildNumber();
                logger.info("Setting build number " + buildNumber + " for job " + sessionId + " user: " + getUsername(feature));
                updates.put("build", buildNumber);
                if (jsonObject.get("passed") == null || jsonObject.get("passed").equals("")) {
                    if (build.getStatusDescriptor().getStatus().isSuccessful()) {
                        updates.put("passed", Boolean.TRUE.toString());
                    } else if (build.getStatusDescriptor().getStatus().isFailed()) {
                        updates.put("passed", Boolean.FALSE.toString());
                    }
                }

                sauceREST.updateJobInfo(sessionId, updates);
            } catch (org.json.simple.parser.ParseException e) {
                logger.error("Failed to parse JSON for session id: " + sessionId + " user: " + getUsername(feature), e);
            }
        }
    }
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:35,代碼來源:SauceServerAdapter.java

示例5: getSauceBuildFeature

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
/**
 * Returns the Sauce-specific {@link SBuildFeatureDescriptor} instance.
 *
 * @param build
 * @return
 */
private SBuildFeatureDescriptor getSauceBuildFeature(SBuild build) {
    Collection<SBuildFeatureDescriptor> features = build.getBuildType().getBuildFeatures();
    if (features.isEmpty()) return null;
    for (SBuildFeatureDescriptor feature : features) {
        if (feature.getType().equals("sauce")) {
            return feature;
        }

    }
    return null;
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:18,代碼來源:SauceBuildResultsTab.java

示例6: isAvailableFor

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
/**
 * @param build
 * @return true if sauce is configured
 */
@Override
protected boolean isAvailableFor(@NotNull SBuild build) {
    SBuildFeatureDescriptor sauceBuildFeature = getSauceBuildFeature(build);
    if (sauceBuildFeature == null) {
        return false;
    }
    if (sauceBuildFeature.getParameters().containsKey(Constants.DISABLE_RESULTS_KEY)
            && sauceBuildFeature.getParameters().get(Constants.DISABLE_RESULTS_KEY).equals("true")) {
        return false;
    }

    return super.isAvailableFor(build); //should return true
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:18,代碼來源:SauceBuildResultsTab.java

示例7: getBuildFeaturesOfType

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
@NotNull
@Override
public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String s) {
    return null;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:appengine-tck,代碼行數:6,代碼來源:ReportsMain.java

示例8: getAccessKey

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
private String getAccessKey(SBuildFeatureDescriptor feature) {
    return feature.getParameters().get(Constants.SAUCE_PLUGIN_ACCESS_KEY);
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:4,代碼來源:SauceServerAdapter.java

示例9: getUsername

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
private String getUsername(SBuildFeatureDescriptor feature) {
    return feature.getParameters().get(Constants.SAUCE_USER_ID_KEY);
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:4,代碼來源:SauceServerAdapter.java

示例10: retrieveJobIdsFromSauce

import jetbrains.buildServer.serverSide.SBuildFeatureDescriptor; //導入依賴的package包/類
/**
 * Retrieve the list of Sauce jobs recorded against the TeamCity build.
 *
 * @param build
 * @return
 * @throws IOException
 * @throws JSONException
 * @throws InvalidKeyException
 * @throws NoSuchAlgorithmException
 */
public List<JobInformation> retrieveJobIdsFromSauce(SBuild build) throws IOException, JSONException, InvalidKeyException, NoSuchAlgorithmException {
    //invoke Sauce Rest API to find plan results with those values
    List<JobInformation> jobInformation = new ArrayList<JobInformation>();

    SBuildFeatureDescriptor sauceBuildFeature = getSauceBuildFeature(build);
    if (sauceBuildFeature == null) {
        return null;
    }
    String username = sauceBuildFeature.getParameters().get(Constants.SAUCE_USER_ID_KEY);
    String accessKey = sauceBuildFeature.getParameters().get(Constants.SAUCE_PLUGIN_ACCESS_KEY);
    String buildNumber = build.getBuildTypeExternalId() + build.getBuildNumber();
    SauceREST sauceREST = new SauceREST(username, accessKey);
    logger.info("Retrieving Sauce jobs for " + buildNumber + " user: " + username);
    String jsonResponse = sauceREST.retrieveResults(new URL(String.format(JOB_DETAILS_URL, username, buildNumber)));
    JSONObject job = new JSONObject(jsonResponse);
    JSONArray jobResults = job.getJSONArray("jobs");
    if (jobResults.length() == 0) {
        //try query using the build number
        logger.info("Retrieving Sauce jobs for " + build.getBuildNumber() + " user: " + username);
        jsonResponse = sauceREST.retrieveResults(new URL(String.format(JOB_DETAILS_URL, username, build.getBuildNumber())));
        job = new JSONObject(jsonResponse);
        jobResults = job.getJSONArray("jobs");
    }

    for (int i = 0; i < jobResults.length(); i++) {
        //check custom data to find job that was for build
        JSONObject jobData = jobResults.getJSONObject(i);
        String jobId = jobData.getString("id");
        JobInformation information = new JobInformation(jobId, calcHMAC(username, accessKey, jobId));
        String status = jobData.getString("passed");
        if (status.equals("null")) {
            status = "not set";
        }
        information.setStatus(status);
        information.setName(jobData.getString("name"));
        jobInformation.add(information);
    }
    //the list of results retrieved from the Sauce REST API is last-first, so reverse the list
    Collections.reverse(jobInformation);
    return jobInformation;
}
 
開發者ID:rossrowe,項目名稱:sauce-teamcity-plugin,代碼行數:52,代碼來源:SauceBuildResultsTab.java


注:本文中的jetbrains.buildServer.serverSide.SBuildFeatureDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。