Skip to content

Commit

Permalink
#309 Drop (deprecated) GroovyTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Jan 24, 2024
1 parent d269b48 commit 9c23bd0
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 19 deletions.
2 changes: 0 additions & 2 deletions htmlSanityCheck-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ dependencies {
implementation 'org.codehaus.groovy:groovy-xml'
// Since Groovy 2.5 it is necessary to import dateutil separately
implementation 'org.codehaus.groovy:groovy-dateutil'

testImplementation 'org.codehaus.groovy:groovy-test'
}

//apply plugin: 'groovy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.aim42.htmlsanitycheck.check.AllCheckers
import org.aim42.htmlsanitycheck.collect.SinglePageResults
import org.junit.Test

class AllChecksRunnerTest extends GroovyTestCase {
class AllChecksRunnerTest {

final static String HTML_HEAD = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <head></head><html>'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import org.junit.Test
import static org.aim42.htmlsanitycheck.html.HtmlConst.HTML_END
import static org.aim42.htmlsanitycheck.html.HtmlConst.HTML_HEAD

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class BrokenCrossReferencesCheckerTest extends GroovyTestCase {
class BrokenCrossReferencesCheckerTest {

SingleCheckResults collector = new SingleCheckResults()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import org.aim42.htmlsanitycheck.html.HtmlPage
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class DuplicateIdCheckerTest extends GroovyTestCase {
class DuplicateIdCheckerTest {

Checker duplicateIdChecker
HtmlPage pageToCheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import org.junit.Test
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class MissingImageFilesCheckerTest extends GroovyTestCase {
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertNotNull
import static org.junit.Assert.assertTrue

class MissingImageFilesCheckerTest {

Checker checker
HtmlPage htmlPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import org.aim42.htmlsanitycheck.html.HtmlPage
import org.junit.Before
import org.junit.Test

class MissingLocalResourcesCheckerTest extends GroovyTestCase {
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue

class MissingLocalResourcesCheckerTest {


Checker missingLocalResourcesChecker
Expand Down Expand Up @@ -72,7 +75,7 @@ class MissingLocalResourcesCheckerTest extends GroovyTestCase {
// reference contained in pageToCheck shall be "d2/$fname#anchor"
String localReference = htmlPage.getAllHrefStrings().first()
assertEquals( "expected d2/fname#anchor", "d2/$fname#anchor", localReference)
assertEquals( "expected d2/fname#anchor", "d2/$fname#anchor".toString(), localReference)
missingLocalResourcesChecker = new MissingLocalResourcesChecker( myConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ package org.aim42.htmlsanitycheck.collect

import org.junit.Test

import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue

// see end-of-file for license information


class PerRunResultsTest extends GroovyTestCase {
class PerRunResultsTest {

@Test
public void testEmptyRunResultHasNoPages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import org.aim42.htmlsanitycheck.check.Checker
import org.aim42.htmlsanitycheck.check.MissingImageFilesChecker
import org.aim42.htmlsanitycheck.html.HtmlElement
import org.aim42.htmlsanitycheck.html.HtmlPage
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class SingleCheckResultsTest extends GroovyTestCase {
class SingleCheckResultsTest {

final String whatIsCheckedMessage = "A Headline for Testing Purpose"

Expand All @@ -24,6 +27,7 @@ class SingleCheckResultsTest extends GroovyTestCase {

Checker checker

@Before
public void setUp() {
checkingResults =
new SingleCheckResults(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package org.aim42.htmlsanitycheck.collect
import org.junit.Before
import org.junit.Test

class SinglePageResultsTest extends GroovyTestCase {
import static org.junit.Assert.assertEquals

class SinglePageResultsTest {
final static String HTML_HEAD = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <head></head><html>'

final static String HTML = """$HTML_HEAD<body><title>Faulty Dragon</title></body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ package org.aim42.htmlsanitycheck.html
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue

// see end-of-file for license information

/**
* test that important HTML elements are correctly parsed and extracted from {@link HtmlPage}.
*/

class HtmlPageTest extends GroovyTestCase {
class HtmlPageTest {

/**
* this file resides in git - so we can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.junit.Test

// see end-of-file for license information
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue

// see end-of-file for license information

class HtmlParserTest extends GroovyTestCase {
class HtmlParserTest {


final static String LOCAL_IMG_SRC = "images/test_xyz_uvw.jpg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ package org.aim42.htmlsanitycheck.html

import org.junit.Test

import static org.junit.Assert.assertFalse
import static org.junit.Assert.assertTrue

// see end-of-file for license information


class URLUtilTest extends GroovyTestCase {
class URLUtilTest {

private static final AIM = "aim42.org"
private static final IMG = "image.jpg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import org.aim42.htmlsanitycheck.collect.SinglePageResults
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class ConsoleReporterTest extends GroovyTestCase {
class ConsoleReporterTest {

Finding singleFinding
SingleCheckResults singleCheckResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import org.junit.After
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class JUnitXmlReporterTest extends GroovyTestCase {
class JUnitXmlReporterTest {

Finding singleFinding
SingleCheckResults singleCheckResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import org.aim42.htmlsanitycheck.collect.PerRunResults
import org.aim42.htmlsanitycheck.collect.SinglePageResults
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end-of-file for license information


class ReporterTest extends GroovyTestCase {
class ReporterTest {

@Test
public void testNothingReportedWithEmptyResults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import org.aim42.htmlsanitycheck.html.HtmlPage
import org.junit.Before
import org.junit.Test

import static org.junit.Assert.assertEquals

// see end of file for licence information

class BrokenCrossReferenceCheckerSuggestionTest extends GroovyTestCase {
class BrokenCrossReferenceCheckerSuggestionTest {


private final static String HTMLHEAD = "<html><head></head><body>"
Expand Down

0 comments on commit 9c23bd0

Please sign in to comment.