-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-wildfly81x.gradle
72 lines (60 loc) · 2.31 KB
/
build-wildfly81x.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import org.apache.tools.ant.filters.ReplaceTokens;
configurations {
wildfly81xTestRuntime { extendsFrom testRuntime }
}
dependencies {
wildfly81xTestRuntime "org.wildfly:wildfly-arquillian-container-remote:$libraryVersions.arquillian_wildfly81"
}
// didn't figure out how to use neither javax.sql.DataSource nor javax.sql.XADataSource => exclude those tests
unitTest.useJUnit {
excludeCategories 'com.p6spy.engine.spy.DataSourceTests', 'com.p6spy.engine.spy.XADataSourceTests'
}
String rootDir = "$buildDir/unpack/wildfly"
String binDir = rootDir + "/bin"
task unpackContainer(type: Copy) {
from { zipTree( downloadFile("http://download.jboss.org/wildfly/8.1.0.Final/wildfly-8.1.0.Final.zip"))}
into 'build/unpack'
doLast {
ant.rename(src: 'build/unpack/wildfly-8.1.0.Final', dest: 'build/unpack/wildfly')
}
}
// wildfly has already the h2 available => don't deploy again
//task deployH2Jar(type: Copy, dependsOn: unpackContainer) {
// from configurations.p6spyAll
// into rootDir + "/modules/system/layers/base/com/h2/main"
// include "**/h2*.jar"
//}
task deployP6SpyJar(type: Copy, dependsOn: unpackContainer) {
from configurations.p6spyAll
into rootDir + "/modules/system/layers/base/com/p6spy/main"
include "**/p6spy*.jar"
rename 'p6spy(.+)jar', 'p6spy.jar'
}
task copyConfig(type: Copy, dependsOn: unpackContainer) {
from "$buildDir/../src/test/config/spy.properties"
into rootDir + "/bin"
filter(ReplaceTokens, tokens: [logDir: buildDir.getAbsolutePath()])
}
task configureDS(type: Copy, dependsOn: unpackContainer) {
from "$buildDir/../src/test/container/${container}"
into rootDir
filter(ReplaceTokens, tokens: [buildDir: buildDir.getAbsolutePath(), p6spy_version: libraryVersions.p6spy, h2_version: libraryVersions.h2])
}
task startContainer(dependsOn: [ deployP6SpyJar, copyConfig, configureDS ]) {
doLast {
ant.exec(
dir: binDir,
spawn: true,
executable: './standalone.sh'
)
// wildfly might not need it due to fast boot
// it takes quite some time till jboss boots, let's make sure we wait for it
ant.waitfor(maxwait: "60", maxwaitunit: "second") {
socket (server: "localhost", port: "8080")
}
}
}
task stopContainer(type:Exec, dependsOn: startContainer) {
workingDir binDir
commandLine './jboss-cli.sh', '-c', '--command=shutdown'
}