Jenkins+Ant+Java+Junit+SVN??????
???????????? ???????[ 2015/1/19 14:47:12 ] ?????????????????? JUnit ??в??????
??????????????
????Jenkins:
??????????????jenkins.war????http://jenkins-ci.org/
??????????????????
????????????????jenkins.war???????????£???C:jenkins???????????д?????????????£????java -jar jenkens.war???????????“Jenkins is fully up and running”????????????????????????????????http://localhost:8080/ ???jenkins???????
?????????tomcat????jenkins.war??????tomcat??webapps??????£????tomcat?????????jenkins????????http://localhost:8080/jenkins ???????jenkins????????
????ANT:
????????ant??????ANT_HOME????????http://ant.apache.org/??
????3??Junit:
????????junit.jar??????ù????ο???http://blog.csdn.net/lengyuhong/article/details/5815017
????4??SVN:
????1???????????SVN???http://wenku.baidu.com/view/12b02f6a011ca300a6c39081.html
????2??SVN??????????????http://www.cnblogs.com/xiaobaihome/tag/SVN/ ????????????????????????
???????????????
?????????????????????д?????????????????ANT??????????build.xml???????Щ??????????ANT task?Junit??JunitReport?н??????????????
????1??Java????
package com.glen.he;
public class ComplexCalculation {
public int Division(int a??int b){
return (a/b);
}
public int Multiply(int a??int b){
return (a*b);
}
}
package com.glen.he;
public class SimpleCalculation {
public int Add(int a??int b){
return (a+b);
}
public int Subtration(int a??int b){
return(a-b);
}
}
|
????2????????????
package com.glen.he;
import com.glen.he.ComplexCalculation;
import static org.junit.Assert.*;
import org.junit.Test;
public class ComplexCalculationTest {
ComplexCalculation cc = new ComplexCalculation();
@Test
public void DivisionTest() {
int c = cc.Division(100?? 5);
assertEquals(20?? c);
}
@Test
public void MultiplyTest() {
int c = cc.Multiply(100?? 5);
assertEquals(500?? c);
}
}
package com.glen.he;
import com.glen.he.SimpleCalculation;
import static org.junit.Assert.*;
import org.junit.Test;
public class SimpleCalculationTest {
SimpleCalculation sc = new SimpleCalculation();
@Test
public void AddTest() {
int c = sc.Add(3?? 5);
assertEquals(8?? c);
}
@Test
public void SubtrationTest() {
int c = sc.Subtration(20?? 5);
assertEquals(15?? c);
}
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11