Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion citation/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM images.opencadc.org/library/cadc-tomcat:1

COPY build/libs/citation.war /usr/share/tomcat/webapps/citation.war
COPY build/libs/citation.war /usr/share/tomcat/webapps/citation.war
125 changes: 14 additions & 111 deletions citation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,130 +1,33 @@
import org.apache.tools.ant.filters.ReplaceTokens


plugins {
id 'war'

id 'checkstyle'
// IntelliJ IDEA plugin here to allow integration tests to appear properly in IDEs.
id 'idea'
}

repositories {
mavenCentral()
mavenLocal()

maven {
url = 'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/m2repo'
}
}

dependencies {
runtimeOnly 'jstl:jstl:1.2'

testImplementation 'junit:junit:[4.12,5.0)'
testImplementation 'org.skyscreamer:jsonassert:[1.5,2.0)'
testImplementation 'org.easymock:easymock:[3.6,4.0)'
testImplementation 'org.apache.commons:commons-text:[1.3,)'
testImplementation 'org.opencadc:cadc-web-test:[2.1.1,3.0.0)'
testImplementation 'org.seleniumhq.selenium:selenium-java:[3.14,4.0)'
}

sourceCompatibility = '1.8'
group = 'ca.nrc.cadc'

war {
// Trying to fix static file caching on new build.
eachFile {
if (it.name.endsWith('.jsp')) {
filter(ReplaceTokens, tokens: [version: project.version])
}
}
apply from: '../opencadc.gradle'

archiveName = 'citation.war'
}
sourceCompatibility = 11

sourceSets {
intTest
}
group = 'org.opencadc'

configurations {
intTestImplementation
intTestImplementation.extendsFrom(testImplementation)
}

idea {
module {
//and some extra test source dirs
testSourceDirs += file('src/intTest/java')
}
}
dependencies {
runtimeOnly 'jstl:jstl:1.2'

tasks.withType(Test) {
// Assign all Java system properties from
// the command line to the tests
systemProperties System.properties
intTestImplementation 'junit:junit:[4.12,5.0)'
intTestImplementation 'org.skyscreamer:jsonassert:[1.5,2.0)'
intTestImplementation 'org.apache.commons:commons-text:[1.3,)'
intTestImplementation 'org.opencadc:cadc-web-test:[2.1.1,3.0.0)'
intTestImplementation 'org.seleniumhq.selenium:selenium-java:[3.14,4.0)'
}

['firefox', 'chrome'].each { driver ->
task "intTest${driver.capitalize()}"(type: Test) { driverTest ->
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
reports {
html.destination = reporting.file("$name/html")
}
dependencies {
intTestImplementation 'junit:junit:[4.12,5.0)'
intTestImplementation 'org.opencadc:cadc-web-test:[2.1.1,3.0.0)'
intTestImplementation 'org.seleniumhq.selenium:selenium-java:[3.14,4.0)'
}

// set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

// run the tests always
outputs.upToDateWhen { false }

copy {
from System.getenv('A') + '/etc/'
into 'build/resources/intTest'
include 'DelegationTokenKey.priv'
rename 'DelegationTokenKey.priv', 'RsaSignaturePriv.key'
}
copy {
from System.getenv('A') + '/etc/'
into 'build/resources/intTest'
include 'DelegationTokenKey.pub'
rename 'DelegationTokenKey.pub', 'RsaSignaturePub.key'
}

systemProperty "driver", "${driver}"

if (!project.hasProperty('intTest_selenium_server_url')) {
systemProperty 'selenium.server.url', 'http://mach378.cadc.dao.nrc.ca:4444'
}
else {
systemProperty 'selenium.server.url', project.intTest_selenium_server_url
logger.info('Running browser tests on ' + project.intTest_selenium_server_url)
}

if (!project.hasProperty('intTest_web_app_url')) {
System.err.println("Please set the intTest_web_app_url property (-PintTest_web_app_url=https://www...).")
} else {
systemProperty 'web.app.url', project.intTest_web_app_url
}

if (!project.hasProperty('intTest_user_name')) {
System.err.println("Please set the intTest_user_name property (-PintTest_user_name=cadcuser).")
} else {
systemProperty 'user.name', project.intTest_user_name
}

if (!project.hasProperty('intTest_user_password')) {
System.err.println("Please set the intTest_user_password property (-intTest_user_password=1234pw).")
} else {
systemProperty 'user.password', project.intTest_user_password
}

maxParallelForks = 1
war {
from('.') {
include 'VERSION'
}
}
20 changes: 10 additions & 10 deletions opencadc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ configurations {
checkstyleDep
intTestImplementation.extendsFrom testImplementation

runtime.exclude module: 'slf4j-reload4j'
runtime.exclude module: 'reload4j'
runtimeOnly.exclude module: 'slf4j-reload4j'
runtimeOnly.exclude module: 'reload4j'
}

dependencies {
testImplementation 'com.puppycrawl.tools:checkstyle:8.2'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,)'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,1.1)'
}

checkstyle {
Expand All @@ -29,12 +29,12 @@ sourceSets {
}
}

// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->
tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.destination
def outputFile = report.outputLocation.get().asFile
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
Expand All @@ -46,7 +46,7 @@ tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
//reports.html.destination = file("${reporting.baseDir}/${name}")
reports.html.destination = file(reporting.baseDir.getAbsolutePath() + '/' + name)

// Assign all Java system properties from
// the command line to the tests
systemProperties System.properties
Expand All @@ -56,15 +56,15 @@ task intTest(type: Test) {
// set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

// run the tests always
outputs.upToDateWhen { false }
}

test {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
// "STARTED",
}
}

Expand All @@ -76,7 +76,7 @@ intTest {
}

pluginManager.withPlugin('maven-publish') {
// configure maven-publish to support publishToMavenLocal
// configure maven-publish to support publishToMavenLocal
publishing {
publications {
thisLibrary(MavenPublication) {
Expand All @@ -89,4 +89,4 @@ pluginManager.withPlugin('maven-publish') {
// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
}
}
Loading