Skip to content

Commit 40470f3

Browse files
committed
Merge branch 'release/3.0.0'
Performance verbessert. Code-Tests eingeführt. closed #61 closed #87 closed #108 closed #118 closed #127
2 parents 95b3840 + b1cda44 commit 40470f3

File tree

99 files changed

+4962
-3801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+4962
-3801
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
global:
1919
- secure: pHmSb+3bIvSj1iA5j4MIgRv1ogRH1w7NKlfPxAPDXYq+AQZOyyAhWm/nTMq0mtX9x5RsrM8c7YUN7ds+pTpE5JpcA+rlOSibj+ziDeLhpmDzcBt+YUltTOxP7EVrAAmHBTu7DGjPmTLvfzLfpyGNkv6yuIXNo/oIs6BRMwQ2xHa1QdkQ/gkS6nxgh7UhqtDmNix/idHjX/a5PEX8Qse3ZvKBvt1kgrKcVN1ysOtcHKvhQ5ddMAj+7PM+aLuAPTlysfqMYN1gW+cpWOJrHriV7vGCU6lz34s2yM19wFmRFOo7yht3FhAwH8Rt6aTtwpC3HN5DzwqhcicHQkoyv59KMiBbUBN9w5SGqit+/HtFOQ9vgyV5qo5Il/UkbVGUXXl9WcY+zPV2XTlO3LH5o36Bn+da/HRdmlvveMZT8tJ5137YSQhrQRZdOVEDBWuAZmUiTh94c9u3owU85TFzS97fqWi5bvpbyIU749oGhWGv/zxmOEJmtinnQpUAJqS9fFrXrFFtjdLF6vNYWc1f1y7Xg57pLZYK0NcClWc77QwCX5WHy6VPdj3elIJHyv+3DKQw9VBrfV+bRE4b6uvLuDkllBztYECstYR1uJTOumVnhufc12GrD51m+IRqtzEp4+OlNunKsoInNGsJYyaz3t8VcdAwEN4lTE7Se7ijehIpHRA=
2020
script:
21-
- "./gradlew check build"
21+
- "./gradlew check developTest integrationTest build"
2222
- if [ "$TRAVIS_BRANCH" == "develop" ]; then
2323
openssl aes-256-cbc -K $encrypted_3a9121b37456_key -iv $encrypted_3a9121b37456_iv
2424
-in scripte/deploy/RepoZugang.properties.enc -out scripte/deploy/RepoZugang.properties -d;

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Quality Gate](https://sonarqube.com/api/badges/gate?key=mediathekview%3AMServer)](https://sonarqube.com/dashboard/index/mediathekview%3AMServer)
44

55
# MServer
6-
Server zum Steuern des Crawler. Teil von [MediathekView](https://github.com/mediathekview).
6+
Server zum crawlen der Mediatheken. Teil von [MediathekView](https://github.com/mediathekview).
77

88
# Entwicklung
99

@@ -12,7 +12,7 @@ Server zum Steuern des Crawler. Teil von [MediathekView](https://github.com/medi
1212
mkdir mediathekview
1313
cd mediathekview
1414
git clone https://github.com/mediathekview/MServer.git
15-
git clone https://github.com/mediathekview/MSearch.git
15+
git clone https://github.com/mediathekview/Mlib.git
1616
```
1717

1818
## Bauen und starten an der Kommandozeile
@@ -22,11 +22,11 @@ cd MServer
2222
```
2323

2424
## Entwicklung mit Netbeans
25-
* Verzeichnisse `MSearch` und `MServer` mit Netbeans öffnen
25+
* Verzeichnisse `MLib` und `MServer` mit Netbeans öffnen
2626

2727
## Entwicklung mit Eclipse
2828
* Falls noch nicht vorhanden: [Plugin buildship](https://projects.eclipse.org/projects/tools.buildship) installieren
29-
* Projekt `MServer` als Gradle-Projekt importieren. `MSearch` wird automatisch mit importiert.
29+
* Projekt `MServer` als Gradle-Projekt importieren. `MLib` wird automatisch mit importiert.
3030

3131
# Autor
3232
@xaverW

build.gradle

Lines changed: 127 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1+
import java.nio.file.Files
2+
import java.nio.file.Paths
3+
import org.apache.tools.ant.filters.ReplaceTokens
4+
5+
plugins {
6+
id "com.github.jk1.dependency-license-report" version "0.3.5"
7+
}
8+
19
apply plugin: 'java'
210
apply plugin: 'distribution'
311
apply plugin: 'maven'
412
apply from: "${project.rootDir}/gradle/eclipse.gradle"
5-
import java.nio.file.Files
6-
import java.nio.file.Paths
7-
import org.apache.tools.ant.filters.ReplaceTokens
13+
814

915
sourceCompatibility = 1.8
1016
targetCompatibility = 1.8
1117
group = 'de.mediathekview'
12-
version = '2.7.9'
18+
version = '3.0.0'
1319

1420
def jarName = 'MServer.jar'
1521
def mainClass = 'mServer.Main'
@@ -34,22 +40,111 @@ repositories {
3440
}
3541
}
3642

43+
sourceSets {
44+
developTest {
45+
java {
46+
compileClasspath += main.output + test.output
47+
runtimeClasspath += main.output + test.output
48+
srcDir file('src/test/developTest/java')
49+
}
50+
resources.srcDir file('src/test/developTest/resources')
51+
}
52+
integrationTest {
53+
java {
54+
compileClasspath += main.output + test.output
55+
runtimeClasspath += main.output + test.output
56+
srcDir file('src/test/integrationTest/java')
57+
}
58+
resources.srcDir file('src/test/integrationTest/resources')
59+
}
60+
performanceTest {
61+
java {
62+
compileClasspath += main.output + test.output
63+
runtimeClasspath += main.output + test.output
64+
srcDir file('src/test/performanceTest/java')
65+
}
66+
resources.srcDir file('src/test/performanceTest/resources')
67+
}
68+
}
69+
70+
configurations {
71+
developTestCompile.extendsFrom testCompile
72+
developTestRuntime.extendsFrom testRuntime
73+
integrationTestCompile.extendsFrom testCompile
74+
integrationTestRuntime.extendsFrom testRuntime
75+
performanceTestCompile.extendsFrom testCompile
76+
performanceTestRuntime.extendsFrom testRuntime
77+
}
78+
3779
test {
38-
exclude '**/*PerformanceTest.class'
80+
}
81+
82+
task developTest(type: Test) {
83+
testClassesDir = sourceSets.developTest.output.classesDir
84+
classpath = sourceSets.developTest.runtimeClasspath
85+
outputs.upToDateWhen { false }
86+
87+
beforeTest { descriptor ->
88+
logger.lifecycle("Running test: " + descriptor)
89+
}
90+
}
91+
92+
task integrationTest(type: Test) {
93+
testClassesDir = sourceSets.integrationTest.output.classesDir
94+
classpath = sourceSets.integrationTest.runtimeClasspath
95+
outputs.upToDateWhen { false }
96+
97+
beforeTest { descriptor ->
98+
logger.lifecycle("Running test: " + descriptor)
99+
}
100+
}
101+
102+
task performanceTest(type: Test) {
103+
logger.info("hier")
104+
testClassesDir = sourceSets.performanceTest.output.classesDir
105+
classpath = sourceSets.performanceTest.runtimeClasspath
106+
outputs.upToDateWhen { false }
107+
108+
beforeTest { descriptor ->
109+
logger.lifecycle("Running test: " + descriptor)
110+
}
111+
}
112+
113+
tasks.withType(Test) {
114+
reports.html.destination = file("${reporting.baseDir}/${name}")
39115
}
40116

41117
dependencies {
42-
compile 'de.mediathekview:MSearch:2.2.0'
118+
compile 'de.mediathekview:MLib:3.0.0'
43119
compile 'commons-net:commons-net:3.5'
44120
compile 'org.apache.commons:commons-compress:1.12'
45121
compile 'org.apache.commons:commons-lang3:3.5'
46122
compile 'org.tukaani:xz:1.5'
47123
compile 'com.google.code.gson:gson:2.8.0'
48124
compile 'com.sun.jersey:jersey-client:1.8'
125+
compile 'com.squareup.okhttp3:okhttp:3.6.0'
126+
49127

50128
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
51129
compile group: 'fm.void.jetm', name: 'jetm', version: '1.2.3'
52-
compile group: 'junit', name: 'junit', version: '4.12'
130+
131+
testCompile "junit:junit:4.12"
132+
testCompile "org.mockito:mockito-core:2.+"
133+
testCompile "com.squareup.okhttp3:mockwebserver:3.6.0"
134+
testCompile "org.hamcrest:hamcrest-all:1.3"
135+
}
136+
137+
configurations.compile {
138+
resolutionStrategy.dependencySubstitution {
139+
def substituteIfExists = { String moduleName, String projectName ->
140+
if(findProject(projectName)) {
141+
assert !(project.hasProperty('org.gradle.configureondemand') && Boolean.valueOf(project.getProperty('org.gradle.configureondemand'))) : "org.gradle.configureondemand = true will cause problems when substituting a project"
142+
logger.lifecycle "$project: Substituting module '$moduleName' with project $projectName"
143+
substitute module(moduleName) with project(projectName)
144+
}
145+
}
146+
substituteIfExists('de.mediathekview:MLib', ':MLib')
147+
}
53148
}
54149

55150
ext {
@@ -90,23 +185,33 @@ uploadArchives {
90185
}
91186
build.dependsOn(install)
92187

93-
task updateVersion << {
94-
Properties props = loadVersionProperties()
95-
def oldVersion = props.getProperty('VERSION')
96-
String buildDate = new Date().format('dd.MM.yyyy HH:mm:ss')
97-
if (!oldVersion.equals(project.version)) {
98-
logger.lifecycle "==mserver======================"
99-
logger.lifecycle "Version: $project.version"
100-
logger.lifecycle "Baudatum: $buildDate"
101-
logger.lifecycle "==mserver======================"
102-
props.setProperty('VERSION', project.version)
103-
props.setProperty('DATE', buildDate)
104-
props.store(propsFile.newWriter(), null)
188+
task updateVersion {
189+
doLast {
190+
Properties props = loadVersionProperties()
191+
def oldVersion = props.getProperty('VERSION')
192+
String buildDate = new Date().format('dd.MM.yyyy HH:mm:ss')
193+
if (!oldVersion.equals(project.version)) {
194+
logger.lifecycle "==mserver======================"
195+
logger.lifecycle "Version: $project.version"
196+
logger.lifecycle "Baudatum: $buildDate"
197+
logger.lifecycle "==mserver======================"
198+
props.setProperty('VERSION', project.version)
199+
props.setProperty('DATE', buildDate)
200+
props.store(propsFile.newWriter(), null)
201+
}
105202
}
106203
}
107204

108205
processResources.dependsOn updateVersion
109206

207+
licenseReport {
208+
outputDir = "build/Copyright/"
209+
excludes = [':MSearch', 'MediathekView:MLib']
210+
configurations = ['compile']
211+
}
212+
213+
processResources.dependsOn generateLicenseReport
214+
110215
[distZip, distTar]*.shouldRunAfter compileJava, updateVersion, jar
111216
distTar.compression = Compression.GZIP
112217
distTar.extension = 'tar.gz'
@@ -142,6 +247,9 @@ distributions {
142247
from('build/libs') {
143248
include '*.jar'
144249
}
250+
from('build') {
251+
include 'Copyright/*'
252+
}
145253
}
146254
}
147255
}
@@ -156,7 +264,6 @@ task run(type: JavaExec, dependsOn: classes) {
156264
if (project.hasProperty('args')) {
157265
args(project.args.split(','))
158266
}
159-
160267
}
161268

162269
/**

0 commit comments

Comments
 (0)