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
40 changes: 14 additions & 26 deletions cadc-quality/opencadc-1.1.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,25 @@ tasks.withType(Checkstyle).each { checkstyleTask ->
}
}

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
tasks.withType(Test).configureEach {
// separate report destinations for each test task
reports.html.outputLocation = layout.buildDirectory.dir("reports/tests/${name}")

// assign all Java system properties from the command line to the tests
systemProperties System.properties
}

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",
}
}

intTest {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
tasks.register('intTest', Test) {
// Set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

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

pluginManager.withPlugin('maven-publish') {
Expand All @@ -92,6 +80,6 @@ pluginManager.withPlugin('maven-publish') {
}

// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
tasks.register('install') {
dependsOn(tasks.named('publishToMavenLocal'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2019. (c) 2019.
* (c) 2026. (c) 2026.
* Government of Canada Gouvernement du Canada
* National Research Council Conseil national de recherches
* Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
Expand Down Expand Up @@ -70,10 +70,9 @@
package ca.nrc.cadc.auth;

import ca.nrc.cadc.util.Log4jInit;
import junit.framework.Assert;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2019. (c) 2019.
* (c) 2026. (c) 2026.
* Government of Canada Gouvernement du Canada
* National Research Council Conseil national de recherches
* Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
Expand Down Expand Up @@ -74,8 +74,8 @@
import java.net.URL;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;
import junit.framework.Assert;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public class HttpDownloadTest
}

public HttpDownloadTest() throws Exception {
this.okURL = new URL("https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/robots.txt");
this.resumableURL = new URL("https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/robots.txt");
this.okURL = new URL("https://raw.githubusercontent.com/opencadc/core/refs/heads/main/opencadc.gradle");
this.resumableURL = okURL;
this.redirectURL = new URL("https://httpbin.org/redirect?url=" + okURL);
this.permissionDeniedURL = new URL("https://httpbin.org/status/403");
this.notFoundURL = new URL("https://httpbin.org/status/404");
Expand Down Expand Up @@ -180,7 +180,7 @@ public void testDownloadFileToDir() throws Exception
Assert.assertNotNull("result file", out);
Assert.assertTrue("dest file exists after download", out.exists());
Assert.assertTrue("dest file size > 0", out.length() > 0);
Assert.assertEquals("filename", "robots.txt", out.getName());
Assert.assertEquals("filename", "opencadc.gradle", out.getName());
}
catch (Exception unexpected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class HttpGetTest {
}

public HttpGetTest() throws Exception {
this.okURL = new URL("https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/robots.txt");
this.okURL = new URL("https://raw.githubusercontent.com/opencadc/core/refs/heads/main/opencadc.gradle");
this.permissionDeniedURL = new URL("https://httpbin.org/status/403");
this.notFoundURL = new URL("https://httpbin.org/status/404");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2016. (c) 2016.
* (c) 2026. (c) 2026.
* Government of Canada Gouvernement du Canada
* National Research Council Conseil national de recherches
* Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
Expand Down Expand Up @@ -70,9 +70,7 @@
package ca.nrc.cadc.util;

import java.io.FileNotFoundException;

import junit.framework.Assert;

import org.junit.Assert;
import org.junit.Test;

/**
Expand Down
40 changes: 14 additions & 26 deletions opencadc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,25 @@ tasks.withType(Checkstyle).each { checkstyleTask ->
}
}

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
tasks.withType(Test).configureEach {
// separate report destinations for each test task
reports.html.outputLocation = layout.buildDirectory.dir("reports/tests/${name}")

// assign all Java system properties from the command line to the tests
systemProperties System.properties
}

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",
}
}

intTest {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
tasks.register('intTest', Test) {
// Set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

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

pluginManager.withPlugin('maven-publish') {
Expand All @@ -92,6 +80,6 @@ pluginManager.withPlugin('maven-publish') {
}

// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
tasks.register('install') {
dependsOn(tasks.named('publishToMavenLocal'))
}
Loading