-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-jboss51x.gradle
111 lines (93 loc) · 3.96 KB
/
build-jboss51x.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import org.apache.tools.ant.filters.ReplaceTokens;
configurations {
jboss51xTestRuntime { extendsFrom testRuntime }
}
dependencies {
jboss51xTestRuntime "org.jboss.arquillian.container:arquillian-jbossas-remote-5.1:$libraryVersions.arquillian_jboss51"
jboss51xTestRuntime ("org.jboss.jbossas:jboss-as-client:$libraryVersions.jboss51x")
{
exclude (group: "cglib", module: "cglib")
exclude (group: "javax.security", module: "jaas")
exclude (group: "javax.security", module: "jacc")
}
// misc wrong versions comming from: org.jboss.jbossas:jboss-as-client:$libraryVersions.jboss51x
// to prevent: Could not find cglib:cglib:2.1.3.
jboss51xTestRuntime "cglib:cglib:2.1_3"
// to prevent: java.lang.ClassNotFoundException: org.jboss.security.SecurityContextAssociation
jboss51xTestRuntime "org.jboss.security:jboss-security-spi-bare:2.0.3.SP1"
}
// 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/jboss"
String binDir = rootDir + "/bin"
task unpackContainer(type: Copy) {
from { zipTree( downloadFile("http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA-jdk6.zip"))}
into 'build/unpack'
// to prevent:
// Caused by: java.lang.IllegalArgumentException: Exception loading class for ScopeKey addition.
// at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:67)
// ...
// see: https://community.jboss.org/thread/163357
// exclude '**/server/default/deployers/webbeans.deployer/**/*.*'
doLast {
ant.rename(src: 'build/unpack/jboss-5.1.0.GA', dest: 'build/unpack/jboss')
// ant.delete( dir: 'build/unpack/jboss/server/default/deployers/jbossws.deployer' )
}
}
task deployP6SpyJars(type: Copy, dependsOn: unpackContainer) {
from configurations.p6spyAll
into rootDir + "/server/default/deploy"
}
task copyConfig(type: Copy, dependsOn: unpackContainer) {
from "$buildDir/../src/test/config/spy.properties"
into rootDir + "/server/default/conf"
filter(ReplaceTokens, tokens: [logDir: buildDir.getAbsolutePath()])
}
task configureDS(type: Copy, dependsOn: unpackContainer) {
from "$buildDir/../src/test/container/jboss-common"
into rootDir
filter(ReplaceTokens, tokens: [buildDir: buildDir.getAbsolutePath()])
}
//ant.mkdir ( dir: 'build/unpack' )
//ant.unzip ( src: "downloads/jbossws-cxf-3.3.0.GA.zip", dest: 'build/unpack')
//ant.move ( file: "build/unpack/jbossws-cxf-bin-dist/ant.properties.example", tofile: "build/unpack/jbossws-cxf-bin-dist/ant.properties" )
//ant.replace ( file: "build/unpack/jbossws-cxf-bin-dist/ant.properties", token: "@jboss510.home@", value: rootDir )
// ant.replace (file: "build/unpack/jbossws-cxf-bin-dist/tests/ant-import/build-testsuite.xml",
// token: 'target name="test"',
// value: 'target name="testFoo"'
// )
//
// ant.replace (file: "build/unpack/jbossws-cxf-bin-dist/build.xml",
// token: '"clean',
// value: '"cleanFoo'
// )
// ant.replace (file: "build/unpack/jbossws-cxf-bin-dist/build/user-project-build.xml",
// token: '"clean',
// value: '"cleanFoo'
// )
//
// ant.importBuild 'build/unpack/jbossws-cxf-bin-dist/build.xml'
//
task startContainer(dependsOn: [ deployP6SpyJars, copyConfig, configureDS] ) {
doLast {
ant.exec(
dir: binDir,
spawn: true,
executable: './run.sh'
)
{
arg(value: "-c")
arg(value: "default")
}
// 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 'bash', '-e', 'shutdown.sh', '-S'
}