TFS Java SDK使用指南

TFS JavaAPI源码(附带JUinit测试用例) 在使用TFS时,淘宝所提供的javaAPI部分代码集成了tair的功能,如果不想使用tair可通过修改代码,将其功能注释掉,附件提供了注释之后的源码和TFS调用的单元测试用例 立即下载

【2018.3.6 更新】

最新版本的TFS Java SDK(14.123.1)支持Java SDK 1.6版本,可以从Oracle的官方网站(http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html)下载。

【2017.5.17 更新】

当在Eclipse中使用Java SDK调试代码的时候,你可能会碰到下面的错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Ljava/lang/String;)Ljava/lang/String;

你还需要在Java项目的属性设置中指定正确的本地库路径(Native Library Path),如下图:

image

--------------

【2015.12.2 更新】

在这里发布了一篇新的文章“使用Team Explorer Everywhere (TEE) 2015 SDK获取团队项目的签入策略”  http://www.cnblogs.com/danzhang/p/5014547.html

使用微软提供的TFS 2012 SDK for JAVA, 可以方便地在JAVA程序中实现TFS的工作项管理、源代码签入签出和生成管理等。

下面就从零开始,演示如何使用Eclipse实现JAVA程序调用TFS API,实现TFS的基本的操作。

一、下载必要的软件

    - Eclipse安装程序 http://www.eclipse.org/ 

    - JDK http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

二、创建Java项目,并导入TFS SDK

image

image

image

在Java项目中创建目录tfssdk,并将SDK中的文件复制到该目录下;将SDK中的文档做成zip文档,并复制到tfssdk目录下(tfs-sdk-11.0-javadoc.zip)

image

打开项目属性

image

添加JAR,并配置库位置和文档位置

image

三、创建并运行样例代码

添加一个样例代码:创建要求工作项

image

package com.mycompany.tfsdemo;

import com.microsoft.tfs.core.TFSTeamProjectCollection;
import com.microsoft.tfs.core.clients.workitem.CoreFieldReferenceNames;
import com.microsoft.tfs.core.clients.workitem.WorkItem;
import com.microsoft.tfs.core.clients.workitem.files.Attachment;
import com.microsoft.tfs.core.clients.workitem.files.Attachment;
import com.microsoft.tfs.core.clients.workitem.project.Project;
import com.microsoft.tfs.core.clients.workitem.wittype.WorkItemType;

public class CreateWorkItem
{
    public static void main(final String[] args)
    {
        //Attachment att1;
        //att1 = new Attachment("","");
        TFSTeamProjectCollection tpc = SnippetSettings.connectToTFS();

        Project project = tpc.getWorkItemClient().getProjects().get(SnippetSettings.PROJECT_NAME);

        // Find the work item type matching the specified name.
        WorkItemType RequirementWorkItemType = project.getWorkItemTypes().get("要求");

        // Create a new work item of the specified type.
        WorkItem newWorkItem = project.getWorkItemClient().newWorkItem(RequirementWorkItemType);

        // Set the title on the work item.
        newWorkItem.setTitle("Example Work Item");


        // Add a comment as part of the change
        newWorkItem.getFields().getField(CoreFieldReferenceNames.HISTORY).setValue(
            "<p>Created automatically by a sample</p>");

        // Save the new work item to the server.
        //TODO: add attachments while creating new work item
        //newWorkItem.getAttachments().add(att1);
        newWorkItem.save();

       
        System.out.println("Work item " + newWorkItem.getID() + " successfully created");
    }
}

运行代码,成功

image

http://www.cnblogs.com/danzhang/  ALM MVP 张洪君

微软tfs sdk + 说明文档 立即下载

相关推荐

Drugbank XML文件解析

DrugBank Release Version 5.1.13 | DrugBank Online点击download下载XML文件,也可以使用COMMAND命令下载。(下载文件需要先注册一个账号文件,就可以下载了)下载好压缩文件,并解压会得到如下两个文件:full database.xml就是我们所需要的XML文件,完整的XML很大,大约为1.6G因为原始的文件非常大,直接查看XML文件是有困难的,所以我们使用一下命令来查看该文件的前一百行 得到如下输出 对于前三行 第一行:表示XML 版本为 1.0

qtjbzs的博客 601

tfs java client_TFS Java SDK使用指南

package com.mycompany.tfsdemo;import com.microsoft.tfs.core.TFSTeamProjectCollection;import com.microsoft.tfs.core.clients.workitem.CoreFieldReferenceNames;import com.microsoft.tfs.core.clients.workit...

weixin_35679813的博客 328

STM32测测速---编码电机读取速度的计算

速度计算:轮胎每转一圈的脉冲数取决于编码器的分辨率,可由下面公式进行计算:PPR是电机的线数最后可以计算轮胎每转一圈的脉冲数为:轮胎每转一圈的脉冲数 = 9.6 × 11 × 4 = 422.4最后的速度公式简化为:速度 = (0.01 秒内产生的脉冲数 ∗ 0.055 ∗ π )/(0.01 ∗422.4​。

weixin_69414084的博客 3821

使用Team Explorer Everywhere (TEE) 2015 SDK获取团队项目的签入策略

TFS的代码签入策略与IDE工具紧密相关,例如Visual Studio中设置的签入策略,只会影响Visual Studio的团队资源管理器;如果需要在Eclipse的TEE中启用签入策略,你还需要在TEE中单独设置。(不仅如此,在数据存储上,二者也不一样,通过查询数控,我们发现TEE的签入策略存储在Collection数据库的表tbl_PropertyValue中,VS则不是)。 如果需要统...

Azure DevOps Server(原名TFS) 264

全球最大光伏电池缺陷异常检测数据集PVELAD【发布】

下载地址 1:GitHub - binyisu/PVEL-AD 下载地址 2:http://aihebut.com/col.jsp?id=118 下载地址 3:NAVEDownload 竞赛测试系统:Photovoltaic cell anomaly detection | Kaggle 一、简介 PVEL-AD 数据集又叫做EL2021数据集是用于对光伏电池异常缺陷检测方法进行基准测试的数据集,重点是光伏电池工业检测。PVEL-AD包含 36,543 张具有各种内部缺陷和异构背...

苏打水的杯子的博客 2万+

Fluent求解器——湍流参数的设置

Fluent湍流参数的介绍和设置。

Ronko_G的博客 4万+

tfs java_Java SDK for TFS

Java SDK for TFS05/19/20112 分钟可看完本文内容So you don’t use Visual Studio as your main IDE and instead use Eclipse with Team Explorer Everywhere but want to tailor TFS to suite your (and/or your teams) need...

weixin_33967069的博客 251

ubuntu安装hodoop详细步骤

进入到Ubuntu系统中打开桌面,点击鼠标右键打开终端,在终端中输入如下命令这样就可以创建一名为hadoop的新用户。给用户输设置密码输入,输入如下命令,设置密码,按提示输入两次然后为hadoop用户增加管理员全新,这样就可以方便部署完成之后输入重启命令,重启一下Ubuntu系统,然后登录到我们创建的hadoop用户上面reboot。

2301_77603488的博客 9203

com.microsoft.tfs.sdk-11.0.0运行报错nativeGetEnvironmentVariable(Ljava/lang/String;)Ljava/lang/String

If you are using the TFS 2012 Java API it is important you read the release notes. It is not enough to just reference the com.microsoft.tfs.sdk-11.0.0.jar file in your classpath as you might expect.

zeko075的专栏 1337

用Python实现一个简单的远程桌面服务端和客户端

本文介绍了一个基于Python的轻量级远程桌面解决方案,针对商业软件在嵌入式系统上的兼容性问题、性能问题和成本问题。系统采用客户端-服务端架构,包含两个通信通道:5000端口传输压缩视频流,5001端口传输控制事件。通过多线程设计、图像压缩(JPEG+zlib)和网络优化(禁用Nagle算法)等技术手段提高性能。服务端实现了高效的屏幕捕获(使用mss库)、图像处理流水线和事件处理逻辑。客户端采用PyQt5构建UI界面,包含视频接收线程以减少主线程负担。该方案具有跨平台、开源免费、轻量级(核心代码不到500行

Hi20240217的博客 1685

手把手教你搞定JBI投稿:从Statement of Significance到Declaration Statement的保姆级避坑指南

本文提供了一份详细的JBI投稿指南,重点解析Statement of Significance和Declaration of Interests的撰写技巧,帮助研究者避开常见格式陷阱。通过实战案例和检查清单,确保投稿符合JBI的学术严谨性和临床转化价值要求,提升稿件通过率。

weixin_29278805的博客 646

TFS-SDK 2012与2015接口加载与获取工作项

TFS2012 与 TFS2015版本 dll文件与so文件加载位置 1.Windows 系统 放置可执行的官方接口dll文件在 jdk/bin 中 例如: D:\soft\java\jdk1.8.0_131\bin\ 2.Linux 系统放置可执行的官方接口 SO文件在 存放位置: /usr/lib/ 接口方法的适用 接口文档中最重要的接口 public static void main(final String[] args) throws Exception { SnippetSettings.

虫小子的博客 393

基于R-CNN深度学习的生活垃圾检测与分类系统:数据集、模型和UI界面的完整实现

我们将使用一个公开的垃圾分类数据集来训练我们的模型。一个常见的数据集是TACO数据集(Trash Annotations in Context),该数据集包含多种垃圾类别,适用于垃圾分类任务。TACO数据集中的图像标注了垃圾的类别以及其在图像中的位置,适合用于目标检测任务。图片数据:每张图片中包含不同种类的垃圾。标签文件:每个图像有相应的标签文件,标注了图像中垃圾的类别、位置(通常为边界框坐标)等信息。dataset/images/image1.jpgimage2.jpg......其中,

YOLO 1111

Teamprise Readies Java SDK for TFS

      用户可以通过JAVA开发环境、苹果系统、UNIX操作系统访问微软的Visual Studio 2005 Team Foundation Server。VS2005 Team System 开放的接口,应用将是原来越广泛了。http://www.ftponline.com/channels/java/2007_06/jwaters3/

shanyou的专栏 659

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

iPhone存储空间已满怎么办?从诊断到清理的完整扩容攻略

手机存储空间管理是每个智能设备用户都会面临的日常课题。随着照片、视频、App缓存与系统数据的不断累积,容量告警成为高频痛点。理解存储空间的构成原理,是高效释放空间的第一步。iOS系统自带的存储体检工具能清晰展示各类型数据的占用分布,而针对照片优化、缓存清理、文件外移、系统级习惯养成等维度的实践,能帮助用户在不牺牲数据安全的前提下,显著提升设备可用容量。无论是处理聊天App的文稿堆积、4K视频的存储压力,还是通过iCloud与外部存储实现数据分层,都体现了技术工具与使用习惯协同的价值。本文基于实测经验,系统梳

weixin_34025051的博客 420

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

使用TFS API前提条件:SDKs

http://geekswithblogs.net/TarunArora/archive/2011/06/18/tfs-2010-sdk-connecting-to-tfs-2010-programmaticallyndashpart-1.aspx 最近遇到一个需要使用TFS api的场景:自动生成代码 由于项目使用TFS作为源代码管理工具,该场景下每次编译之前都会调用外部工具重新生成项目中的...

weixin_30522183的博客 162

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

使用Postman验证TFS Rest API

概述你可能已经了解到,TFS自2015版本发布以来,开始支持通过REST API的方式提供接口服务,第三方平台可以通过通用的HTTP协议访问TFS系统,获取数据、请求编译等。REST API在原有.NET和JAVA SDK的基础上,大幅提高的TFS系统的扩展性。任何支持HTTP访问的客户端或者设备都可以实现与TFS系统的集成。我们在使用TFS的REST API实现集成开发的过程中,往往希望首先测...

Azure DevOps Server(原名TFS) 522

Team Foundation Server 2010 问与答

在实际使用中经常会遇到一些Team Foundation Server (TFS) 的零碎问题,这里专门列个专题把这些问题,或者一些有价值的发现总结起来与大家共享。开始会简单些,一点点积累吧,呵呵!如果你也遇到了些这方面的问题,欢迎留言,我们可以一起探讨解决的办法。 如何使用TFS进行需求管理(Requirement management)? 答:Visual Studio 2010 Team Foundation Server Requirements Management Guidance

elvis0123的专栏 754

关于TFS客户端API的思考

       目前关于TFS客户端有很多种类型,java ,c++ ,php ,python .基于web形式有nginx+tfs。   这里有一些疑问,还没弄明白。关于安全性这块,只要知道api类型,地址,是不是谁都可以上来增删查改了?   还有这些api使用方式?   还在实践中………… ...

ronon77的专栏 206

android 环境搭建

下载地址:JDk: http://www.oracle.com/technetwork/java/javase/downloads/ ADT + Eclipse +SDK:http://developer.android.com/sdk/index.html?hl=sk 1. 我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量: JAVA_HO...

weixin_30611509的博客 62
上一篇: Team Foundation Server (TFS)与Project Server集成,使用DNS(友好地址)地址注册PWA
下一篇: 为Visual Studio添加一个“编码的UI测试生成器”的快捷方式
Azure DevOps
博客等级 码龄6年 219粉丝 296原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址