Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
0f4a76fb
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0f4a76fb
编写于
1月 11, 2011
作者:
O
Olivier Lamy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix junit upgrade commons-io to 2.0.1
上级
1a9f3c67
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
98 addition
and
44 deletion
+98
-44
core/pom.xml
core/pom.xml
+0
-1
maven-plugin/pom.xml
maven-plugin/pom.xml
+5
-1
maven-plugin/src/main/java/hudson/maven/MavenModule.java
maven-plugin/src/main/java/hudson/maven/MavenModule.java
+10
-0
maven-plugin/src/main/java/hudson/maven/PomInfo.java
maven-plugin/src/main/java/hudson/maven/PomInfo.java
+7
-0
pom.xml
pom.xml
+7
-0
test/src/test/java/hudson/maven/MavenMultiModuleTest.java
test/src/test/java/hudson/maven/MavenMultiModuleTest.java
+0
-42
test/src/test/java/hudson/maven/MavenMultiModuleTestIncremental.java
...st/java/hudson/maven/MavenMultiModuleTestIncremental.java
+69
-0
未找到文件。
core/pom.xml
浏览文件 @
0f4a76fb
...
...
@@ -471,7 +471,6 @@ THE SOFTWARE.
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
1.4
</version>
</dependency>
<dependency>
<!-- hudson doesn't use this directly, but some plugins wanted to use the latest -->
<groupId>
commons-lang
</groupId>
...
...
maven-plugin/pom.xml
浏览文件 @
0f4a76fb
...
...
@@ -182,7 +182,11 @@ THE SOFTWARE.
<groupId>
org.jvnet.hudson
</groupId>
<artifactId>
hudson-maven-artifact-manager
</artifactId>
<version>
1.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
</dependency>
<dependency>
<groupId>
org.jvnet.hudson
</groupId>
<artifactId>
hudson-maven-embedder
</artifactId>
...
...
maven-plugin/src/main/java/hudson/maven/MavenModule.java
浏览文件 @
0f4a76fb
...
...
@@ -88,6 +88,9 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
private
transient
ModuleName
moduleName
;
/**
* @see documentation in {@link PomInfo#relativePath}
*/
private
String
relativePath
;
/**
...
...
@@ -481,6 +484,13 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
return
reporterList
;
}
/**
* for debug purpose
*/
public
String
toString
()
{
return
super
.
toString
()+
'['
+
getFullName
()+
']'
+
"[relativePath:"
+
getRelativePath
()+
']'
;
}
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
MavenModule
.
class
.
getName
());
...
...
maven-plugin/src/main/java/hudson/maven/PomInfo.java
浏览文件 @
0f4a76fb
...
...
@@ -228,4 +228,11 @@ final class PomInfo implements Serializable {
return
StringUtils
.
equals
(
pomInfo
.
groupId
,
this
.
groupId
)
&&
StringUtils
.
equals
(
pomInfo
.
artifactId
,
this
.
artifactId
);
}
/**
* for debug purpose
*/
public
String
toString
()
{
return
"PomInfo:["
+
groupId
+
':'
+
artifactId
+
']'
+
"[relativePath:"
+
relativePath
+
']'
;
}
}
pom.xml
浏览文件 @
0f4a76fb
...
...
@@ -359,6 +359,13 @@ THE SOFTWARE.
<artifactId>
ant
</artifactId>
<version>
1.8.0
</version>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.0.1
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
...
...
test/src/test/java/hudson/maven/MavenMultiModuleTest.java
浏览文件 @
0f4a76fb
...
...
@@ -110,49 +110,7 @@ public class MavenMultiModuleTest extends HudsonTestCase {
pBuild
.
getDuration
()
>=
summedModuleDuration
);
}
@Bug
(
7684
)
public
void
testRelRootPom
()
throws
Exception
{
configureDefaultMaven
(
"apache-maven-2.2.1"
,
MavenInstallation
.
MAVEN_21
);
MavenModuleSet
m
=
createMavenProject
();
m
.
setRootPOM
(
"../parent/pom.xml"
);
m
.
getReporters
().
add
(
new
TestReporter
());
m
.
setScm
(
new
ExtractResourceWithChangesSCM
(
getClass
().
getResource
(
"maven-multimod-rel-base.zip"
),
getClass
().
getResource
(
"maven-multimod-changes.zip"
),
"moduleA"
));
buildAndAssertSuccess
(
m
);
// Now run a second build with the changes.
m
.
setIncrementalBuild
(
true
);
buildAndAssertSuccess
(
m
);
MavenModuleSetBuild
pBuild
=
m
.
getLastBuild
();
ExtractChangeLogSet
changeSet
=
(
ExtractChangeLogSet
)
pBuild
.
getChangeSet
();
assertFalse
(
"ExtractChangeLogSet should not be empty."
,
changeSet
.
isEmptySet
());
for
(
MavenBuild
modBuild
:
pBuild
.
getModuleLastBuilds
().
values
())
{
String
parentModuleName
=
modBuild
.
getParent
().
getModuleName
().
toString
();
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleA"
))
{
assertEquals
(
"moduleA should have Result.NOT_BUILT"
,
Result
.
NOT_BUILT
,
modBuild
.
getResult
());
}
else
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleB"
))
{
assertEquals
(
"moduleB should have Result.SUCCESS"
,
Result
.
SUCCESS
,
modBuild
.
getResult
());
}
else
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleC"
))
{
assertEquals
(
"moduleC should have Result.SUCCESS"
,
Result
.
SUCCESS
,
modBuild
.
getResult
());
}
}
long
summedModuleDuration
=
0
;
for
(
MavenBuild
modBuild
:
pBuild
.
getModuleLastBuilds
().
values
())
{
summedModuleDuration
+=
modBuild
.
getDuration
();
}
assertTrue
(
"duration of moduleset build should be greater-equal than sum of the module builds"
,
pBuild
.
getDuration
()
>=
summedModuleDuration
);
}
@Bug
(
6544
)
public
void
testEstimatedDurationForIncrementalMultiModMaven
()
throws
Exception
{
...
...
test/src/test/java/hudson/maven/MavenMultiModuleTestIncremental.java
0 → 100755
浏览文件 @
0f4a76fb
package
hudson.maven
;
import
hudson.Launcher
;
import
hudson.model.BuildListener
;
import
hudson.model.Result
;
import
hudson.tasks.Maven.MavenInstallation
;
import
java.io.IOException
;
import
org.jvnet.hudson.test.Bug
;
import
org.jvnet.hudson.test.ExtractChangeLogSet
;
import
org.jvnet.hudson.test.ExtractResourceWithChangesSCM
;
import
org.jvnet.hudson.test.HudsonTestCase
;
/**
* @author Andrew Bayer
*/
public
class
MavenMultiModuleTestIncremental
extends
HudsonTestCase
{
@Bug
(
7684
)
public
void
testRelRootPom
()
throws
Exception
{
configureDefaultMaven
(
"apache-maven-2.2.1"
,
MavenInstallation
.
MAVEN_21
);
MavenModuleSet
m
=
createMavenProject
();
m
.
setRootPOM
(
"parent/pom.xml"
);
m
.
getReporters
().
add
(
new
TestReporter
());
m
.
setScm
(
new
ExtractResourceWithChangesSCM
(
getClass
().
getResource
(
"maven-multimod-rel-base.zip"
),
getClass
().
getResource
(
"maven-multimod-changes.zip"
)));
buildAndAssertSuccess
(
m
);
// Now run a second build with the changes.
m
.
setIncrementalBuild
(
true
);
buildAndAssertSuccess
(
m
);
MavenModuleSetBuild
pBuild
=
m
.
getLastBuild
();
ExtractChangeLogSet
changeSet
=
(
ExtractChangeLogSet
)
pBuild
.
getChangeSet
();
assertFalse
(
"ExtractChangeLogSet should not be empty."
,
changeSet
.
isEmptySet
());
for
(
MavenBuild
modBuild
:
pBuild
.
getModuleLastBuilds
().
values
())
{
String
parentModuleName
=
modBuild
.
getParent
().
getModuleName
().
toString
();
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleA"
))
{
assertEquals
(
"moduleA should have Result.NOT_BUILT"
,
Result
.
NOT_BUILT
,
modBuild
.
getResult
());
}
else
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleB"
))
{
assertEquals
(
"moduleB should have Result.SUCCESS"
,
Result
.
SUCCESS
,
modBuild
.
getResult
());
}
else
if
(
parentModuleName
.
equals
(
"org.jvnet.hudson.main.test.multimod:moduleC"
))
{
assertEquals
(
"moduleC should have Result.SUCCESS"
,
Result
.
SUCCESS
,
modBuild
.
getResult
());
}
}
long
summedModuleDuration
=
0
;
for
(
MavenBuild
modBuild
:
pBuild
.
getModuleLastBuilds
().
values
())
{
summedModuleDuration
+=
modBuild
.
getDuration
();
}
assertTrue
(
"duration of moduleset build should be greater-equal than sum of the module builds"
,
pBuild
.
getDuration
()
>=
summedModuleDuration
);
}
private
static
class
TestReporter
extends
MavenReporter
{
@Override
public
boolean
end
(
MavenBuild
build
,
Launcher
launcher
,
BuildListener
listener
)
throws
InterruptedException
,
IOException
{
assertNotNull
(
build
.
getProject
().
getWorkspace
());
assertNotNull
(
build
.
getWorkspace
());
return
true
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录