-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
154 lines (137 loc) · 5.82 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
plugins {
id 'org.springframework.boot' version '2.5.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
group = 'ru.spbstu'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.slf4j:slf4j-api:1.7.26"
implementation group: 'org.apache.lucene', name: 'lucene-core', version: '8.10.0'
implementation group: 'org.apache.lucene', name: 'lucene-analyzers-common', version: '8.10.0'
implementation group: 'org.apache.lucene', name: 'lucene-memory', version: '8.10.0'
implementation group: 'org.apache.solr', name: 'solr-core', version: '8.10.0'
implementation 'org.postgresql:postgresql:42.1.4'
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation 'com.google.guava:guava:31.0.1-jre'
implementation "redis.clients:jedis:3.0.1"
implementation "com.intellij:annotations:12.0"
implementation "com.google.guava:guava:27.0.1-jre"
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'junit:junit:4.12'
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.8.0'
// https://mvnrepository.com/artifact/org.mockito/mockito-inline
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '3.8.0'
// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.1.2'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-api', version: '4.1.2'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: '4.1.2'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-remote-driver', version: '4.1.2'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-json', version: '4.1.2'
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// https://mvnrepository.com/artifact/edu.uci.ics/crawler4j
implementation 'edu.uci.ics:crawler4j:4.2'
// https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager
testImplementation group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '5.1.0'
// https://mvnrepository.com/artifact/org.jsoup/jsoup
implementation 'org.jsoup:jsoup:1.14.3'
}
sourceSets {
test {
java {
srcDirs = ["src/test/junit"]
outputDir = file("${buildDir}/testClasses")
}
resources {
srcDirs = ["src/test/junit"]
}
}
integrationTest {
java {
srcDirs = ["src/test/integration"]
outputDir = file("${buildDir}/integrationTestClasses")
compileClasspath += test.output
compileClasspath += main.output
compileClasspath += test.compileClasspath
}
resources {
srcDirs = ["src/test/integration"]
}
}
uiTest {
java {
srcDirs = ["src/test/ui"]
outputDir = file("${buildDir}/uiTestClasses")
compileClasspath += test.output
compileClasspath += main.output
compileClasspath += test.compileClasspath
}
resources {
srcDirs = ["src/test/ui"]
}
}
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath += sourceSets.integrationTest.runtimeClasspath
}
task uiTest(type: Test) {
testClassesDirs = sourceSets.uiTest.output.classesDirs
classpath += sourceSets.uiTest.runtimeClasspath
}
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}