当前位置: 首页>>代码示例>>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;未经允许,请勿转载。