-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
112 lines (96 loc) · 3.05 KB
/
build.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
112
plugins {
id 'java'
}
version = '1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7
libsDirName = 'app'
//Get dependencies from Maven central repository
repositories {
mavenCentral()
}
configurations {
integrationTestCompile { extendsFrom compile, testCompile }
integrationTestRuntime { extendsFrom integrationTestCompile, runtime }
}
sourceSets {
integrationTest {
/*compileClasspath = compile + configurations.integrationTestCompile
runtimeClasspath = classes + compile + configurations.integrationTest*/
java.srcDir file('src/integrationTest/java')
resources.srcDir file('src/integrationTest/resources')
}
}
//Project dependencies
dependencies {
compile('ch.qos.logback:logback-classic:1.1.2','com.google.code.gson:gson:2.3.1')
testCompile('org.testng:testng:6.8.21')
integrationTestCompile sourceSets.main.output
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperties(['resourcePath':'src\\integrationTest\\resources\\'])
useTestNG()
{
includeGroups 'integration'
}
testLogging.showStandardStreams = true
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle(event.message )
}
testLogging {
events 'passed','failed'
}
}
check.dependsOn integrationTest
test {
systemProperties(['resourcePath':'src\\test\\resources\\'])
useTestNG() {
includeGroups 'unit'
// includeGroups 'parsing'
}
testLogging.showStandardStreams = true
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle(event.message )
}
testLogging {
events 'passed','failed'
}
/*{
//
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
testLogging {
events 'started', 'passed'
}
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
}
}*/
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
task downloadLibs(type: Copy) {
from configurations.testCompile
into 'libs'
}
//create a single Jar with all dependencies
task buildAllInOne(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Handlers Programming Test',
'Implementation-Version': version,
'Main-Class': 'com.Application'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}