From 179c77a4df2d10986b4e1ba9e75498c08962b30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Tue, 26 May 2020 11:28:09 +0200 Subject: [PATCH] update to Java 11 named module, Gradle 6.4.1, JUnit 5 --- .travis.yml | 12 -- build.gradle | 149 +++--------------- gradle.properties | 5 +- gradle/compile/java.gradle | 35 ++++ gradle/documentation/asciidoc.gradle | 55 +++++++ gradle/ide/idea.gradle | 13 ++ gradle/publishing/publication.gradle | 64 ++++++++ gradle/publishing/sonatype.gradle | 11 ++ gradle/test/junit5.gradle | 27 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 58910 bytes gradle/wrapper/gradle-wrapper.properties | 5 +- gradlew | 31 ++-- gradlew.bat | 4 + src/main/java/module-info.java | 13 ++ .../java/org/xbib/time/chronic/Chronic.java | 6 - .../handlers/RdnRmnSdTTzSyHandler.java | 5 - .../time/chronic/handlers/RmnSdSyHandler.java | 5 - .../time/chronic/handlers/RmnSyHandler.java | 5 - .../time/chronic/handlers/SmSdSyHandler.java | 5 - .../time/chronic/handlers/SmSyHandler.java | 5 - .../java/org/xbib/time/format/Composite.java | 7 +- .../org/xbib/time/format/FieldFormatter.java | 6 +- .../org/xbib/time/format/FormatUtils.java | 54 ++----- .../org/xbib/time/format/PeriodFormat.java | 2 +- .../org/xbib/time/format/PeriodFormatter.java | 6 +- .../org/xbib/time/format/PeriodPrinter.java | 3 +- .../java/org/xbib/time/format/Separator.java | 3 +- .../time/schedule/DefaultCronExpression.java | 1 - .../org/xbib/time/DateTimeFormatterTest.java | 6 +- .../org/xbib/time/chronic/ChronicTest.java | 6 +- .../org/xbib/time/chronic/HandlerTest.java | 36 ++--- .../org/xbib/time/chronic/NumerizerTest.java | 6 +- .../org/xbib/time/chronic/ParserTest.java | 31 ++-- .../time/chronic/RepeaterDayNameTest.java | 9 +- .../time/chronic/RepeaterFortnightTest.java | 9 +- .../xbib/time/chronic/RepeaterHourTest.java | 6 +- .../time/chronic/RepeaterMonthNameTest.java | 9 +- .../xbib/time/chronic/RepeaterMonthTest.java | 9 +- .../xbib/time/chronic/RepeaterTimeTest.java | 9 +- .../xbib/time/chronic/RepeaterWeekTest.java | 9 +- .../time/chronic/RepeaterWeekendTest.java | 9 +- .../xbib/time/chronic/RepeaterYearTest.java | 9 +- .../java/org/xbib/time/chronic/SpanTest.java | 7 +- .../java/org/xbib/time/chronic/TokenTest.java | 8 +- .../format/PeriodFormatterBuilderTest.java | 11 +- .../pretty/PrettyTimeAPIManipulationTest.java | 77 +++++---- .../time/pretty/PrettyTimeI18n_AR_Test.java | 78 +++++---- .../time/pretty/PrettyTimeI18n_BG_Test.java | 77 +++++---- .../time/pretty/PrettyTimeI18n_CA_Test.java | 78 +++++---- .../time/pretty/PrettyTimeI18n_CS_Test.java | 76 ++++----- .../time/pretty/PrettyTimeI18n_DA_Test.java | 58 ++++--- .../time/pretty/PrettyTimeI18n_ET_Test.java | 114 +++++++------- .../time/pretty/PrettyTimeI18n_FA_Test.java | 78 +++++---- .../time/pretty/PrettyTimeI18n_FI_Test.java | 114 +++++++------- .../time/pretty/PrettyTimeI18n_FR_Test.java | 21 ++- .../time/pretty/PrettyTimeI18n_IT_Test.java | 114 +++++++------- .../time/pretty/PrettyTimeI18n_KO_Test.java | 78 +++++---- .../time/pretty/PrettyTimeI18n_NL_Test.java | 58 ++++--- .../time/pretty/PrettyTimeI18n_NO_Test.java | 58 ++++--- .../time/pretty/PrettyTimeI18n_RU_Test.java | 58 ++++--- .../time/pretty/PrettyTimeI18n_SV_Test.java | 58 ++++--- .../xbib/time/pretty/PrettyTimeI18n_Test.java | 20 ++- .../time/pretty/PrettyTimeI18n_UA_Test.java | 66 ++++---- .../pretty/PrettyTimeI18n_hi_IN_Test.java | 72 ++++----- .../pretty/PrettyTimeI18n_in_ID_Test.java | 72 ++++----- .../pretty/PrettyTimeI18n_zh_TW_Test.java | 66 ++++---- .../pretty/PrettyTimeLocaleFallbackTest.java | 20 ++- .../time/pretty/PrettyTimeNoSignTest.java | 10 +- .../org/xbib/time/pretty/PrettyTimeTest.java | 76 +++++---- .../PrettyTimeUnitConfigurationTest.java | 32 ++-- .../time/pretty/SimpleTimeFormatTest.java | 23 ++- ...impleTimeFormatTimeQuantifiedNameTest.java | 52 +++--- .../pretty/i18n/TimeFormatProviderTest.java | 9 +- .../pretty/units/TimeUnitComparatorTest.java | 7 +- .../schedule/CompareBehaviorToQuartzTest.java | 24 +-- .../schedule/CompareSizeToQuartzTest.java | 26 ++- .../schedule/CompareSpeedToQuartzTest.java | 9 +- .../time/schedule/CronExpressionTest.java | 26 ++- .../xbib/time/schedule/CronScheduleTest.java | 21 +-- .../time/schedule/DayOfMonthFieldTest.java | 4 +- .../time/schedule/DayOfWeekFieldTest.java | 4 +- .../xbib/time/schedule/DefaultFieldTest.java | 10 +- .../org/xbib/time/schedule/KeywordsTest.java | 10 +- .../xbib/time/schedule/MonthFieldTest.java | 4 +- .../xbib/time/schedule/NextExecutionTest.java | 2 +- .../org/xbib/time/schedule/ReadmeTest.java | 4 +- .../org/xbib/time/schedule/TokensTest.java | 8 +- ...java => WhatQuartzDoesNotSupportTest.java} | 15 +- .../time/schedule/{ => util}/DateTimes.java | 16 +- .../time/schedule/{ => util}/Integers.java | 2 +- .../{ => util}/ObjectSizeCalculator.java | 2 +- .../xbib/time/schedule/{ => util}/Times.java | 8 +- 92 files changed, 1313 insertions(+), 1328 deletions(-) delete mode 100644 .travis.yml create mode 100644 gradle/compile/java.gradle create mode 100644 gradle/documentation/asciidoc.gradle create mode 100644 gradle/ide/idea.gradle create mode 100644 gradle/publishing/publication.gradle create mode 100644 gradle/publishing/sonatype.gradle create mode 100644 gradle/test/junit5.gradle create mode 100644 src/main/java/module-info.java rename src/test/java/org/xbib/time/schedule/{WhatQuartzDoesNotSupport.java => WhatQuartzDoesNotSupportTest.java} (82%) rename src/test/java/org/xbib/time/schedule/{ => util}/DateTimes.java (74%) rename src/test/java/org/xbib/time/schedule/{ => util}/Integers.java (96%) rename src/test/java/org/xbib/time/schedule/{ => util}/ObjectSizeCalculator.java (99%) rename src/test/java/org/xbib/time/schedule/{ => util}/Times.java (96%) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0699641..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: java -sudo: required -jdk: - - oraclejdk8 -cache: - directories: - - $HOME/.m2 -after_success: - - ./gradlew sonarqube -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN -env: - global: - secure: n1Ai4q/yMLn/Pg5pA4lTavoJoe7mQYB1PSKnZAqwbgyla94ySzK6iyBCBiNs/foMPisB/x+DHvmUXTsjvquw9Ay48ZITCV3xhcWzD0eZM2TMoG19CpRAEe8L8LNuYiti9k89ijDdUGZ5ifsvQNTGNHksouayAuApC3PrTUejJfR6SYrp1ZsQTbsMlr+4XU3p7QknK5rGgOwATIMP28F+bVnB05WJtlJA3b0SeucCurn3wJ4FGBQXRYmdlT7bQhNE4QgZM1VzcUFD/K0TBxzzq/otb/lNRSifyoekktDmJwQnaT9uQ4R8R6KdQ2Kb38Rvgjur+TKm5i1G8qS2+6LnIxQJG1aw3JvKK6W0wWCgnAVVRrXaCLday9NuY59tuh1mfjQ10UcsMNKcTdcKEMrLow506wSETcXc7L/LEnneWQyJJeV4vhPqR7KJfsBbeqgz3yIfsCn1GZVWFlfegzYCN52YTl0Y0uRD2Z+TnzQu+Bf4DzaWXLge1rz31xkhyeNNspub4h024+XqBjcMm6M9mlMzmmK8t2DIwPy/BlQbFBUyhrxziuR/5/2NEDPyHltvWkRb4AUIa25WJqkV0gTBegbMadZ9DyOo6Ea7aoVFBae2WGR08F1kzABsWrd1S7UJmWxW35iyMEtoAIayXphIK98qO5aCutwZ+3iOQazxbAs= diff --git a/build.gradle b/build.gradle index 3a96d10..3e653df 100644 --- a/build.gradle +++ b/build.gradle @@ -1,134 +1,37 @@ plugins { - id "com.github.spotbugs" version "2.0.0" - id "io.codearte.nexus-staging" version "0.11.0" + id "de.marcphilipp.nexus-publish" version "0.4.0" + id "io.codearte.nexus-staging" version "0.21.1" } -apply plugin: 'java' -apply plugin: 'pmd' -apply plugin: 'checkstyle' -apply plugin: "com.github.spotbugs" - -dependencies { - testCompile "junit:junit:${project.property('junit.version')}" - testCompile "org.quartz-scheduler:quartz:${project.property('quartz.version')}" - testCompile "com.google.caliper:caliper:${project.property('caliper.version')}" -} - -compileJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -compileTestJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:all" -} - -test { - testLogging { - showStandardStreams = true - exceptionFormat = 'full' - } -} - -spotbugs { - toolVersion = '3.1.12' - sourceSets = [sourceSets.main] - ignoreFailures = true - effort = "max" - reportLevel = "high" -} - -tasks.withType(Pmd) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = true - } -} - -tasks.withType(Checkstyle) { - ignoreFailures = true - reports { - xml.enabled = true - html.enabled = true - } -} - -task sourcesJar(type: Jar, dependsOn: classes) { - classifier 'sources' - from sourceSets.main.allSource -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier 'javadoc' -} - -artifacts { - archives sourcesJar, javadocJar +wrapper { + gradleVersion = "${project.property('gradle.wrapper.version')}" + distributionType = Wrapper.DistributionType.ALL } ext { user = 'xbib' - projectName = 'time' - projectDescription = 'A bundle of Chronic, Prettytime, and org.joda.time.format optimized for Java 8 Time API' - scmUrl = 'https://github.com/xbib/time' - scmConnection = 'scm:git:git://github.com/xbib/time.git' - scmDeveloperConnection = 'scm:git:git://github.com/xbib/time.git' + name = 'time' + description = 'A bundle of Chronic, Prettytime, and org.joda.time.format optimized for Java 8 Time API' + inceptionYear = '2016' + url = 'https://github.com/' + user + '/' + name + scmUrl = 'https://github.com/' + user + '/' + name + scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git' + scmDeveloperConnection = 'scm:git:ssh://git@github.com:' + user + '/' + name + '.git' + issueManagementSystem = 'Github' + issueManagementUrl = ext.scmUrl + '/issues' + licenseName = 'The Apache License, Version 2.0' + licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' } -task sonatypeUpload(type: Upload) { - configuration = configurations.archives - uploadDescriptor = true - repositories { - if (project.hasProperty('ossrhUsername')) { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: uri(ossrhReleaseUrl)) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - snapshotRepository(url: uri(ossrhSnapshotUrl)) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - pom.project { - name projectName - description projectDescription - packaging 'jar' - inceptionYear '2016' - url scmUrl - organization { - name 'xbib' - url 'http://xbib.org' - } - developers { - developer { - id user - name 'Jörg Prante' - email 'joergprante@gmail.com' - url 'https://github.com/jprante' - } - } - scm { - url scmUrl - connection scmConnection - developerConnection scmDeveloperConnection - } - licenses { - license { - name 'The Apache License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - } - } - } - } +apply plugin: 'java-library' + +dependencies { + testImplementation "org.quartz-scheduler:quartz:${project.property('quartz.version')}" + testImplementation "com.google.caliper:caliper:${project.property('caliper.version')}" } -nexusStaging { - packageGroup = "org.xbib" -} +apply from: rootProject.file('gradle/ide/idea.gradle') +apply from: rootProject.file('gradle/compile/java.gradle') +apply from: rootProject.file('gradle/test/junit5.gradle') +apply from: rootProject.file('gradle/publishing/publication.gradle') +apply from: rootProject.file('gradle/publishing/sonatype.gradle') diff --git a/gradle.properties b/gradle.properties index ae672f0..c0f8e05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,7 @@ group = org.xbib name = time -version = 2.0.0 +version = 2.1.0 -# test -junit.version = 4.12 +gradle.wrapper.version = 6.4.1 quartz.version = 2.3.0 caliper.version = 1.0-beta-2 diff --git a/gradle/compile/java.gradle b/gradle/compile/java.gradle new file mode 100644 index 0000000..a9d76ce --- /dev/null +++ b/gradle/compile/java.gradle @@ -0,0 +1,35 @@ + +apply plugin: 'java-library' + +java { + modularity.inferModulePath.set(true) +} + +compileJava { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +compileTestJava { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +jar { + manifest { + attributes('Implementation-Version': project.version) + } +} + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier 'javadoc' +} + +artifacts { + archives sourcesJar, javadocJar +} \ No newline at end of file diff --git a/gradle/documentation/asciidoc.gradle b/gradle/documentation/asciidoc.gradle new file mode 100644 index 0000000..87ba22e --- /dev/null +++ b/gradle/documentation/asciidoc.gradle @@ -0,0 +1,55 @@ +apply plugin: 'org.xbib.gradle.plugin.asciidoctor' + +configurations { + asciidoclet +} + +dependencies { + asciidoclet "org.asciidoctor:asciidoclet:${project.property('asciidoclet.version')}" +} + + +asciidoctor { + backends 'html5' + outputDir = file("${rootProject.projectDir}/docs") + separateOutputDirs = false + attributes 'source-highlighter': 'coderay', + idprefix: '', + idseparator: '-', + toc: 'left', + doctype: 'book', + icons: 'font', + encoding: 'utf-8', + sectlink: true, + sectanchors: true, + linkattrs: true, + imagesdir: 'img', + stylesheet: "${projectDir}/src/docs/asciidoc/css/foundation.css" +} + + +/*javadoc { +options.docletpath = configurations.asciidoclet.files.asType(List) +options.doclet = 'org.asciidoctor.Asciidoclet' +//options.overview = "src/docs/asciidoclet/overview.adoc" +options.addStringOption "-base-dir", "${projectDir}" +options.addStringOption "-attribute", + "name=${project.name},version=${project.version},title-link=https://github.com/xbib/${project.name}" +configure(options) { + noTimestamp = true +} +}*/ + + +/*javadoc { + options.docletpath = configurations.asciidoclet.files.asType(List) + options.doclet = 'org.asciidoctor.Asciidoclet' + options.overview = "${rootProject.projectDir}/src/docs/asciidoclet/overview.adoc" + options.addStringOption "-base-dir", "${projectDir}" + options.addStringOption "-attribute", + "name=${project.name},version=${project.version},title-link=https://github.com/xbib/${project.name}" + options.destinationDirectory(file("${projectDir}/docs/javadoc")) + configure(options) { + noTimestamp = true + } +}*/ diff --git a/gradle/ide/idea.gradle b/gradle/ide/idea.gradle new file mode 100644 index 0000000..64e2167 --- /dev/null +++ b/gradle/ide/idea.gradle @@ -0,0 +1,13 @@ +apply plugin: 'idea' + +idea { + module { + outputDir file('build/classes/java/main') + testOutputDir file('build/classes/java/test') + } +} + +if (project.convention.findPlugin(JavaPluginConvention)) { + //sourceSets.main.output.classesDirs = file("build/classes/java/main") + //sourceSets.test.output.classesDirs = file("build/classes/java/test") +} diff --git a/gradle/publishing/publication.gradle b/gradle/publishing/publication.gradle new file mode 100644 index 0000000..c35fcb9 --- /dev/null +++ b/gradle/publishing/publication.gradle @@ -0,0 +1,64 @@ + +apply plugin: "de.marcphilipp.nexus-publish" + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + pom { + name = project.name + description = rootProject.ext.description + url = rootProject.ext.url + inceptionYear = rootProject.ext.inceptionYear + packaging = 'jar' + organization { + name = 'xbib' + url = 'https://xbib.org' + } + developers { + developer { + id = 'jprante' + name = 'Jörg Prante' + email = 'joergprante@gmail.com' + url = 'https://github.com/jprante' + } + } + scm { + url = rootProject.ext.scmUrl + connection = rootProject.ext.scmConnection + developerConnection = rootProject.ext.scmDeveloperConnection + } + issueManagement { + system = rootProject.ext.issueManagementSystem + url = rootProject.ext.issueManagementUrl + } + licenses { + license { + name = rootProject.ext.licenseName + url = rootProject.ext.licenseUrl + distribution = 'repo' + } + } + } + } + } +} + +if (project.hasProperty("signing.keyId")) { + apply plugin: 'signing' + signing { + sign publishing.publications.mavenJava + } +} + +nexusPublishing { + repositories { + sonatype { + username = project.property('ossrhUsername') + password = project.property('ossrhPassword') + packageGroup = "org.xbib" + } + } +} diff --git a/gradle/publishing/sonatype.gradle b/gradle/publishing/sonatype.gradle new file mode 100644 index 0000000..e1813f3 --- /dev/null +++ b/gradle/publishing/sonatype.gradle @@ -0,0 +1,11 @@ + +if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { + + apply plugin: 'io.codearte.nexus-staging' + + nexusStaging { + username = project.property('ossrhUsername') + password = project.property('ossrhPassword') + packageGroup = "org.xbib" + } +} diff --git a/gradle/test/junit5.gradle b/gradle/test/junit5.gradle new file mode 100644 index 0000000..cfef972 --- /dev/null +++ b/gradle/test/junit5.gradle @@ -0,0 +1,27 @@ + +def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.6.2' +def hamcrestVersion = project.hasProperty('hamcrest.version')?project.property('hamcrest.version'):'2.2' + +dependencies { + testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}" + testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" +} + +test { + useJUnitPlatform() + failFast = true + testLogging { + events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED' + } + afterSuite { desc, result -> + if (!desc.parent) { + println "\nTest result: ${result.resultType}" + println "Test summary: ${result.testCount} tests, " + + "${result.successfulTestCount} succeeded, " + + "${result.failedTestCount} failed, " + + "${result.skippedTestCount} skipped" + } + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016b3885f6930543d57b744ea8c220a1a..62d4c053550b91381bbd28b1afc82d634bf73a8a 100644 GIT binary patch delta 23020 zcmZ6yV{|24)TJ9%DzUY6ksRrv&p?~YSFgp`E zPcOBdd*dQ@-0EJu5{@Rs)8Fukc%2C>|tqZrK zLV^5dGp39tCCDe?lhegZW_)s9c6qS=x5>=o1QrccXaggTb{|SR<7_H(l(Z70W`&rZ z*Dxcys#XiG^E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); } catch (Exception e) { - logger.log(Level.FINE, e.getMessage(), e); throw new ParseException("failed to scan tokens", 0); } } @@ -100,7 +95,6 @@ public class Chronic { tokens = (List) scannerClass.getMethod("scan", List.class, Options.class) .invoke(null, tokens, options); } catch (Exception e) { - logger.log(Level.FINE, e.getMessage(), e); throw new ParseException("failed to scan tokens", 0); } } diff --git a/src/main/java/org/xbib/time/chronic/handlers/RdnRmnSdTTzSyHandler.java b/src/main/java/org/xbib/time/chronic/handlers/RdnRmnSdTTzSyHandler.java index e3e5f13..239bd1b 100644 --- a/src/main/java/org/xbib/time/chronic/handlers/RdnRmnSdTTzSyHandler.java +++ b/src/main/java/org/xbib/time/chronic/handlers/RdnRmnSdTTzSyHandler.java @@ -9,16 +9,12 @@ import org.xbib.time.chronic.tags.ScalarYear; import java.time.ZonedDateTime; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class RdnRmnSdTTzSyHandler implements IHandler { - private static final Logger logger = Logger.getLogger(RdnRmnSdTTzSyHandler.class.getName()); - @Override public Span handle(List tokens, Options options) { int month = tokens.get(1).getTag(RepeaterMonthName.class).getType().ordinal(); @@ -30,7 +26,6 @@ public class RdnRmnSdTTzSyHandler implements IHandler { ZonedDateTime dayStart = ZonedDateTime.of(year, month, day, 0, 0, 0, 0, options.getZoneId()); span = Handler.dayOrTime(dayStart, timeTokens, options); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); span = null; } return span; diff --git a/src/main/java/org/xbib/time/chronic/handlers/RmnSdSyHandler.java b/src/main/java/org/xbib/time/chronic/handlers/RmnSdSyHandler.java index 3a784d7..9b23d01 100644 --- a/src/main/java/org/xbib/time/chronic/handlers/RmnSdSyHandler.java +++ b/src/main/java/org/xbib/time/chronic/handlers/RmnSdSyHandler.java @@ -9,16 +9,12 @@ import org.xbib.time.chronic.tags.ScalarYear; import java.time.ZonedDateTime; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class RmnSdSyHandler implements IHandler { - private static final Logger logger = Logger.getLogger(RmnSdSyHandler.class.getName()); - @Override public Span handle(List tokens, Options options) { int month = tokens.get(0).getTag(RepeaterMonthName.class).getType().ordinal(); @@ -30,7 +26,6 @@ public class RmnSdSyHandler implements IHandler { ZonedDateTime dayStart = ZonedDateTime.of(year, month, day, 0, 0, 0, 0, options.getZoneId()); span = Handler.dayOrTime(dayStart, timeTokens, options); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); span = null; } return span; diff --git a/src/main/java/org/xbib/time/chronic/handlers/RmnSyHandler.java b/src/main/java/org/xbib/time/chronic/handlers/RmnSyHandler.java index 9e9e94c..f9a164f 100644 --- a/src/main/java/org/xbib/time/chronic/handlers/RmnSyHandler.java +++ b/src/main/java/org/xbib/time/chronic/handlers/RmnSyHandler.java @@ -9,16 +9,12 @@ import org.xbib.time.chronic.tags.ScalarYear; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class RmnSyHandler implements IHandler { - private static final Logger logger = Logger.getLogger(RmnSyHandler.class.getName()); - @Override public Span handle(List tokens, Options options) { int month = tokens.get(0).getTag(RepeaterMonthName.class).getType().ordinal(); @@ -29,7 +25,6 @@ public class RmnSyHandler implements IHandler { ZonedDateTime end = start.plus(1, ChronoUnit.MONTHS); span = new Span(start, end); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); span = null; } return span; diff --git a/src/main/java/org/xbib/time/chronic/handlers/SmSdSyHandler.java b/src/main/java/org/xbib/time/chronic/handlers/SmSdSyHandler.java index e979b9e..7ea64d2 100644 --- a/src/main/java/org/xbib/time/chronic/handlers/SmSdSyHandler.java +++ b/src/main/java/org/xbib/time/chronic/handlers/SmSdSyHandler.java @@ -9,16 +9,12 @@ import org.xbib.time.chronic.tags.ScalarYear; import java.time.ZonedDateTime; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class SmSdSyHandler implements IHandler { - private static final Logger logger = Logger.getLogger(SmSdSyHandler.class.getName()); - @Override public Span handle(List tokens, Options options) { int month = tokens.get(0).getTag(ScalarMonth.class).getType(); @@ -30,7 +26,6 @@ public class SmSdSyHandler implements IHandler { ZonedDateTime dayStart = ZonedDateTime.of(year, month, day, 0, 0, 0, 0, options.getZoneId()); span = Handler.dayOrTime(dayStart, timeTokens, options); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); span = null; } return span; diff --git a/src/main/java/org/xbib/time/chronic/handlers/SmSyHandler.java b/src/main/java/org/xbib/time/chronic/handlers/SmSyHandler.java index 29a0574..7144d82 100644 --- a/src/main/java/org/xbib/time/chronic/handlers/SmSyHandler.java +++ b/src/main/java/org/xbib/time/chronic/handlers/SmSyHandler.java @@ -9,16 +9,12 @@ import org.xbib.time.chronic.tags.ScalarYear; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; /** * */ public class SmSyHandler implements IHandler { - private static final Logger logger = Logger.getLogger(SmSyHandler.class.getName()); - @Override public Span handle(List tokens, Options options) { int month = tokens.get(0).getTag(ScalarMonth.class).getType(); @@ -29,7 +25,6 @@ public class SmSyHandler implements IHandler { ZonedDateTime end = start.plus(1, ChronoUnit.MONTHS); span = new Span(start, end); } catch (IllegalArgumentException e) { - logger.log(Level.FINE, e.getMessage(), e); span = null; } return span; diff --git a/src/main/java/org/xbib/time/format/Composite.java b/src/main/java/org/xbib/time/format/Composite.java index 89d2025..e15df8b 100644 --- a/src/main/java/org/xbib/time/format/Composite.java +++ b/src/main/java/org/xbib/time/format/Composite.java @@ -35,6 +35,7 @@ class Composite implements PeriodPrinter, PeriodParser { } } + @Override public int countFieldsToPrint(Period period, int stopAt, Locale locale) { int sum = 0; PeriodPrinter[] printers = iPrinters; @@ -44,6 +45,7 @@ class Composite implements PeriodPrinter, PeriodParser { return sum; } + @Override public int calculatePrintedLength(Period period, Locale locale) { int sum = 0; PeriodPrinter[] printers = iPrinters; @@ -53,18 +55,21 @@ class Composite implements PeriodPrinter, PeriodParser { return sum; } - public void printTo(StringBuilder buf, Period period, Locale locale) { + @Override + public void printTo(StringBuilder buf, Period period, Locale locale) throws IOException { for (PeriodPrinter printer : iPrinters) { printer.printTo(buf, period, locale); } } + @Override public void printTo(Writer out, Period period, Locale locale) throws IOException { for (PeriodPrinter printer : iPrinters) { printer.printTo(out, period, locale); } } + @Override public int parseInto(PeriodAmount period, String periodStr, int pos, Locale locale) { int position = pos; PeriodParser[] parsers = iParsers; diff --git a/src/main/java/org/xbib/time/format/FieldFormatter.java b/src/main/java/org/xbib/time/format/FieldFormatter.java index da88774..d0a3405 100644 --- a/src/main/java/org/xbib/time/format/FieldFormatter.java +++ b/src/main/java/org/xbib/time/format/FieldFormatter.java @@ -74,6 +74,7 @@ class FieldFormatter implements PeriodPrinter, PeriodParser { } } + @Override public int countFieldsToPrint(Period period, int stopAt, Locale locale) { if (stopAt <= 0) { return 0; @@ -84,6 +85,7 @@ class FieldFormatter implements PeriodPrinter, PeriodParser { return 0; } + @Override public int calculatePrintedLength(Period period, Locale locale) { long valueLong = getFieldValue(period); if (valueLong == Long.MAX_VALUE) { @@ -103,7 +105,8 @@ class FieldFormatter implements PeriodPrinter, PeriodParser { return sum; } - public void printTo(StringBuilder buf, Period period, Locale locale) { + @Override + public void printTo(StringBuilder buf, Period period, Locale locale) throws IOException { long valueLong = getFieldValue(period); if (valueLong == Long.MAX_VALUE) { return; @@ -123,6 +126,7 @@ class FieldFormatter implements PeriodPrinter, PeriodParser { } } + @Override public void printTo(Writer out, Period period, Locale locale) throws IOException { long valueLong = getFieldValue(period); if (valueLong == Long.MAX_VALUE) { diff --git a/src/main/java/org/xbib/time/format/FormatUtils.java b/src/main/java/org/xbib/time/format/FormatUtils.java index 43f0bbc..fe05c46 100644 --- a/src/main/java/org/xbib/time/format/FormatUtils.java +++ b/src/main/java/org/xbib/time/format/FormatUtils.java @@ -2,8 +2,6 @@ package org.xbib.time.format; import java.io.IOException; import java.io.Writer; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Utility methods used by formatters. @@ -11,8 +9,6 @@ import java.util.logging.Logger; */ public class FormatUtils { - private static final Logger logger = Logger.getLogger(FormatUtils.class.getName()); - private static final double LOG_10 = Math.log(10); /** @@ -24,25 +20,20 @@ public class FormatUtils { /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and appends it to the given buffer. - *

* This method is optimized for converting small values to strings. * * @param buf receives integer converted to a string * @param value value to convert to a string * @param size minimum amount of digits to append + * @throws IOException if appending fails */ - public static void appendPaddedInteger(StringBuilder buf, int value, int size) { - try { - appendPaddedInteger((Appendable) buf, value, size); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + public static void appendPaddedInteger(StringBuilder buf, int value, int size) throws IOException { + appendPaddedInteger((Appendable) buf, value, size); } /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and appends it to the given appendable. - *

* This method is optimized for converting small values to strings. * * @param appenadble receives integer converted to a string @@ -101,25 +92,20 @@ public class FormatUtils { /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and appends it to the given buffer. - *

* This method is optimized for converting small values to strings. * * @param buf receives integer converted to a string * @param value value to convert to a string * @param size minimum amount of digits to append + * @throws IOException if appending fails */ - public static void appendPaddedInteger(StringBuilder buf, long value, int size) { - try { - appendPaddedInteger((Appendable) buf, value, size); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + public static void appendPaddedInteger(StringBuilder buf, long value, int size) throws IOException { + appendPaddedInteger((Appendable) buf, value, size); } /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and appends it to the given buffer. - *

* This method is optimized for converting small values to strings. * * @param appendable receives integer converted to a string @@ -159,7 +145,6 @@ public class FormatUtils { /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and writes it to the given writer. - *

* This method is optimized for converting small values to strings. * * @param out receives integer converted to a string @@ -219,7 +204,6 @@ public class FormatUtils { /** * Converts an integer to a string, prepended with a variable amount of '0' * pad characters, and writes it to the given writer. - *

* This method is optimized for converting small values to strings. * * @param out receives integer converted to a string @@ -258,22 +242,18 @@ public class FormatUtils { /** * Converts an integer to a string, and appends it to the given buffer. - *

This method is optimized for converting small values to strings. + * This method is optimized for converting small values to strings. * * @param buf receives integer converted to a string * @param value value to convert to a string + * @throws IOException if appending fails */ - public static void appendUnpaddedInteger(StringBuilder buf, int value) { - try { - appendUnpaddedInteger((Appendable) buf, value); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + public static void appendUnpaddedInteger(StringBuilder buf, int value) throws IOException { + appendUnpaddedInteger((Appendable) buf, value); } /** * Converts an integer to a string, and appends it to the given appendable. - *

* This method is optimized for converting small values to strings. * * @param appendable receives integer converted to a string @@ -308,22 +288,18 @@ public class FormatUtils { /** * Converts an integer to a string, and appends it to the given buffer. - *

This method is optimized for converting small values to strings. + * This method is optimized for converting small values to strings. * * @param buf receives integer converted to a string * @param value value to convert to a string + * @throws IOException if appending fails */ - public static void appendUnpaddedInteger(StringBuilder buf, long value) { - try { - appendUnpaddedInteger((Appendable) buf, value); - } catch (IOException e) { - logger.log(Level.FINE, e.getMessage(), e); - } + public static void appendUnpaddedInteger(StringBuilder buf, long value) throws IOException { + appendUnpaddedInteger((Appendable) buf, value); } /** * Converts an integer to a string, and appends it to the given appendable. - *

* This method is optimized for converting small values to strings. * * @param appendable receives integer converted to a string @@ -341,7 +317,6 @@ public class FormatUtils { /** * Converts an integer to a string, and writes it to the given writer. - *

* This method is optimized for converting small values to strings. * * @param out receives integer converted to a string @@ -377,7 +352,6 @@ public class FormatUtils { /** * Converts an integer to a string, and writes it to the given writer. - *

* This method is optimized for converting small values to strings. * * @param out receives integer converted to a string diff --git a/src/main/java/org/xbib/time/format/PeriodFormat.java b/src/main/java/org/xbib/time/format/PeriodFormat.java index b5fcc74..4f9daaa 100644 --- a/src/main/java/org/xbib/time/format/PeriodFormat.java +++ b/src/main/java/org/xbib/time/format/PeriodFormat.java @@ -341,7 +341,7 @@ public class PeriodFormat { } @Override - public void printTo(StringBuilder buf, Period period, Locale locale) { + public void printTo(StringBuilder buf, Period period, Locale locale) throws IOException { getPrinter(locale).printTo(buf, period, locale); } diff --git a/src/main/java/org/xbib/time/format/PeriodFormatter.java b/src/main/java/org/xbib/time/format/PeriodFormatter.java index 2df1e20..c1ac73e 100644 --- a/src/main/java/org/xbib/time/format/PeriodFormatter.java +++ b/src/main/java/org/xbib/time/format/PeriodFormatter.java @@ -153,8 +153,9 @@ public class PeriodFormatter { * * @param buf the formatted period is appended to this buffer * @param period the period to format, not null + * @throws IOException if print fails */ - public void printTo(StringBuilder buf, Period period) { + public void printTo(StringBuilder buf, Period period) throws IOException { checkPrinter(); checkPeriod(period); getPrinter().printTo(buf, period, iLocale); @@ -178,8 +179,9 @@ public class PeriodFormatter { * * @param period the period to format, not null * @return the printed result + * @throws IOException if print fails */ - public String print(Period period) { + public String print(Period period) throws IOException { checkPrinter(); checkPeriod(period); PeriodPrinter printer = getPrinter(); diff --git a/src/main/java/org/xbib/time/format/PeriodPrinter.java b/src/main/java/org/xbib/time/format/PeriodPrinter.java index ce689bf..b19b50c 100644 --- a/src/main/java/org/xbib/time/format/PeriodPrinter.java +++ b/src/main/java/org/xbib/time/format/PeriodPrinter.java @@ -39,8 +39,9 @@ public interface PeriodPrinter { * @param buf the formatted period is appended to this buffer * @param period the period to format * @param locale the locale to use + * @throws IOException if print fails */ - void printTo(StringBuilder buf, Period period, Locale locale); + void printTo(StringBuilder buf, Period period, Locale locale) throws IOException; /** * Prints a ReadablePeriod to a Writer. diff --git a/src/main/java/org/xbib/time/format/Separator.java b/src/main/java/org/xbib/time/format/Separator.java index 3b4bf15..fd7ff3f 100644 --- a/src/main/java/org/xbib/time/format/Separator.java +++ b/src/main/java/org/xbib/time/format/Separator.java @@ -89,10 +89,9 @@ class Separator implements PeriodPrinter, PeriodParser { return sum; } - public void printTo(StringBuilder buf, Period period, Locale locale) { + public void printTo(StringBuilder buf, Period period, Locale locale) throws IOException { PeriodPrinter before = iBeforePrinter; PeriodPrinter after = iAfterPrinter; - before.printTo(buf, period, locale); if (iUseBefore) { if (before.countFieldsToPrint(period, 1, locale) > 0) { diff --git a/src/main/java/org/xbib/time/schedule/DefaultCronExpression.java b/src/main/java/org/xbib/time/schedule/DefaultCronExpression.java index 11bc125..4f11b8a 100644 --- a/src/main/java/org/xbib/time/schedule/DefaultCronExpression.java +++ b/src/main/java/org/xbib/time/schedule/DefaultCronExpression.java @@ -6,7 +6,6 @@ import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; import java.util.Objects; import java.util.SortedSet; -import java.util.logging.Logger; public class DefaultCronExpression extends CronExpression { diff --git a/src/test/java/org/xbib/time/DateTimeFormatterTest.java b/src/test/java/org/xbib/time/DateTimeFormatterTest.java index fd67d18..f4b4057 100644 --- a/src/test/java/org/xbib/time/DateTimeFormatterTest.java +++ b/src/test/java/org/xbib/time/DateTimeFormatterTest.java @@ -1,15 +1,13 @@ package org.xbib.time; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class DateTimeFormatterTest { @Test diff --git a/src/test/java/org/xbib/time/chronic/ChronicTest.java b/src/test/java/org/xbib/time/chronic/ChronicTest.java index 1ea6cf5..ddf6c31 100644 --- a/src/test/java/org/xbib/time/chronic/ChronicTest.java +++ b/src/test/java/org/xbib/time/chronic/ChronicTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.handlers.Handler; import org.xbib.time.chronic.repeaters.EnumRepeaterDayPortion; import org.xbib.time.chronic.repeaters.RepeaterDayName; @@ -14,7 +14,7 @@ import java.time.ZonedDateTime; import java.util.LinkedList; import java.util.List; -public class ChronicTest extends Assert { +public class ChronicTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); diff --git a/src/test/java/org/xbib/time/chronic/HandlerTest.java b/src/test/java/org/xbib/time/chronic/HandlerTest.java index 3da2759..3a3862b 100644 --- a/src/test/java/org/xbib/time/chronic/HandlerTest.java +++ b/src/test/java/org/xbib/time/chronic/HandlerTest.java @@ -1,12 +1,19 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.handlers.DummyHandler; import org.xbib.time.chronic.handlers.Handler; import org.xbib.time.chronic.handlers.HandlerTypePattern; import org.xbib.time.chronic.handlers.TagPattern; -import org.xbib.time.chronic.repeaters.*; +import org.xbib.time.chronic.repeaters.EnumRepeaterDayPortion; +import org.xbib.time.chronic.repeaters.Repeater; +import org.xbib.time.chronic.repeaters.RepeaterDayName; +import org.xbib.time.chronic.repeaters.RepeaterDayPortion; +import org.xbib.time.chronic.repeaters.RepeaterMonthName; +import org.xbib.time.chronic.repeaters.RepeaterTime; +import org.xbib.time.chronic.repeaters.RepeaterYear; import org.xbib.time.chronic.tags.Pointer; import org.xbib.time.chronic.tags.Scalar; import org.xbib.time.chronic.tags.ScalarDay; @@ -14,7 +21,7 @@ import org.xbib.time.chronic.tags.ScalarDay; import java.util.LinkedList; import java.util.List; -public class HandlerTest extends Assert { +public class HandlerTest { @Test public void testHandlerClass1() { @@ -22,12 +29,9 @@ public class HandlerTest extends Assert { List tokens = new LinkedList<>(); tokens.add(new Token("friday")); tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY)); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("afternoon")); tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON)); - assertFalse(handler.match(tokens, Handler.definitions())); } @@ -37,17 +41,12 @@ public class HandlerTest extends Assert { List tokens = new LinkedList<>(); tokens.add(new Token("friday")); tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY)); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("afternoon")); tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON)); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("afternoon")); tokens.get(2).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON)); - assertFalse(handler.match(tokens, Handler.definitions())); } @@ -57,12 +56,9 @@ public class HandlerTest extends Assert { List tokens = new LinkedList<>(); tokens.add(new Token("friday")); tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY)); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("afternoon")); tokens.get(1).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.AFTERNOON)); - assertFalse(handler.match(tokens, Handler.definitions())); } @@ -72,12 +68,9 @@ public class HandlerTest extends Assert { List tokens = new LinkedList<>(); tokens.add(new Token("may")); tokens.get(0).tag(new RepeaterMonthName(RepeaterMonthName.MonthName.MAY)); - assertFalse(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("27")); tokens.get(1).tag(new ScalarDay(27)); - assertTrue(handler.match(tokens, Handler.definitions())); } @@ -87,17 +80,12 @@ public class HandlerTest extends Assert { List tokens = new LinkedList<>(); tokens.add(new Token("friday")); tokens.get(0).tag(new RepeaterDayName(RepeaterDayName.DayName.FRIDAY)); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("5:00")); tokens.get(1).tag(new RepeaterTime("5:00")); - assertTrue(handler.match(tokens, Handler.definitions())); - tokens.add(new Token("pm")); tokens.get(2).tag(new EnumRepeaterDayPortion(RepeaterDayPortion.DayPortion.PM)); - assertTrue(handler.match(tokens, Handler.definitions())); } @@ -108,11 +96,9 @@ public class HandlerTest extends Assert { tokens.add(new Token("3")); tokens.add(new Token("years")); tokens.add(new Token("past")); - tokens.get(0).tag(new Scalar(3)); tokens.get(1).tag(new RepeaterYear()); tokens.get(2).tag(new Pointer(Pointer.PointerType.PAST)); - assertTrue(handler.match(tokens, Handler.definitions())); } } diff --git a/src/test/java/org/xbib/time/chronic/NumerizerTest.java b/src/test/java/org/xbib/time/chronic/NumerizerTest.java index 5c0d595..681d6e4 100644 --- a/src/test/java/org/xbib/time/chronic/NumerizerTest.java +++ b/src/test/java/org/xbib/time/chronic/NumerizerTest.java @@ -1,13 +1,13 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.numerizer.Numerizer; import java.util.LinkedHashMap; import java.util.Map; -public class NumerizerTest extends Assert { +public class NumerizerTest { @Test public void testStraightParsing() { diff --git a/src/test/java/org/xbib/time/chronic/ParserTest.java b/src/test/java/org/xbib/time/chronic/ParserTest.java index 102de01..f57b58c 100644 --- a/src/test/java/org/xbib/time/chronic/ParserTest.java +++ b/src/test/java/org/xbib/time/chronic/ParserTest.java @@ -1,17 +1,18 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.tags.Pointer; import java.text.ParseException; import java.time.ZoneId; import java.time.ZonedDateTime; -public class ParserTest extends Assert { +public class ParserTest { private static final ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime time_2006_08_16_14_00_00 = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime time_2006_08_16_14_00_00 = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month) { return ZonedDateTime.of(year, month, 1, 0, 0, 0, 0, ZONE_ID); @@ -33,10 +34,9 @@ public class ParserTest extends Assert { return ZonedDateTime.of(year, month, day, hour, minutes, seconds, 0, ZONE_ID); } - protected void assertEquals(ZonedDateTime ec, Span ac) { if (ec != null) { - assertEquals(ec, ac.getBeginCalendar()); + Assertions.assertEquals(ec, ac.getBeginCalendar()); } } @@ -642,24 +642,24 @@ public class ParserTest extends Assert { public void test_parse_span() throws ParseException { Span span; span = parse_now("friday", new Options().setGuess(false)); - assertEquals(construct(2006, 8, 18), span.getBeginCalendar()); - assertEquals(construct(2006, 8, 19), span.getEndCalendar()); + Assertions.assertEquals(construct(2006, 8, 18), span.getBeginCalendar()); + Assertions.assertEquals(construct(2006, 8, 19), span.getEndCalendar()); span = parse_now("november", new Options().setGuess(false)); - assertEquals(construct(2006, 11), span.getBeginCalendar()); - assertEquals(construct(2006, 12), span.getEndCalendar()); + Assertions.assertEquals(construct(2006, 11), span.getBeginCalendar()); + Assertions.assertEquals(construct(2006, 12), span.getEndCalendar()); Options options = new Options().setNow(time_2006_08_16_14_00_00).setGuess(false); span = Chronic.parse("weekend", options); - assertEquals(construct(2006, 8, 19), span.getBeginCalendar()); - assertEquals(construct(2006, 8, 21), span.getEndCalendar()); + Assertions.assertEquals(construct(2006, 8, 19), span.getBeginCalendar()); + Assertions.assertEquals(construct(2006, 8, 21), span.getEndCalendar()); } @Test public void test_parse_words() { - assertEquals(parse_now("33 days from now"), parse_now("thirty-three days from now")); - assertEquals(parse_now("2867532 seconds from now"), parse_now("two million eight hundred and sixty seven thousand five hundred and thirty two seconds from now")); - assertEquals(parse_now("may 10th"), parse_now("may tenth")); + Assertions.assertEquals(parse_now("33 days from now"), parse_now("thirty-three days from now")); + Assertions.assertEquals(parse_now("2867532 seconds from now"), parse_now("two million eight hundred and sixty seven thousand five hundred and thirty two seconds from now")); + Assertions.assertEquals(parse_now("may 10th"), parse_now("may tenth")); } @Test @@ -683,5 +683,4 @@ public class ParserTest extends Assert { } return null; } - } diff --git a/src/test/java/org/xbib/time/chronic/RepeaterDayNameTest.java b/src/test/java/org/xbib/time/chronic/RepeaterDayNameTest.java index 7209146..880ef4f 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterDayNameTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterDayNameTest.java @@ -1,17 +1,18 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterDayName; import org.xbib.time.chronic.tags.Pointer; import java.time.ZoneId; import java.time.ZonedDateTime; -public class RepeaterDayNameTest extends Assert { +public class RepeaterDayNameTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day) { return ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterFortnightTest.java b/src/test/java/org/xbib/time/chronic/RepeaterFortnightTest.java index c5b1348..7fb6352 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterFortnightTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterFortnightTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterFortnight; import org.xbib.time.chronic.repeaters.RepeaterWeek; import org.xbib.time.chronic.tags.Pointer; @@ -10,10 +10,11 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterFortnightTest extends Assert { +public class RepeaterFortnightTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day) { return ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterHourTest.java b/src/test/java/org/xbib/time/chronic/RepeaterHourTest.java index 39ed871..b5845ae 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterHourTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterHourTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterHour; import org.xbib.time.chronic.tags.Pointer; @@ -9,7 +9,7 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterHourTest extends Assert { +public class RepeaterHourTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterMonthNameTest.java b/src/test/java/org/xbib/time/chronic/RepeaterMonthNameTest.java index 7274140..30f01fd 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterMonthNameTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterMonthNameTest.java @@ -1,17 +1,18 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterMonthName; import org.xbib.time.chronic.tags.Pointer; import java.time.ZoneId; import java.time.ZonedDateTime; -public class RepeaterMonthNameTest extends Assert { +public class RepeaterMonthNameTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month) { return ZonedDateTime.of(year, month, 1, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterMonthTest.java b/src/test/java/org/xbib/time/chronic/RepeaterMonthTest.java index 0940599..03378cf 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterMonthTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterMonthTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterMonth; import org.xbib.time.chronic.tags.Pointer; @@ -9,10 +9,11 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterMonthTest extends Assert { +public class RepeaterMonthTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day, int hour) { return ZonedDateTime.of(year, month, day, hour, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterTimeTest.java b/src/test/java/org/xbib/time/chronic/RepeaterTimeTest.java index 2117cc8..e00b656 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterTimeTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterTimeTest.java @@ -1,17 +1,18 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterTime; import org.xbib.time.chronic.tags.Pointer; import java.time.ZoneId; import java.time.ZonedDateTime; -public class RepeaterTimeTest extends Assert { +public class RepeaterTimeTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day, int hour) { return ZonedDateTime.of(year, month, day, hour, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterWeekTest.java b/src/test/java/org/xbib/time/chronic/RepeaterWeekTest.java index ee53bb2..446d581 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterWeekTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterWeekTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterWeek; import org.xbib.time.chronic.tags.Pointer; @@ -9,10 +9,11 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterWeekTest extends Assert { +public class RepeaterWeekTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day) { return ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterWeekendTest.java b/src/test/java/org/xbib/time/chronic/RepeaterWeekendTest.java index 40a673d..ab4ef77 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterWeekendTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterWeekendTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterWeekend; import org.xbib.time.chronic.tags.Pointer; @@ -9,10 +9,11 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterWeekendTest extends Assert { +public class RepeaterWeekendTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day) { return ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/RepeaterYearTest.java b/src/test/java/org/xbib/time/chronic/RepeaterYearTest.java index 76b51f6..31d4026 100644 --- a/src/test/java/org/xbib/time/chronic/RepeaterYearTest.java +++ b/src/test/java/org/xbib/time/chronic/RepeaterYearTest.java @@ -1,7 +1,7 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.repeaters.RepeaterYear; import org.xbib.time.chronic.tags.Pointer; @@ -9,10 +9,11 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -public class RepeaterYearTest extends Assert { +public class RepeaterYearTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); - private ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); + + private final ZonedDateTime now = construct(2006, 8, 16, 14, 0, 0); public static ZonedDateTime construct(int year, int month, int day) { return ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZONE_ID); diff --git a/src/test/java/org/xbib/time/chronic/SpanTest.java b/src/test/java/org/xbib/time/chronic/SpanTest.java index dbd522e..be43070 100644 --- a/src/test/java/org/xbib/time/chronic/SpanTest.java +++ b/src/test/java/org/xbib/time/chronic/SpanTest.java @@ -1,12 +1,11 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import java.time.ZoneId; import java.time.ZonedDateTime; -public class SpanTest extends Assert { +public class SpanTest { private final static ZoneId ZONE_ID = ZoneId.of("GMT"); diff --git a/src/test/java/org/xbib/time/chronic/TokenTest.java b/src/test/java/org/xbib/time/chronic/TokenTest.java index bbf9947..f13c642 100644 --- a/src/test/java/org/xbib/time/chronic/TokenTest.java +++ b/src/test/java/org/xbib/time/chronic/TokenTest.java @@ -1,11 +1,13 @@ package org.xbib.time.chronic; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import org.xbib.time.chronic.tags.Scalar; import org.xbib.time.chronic.tags.StringTag; -public class TokenTest extends Assert { +public class TokenTest { @Test public void testToken() { diff --git a/src/test/java/org/xbib/time/format/PeriodFormatterBuilderTest.java b/src/test/java/org/xbib/time/format/PeriodFormatterBuilderTest.java index 5957c27..a448cfb 100644 --- a/src/test/java/org/xbib/time/format/PeriodFormatterBuilderTest.java +++ b/src/test/java/org/xbib/time/format/PeriodFormatterBuilderTest.java @@ -1,15 +1,14 @@ package org.xbib.time.format; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; +import java.io.IOException; import java.time.Period; -import static org.junit.Assert.assertEquals; - public class PeriodFormatterBuilderTest { @Test - public void test() { + public void test() throws IOException { PeriodFormatter yearsAndMonths = new PeriodFormatterBuilder() .appendYears() .appendSuffix(" year", " years") @@ -17,8 +16,6 @@ public class PeriodFormatterBuilderTest { .appendMonths() .appendSuffix(" month", " months") .toFormatter(); - assertEquals("3 years and 2 months", yearsAndMonths.print(Period.of(3, 2, 1))); - } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeAPIManipulationTest.java b/src/test/java/org/xbib/time/pretty/PrettyTimeAPIManipulationTest.java index 4164d38..c47ab48 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeAPIManipulationTest.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeAPIManipulationTest.java @@ -1,79 +1,78 @@ package org.xbib.time.pretty; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.JustNow; - import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - public class PrettyTimeAPIManipulationTest { private List list = null; - private PrettyTime t = new PrettyTime(); + private final PrettyTime t = new PrettyTime(); - private TimeUnitQuantity timeUnitQuantity = null; + private final TimeUnitQuantity timeUnitQuantity = null; @Test - public void testApiMisuse3() throws Exception { + public void testApiMisuse3() { t.clearUnits(); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse6() throws Exception { - t.format(list); - } - - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse8() throws Exception { - t.formatUnrounded(timeUnitQuantity); - } - - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse9() throws Exception { - t.getFormat(null); + @Test + public void testApiMisuse6() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.format(list)); } @Test - public void testApiMisuse10() throws Exception { + public void testApiMisuse8() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.formatUnrounded(timeUnitQuantity)); + } + + @Test + public void testApiMisuse9() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.getFormat(null)); + } + + @Test + public void testApiMisuse10() { t.getLocale(); } @Test - public void testApiMisuse12() throws Exception { + public void testApiMisuse12() { t.getUnits(); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse13() throws Exception { - t.registerUnit(null, null); + @Test + public void testApiMisuse13() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.registerUnit(null, null)); } @Test - public void testApiMisuse15() throws Exception { + public void testApiMisuse15() { t.toString(); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse16() throws Exception { - t.removeUnit((Class) null); + @Test + public void testApiMisuse16() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.removeUnit((Class) null)); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse17() throws Exception { - t.removeUnit((TimeUnit) null); + @Test + public void testApiMisuse17() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.removeUnit((TimeUnit) null)); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse18() throws Exception { - t.getUnit(null); + @Test + public void testApiMisuse18() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.getUnit(null)); } - @Test(expected = IllegalArgumentException.class) - public void testApiMisuse19() throws Exception { - t.getUnit(null); + @Test + public void testApiMisuse19() { + Assertions.assertThrows(IllegalArgumentException.class, () -> t.getUnit(null)); } @Test diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_AR_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_AR_Test.java index 8159155..d81cc3e 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_AR_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_AR_Test.java @@ -1,9 +1,10 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -11,142 +12,137 @@ import java.time.temporal.ChronoField; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_AR_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("ar"); + Locale locale = new Locale("ar"); Locale.setDefault(locale); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime localDateTime = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime p = new PrettyTime(localDateTime); assertEquals("1 شهر مضت", p.format(LocalDateTime.of(2009, 5, 20, 0, 0))); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("بعد لحظات", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("بعد لحظات", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("12 دقائق من الآن", t.format(1000 * 60 * 12)); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 ساعات من الآن", t.format(1000 * 60 * 60 * 3)); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 ايام من الآن", t.format(1000 * 60 * 60 * 24 * 3)); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 أسابيع من الآن", t.format(1000 * 60 * 60 * 24 * 7 * 3)); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 أشهر من الآن", t.format(2629743830L * 3L)); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 سنوات من الآن", t.format(2629743830L * 12L * 3L)); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 عقود من الآن", t.format(315569259747L * 3L)); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 قرون من الآن", t.format(3155692597470L * 3L)); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(6000), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("منذ لحظات", t.format(0)); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 12), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("12 دقائق مضت", t.format(0)); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 ساعات مضت", t.format(0)); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 ايام مضت", t.format(0)); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 7 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 أسابيع مضت", t.format(0)); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 أشهر مضت", t.format(0)); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); TimeUnit unit = new TimeUnit() { @@ -175,35 +171,35 @@ public class PrettyTimeI18n_AR_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L * 12L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 سنوات مضت", t.format(0)); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(315569259747L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 عقود مضت", t.format(0)); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(3155692597470L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 قرون مضت", t.format(0)); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minus(6543990, ChronoField.MILLI_OF_SECOND.getBaseUnit()); assertEquals("2 ساعات مضت", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -213,7 +209,7 @@ public class PrettyTimeI18n_AR_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -223,7 +219,7 @@ public class PrettyTimeI18n_AR_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); List timeUnitQuantities = t.calculatePreciseDuration(LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault())); @@ -231,7 +227,7 @@ public class PrettyTimeI18n_AR_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault())); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -239,14 +235,14 @@ public class PrettyTimeI18n_AR_Test { } @Test - public void testSetLocale() throws Exception { + public void testSetLocale() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(315569259747L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("3 عقود مضت", t.format(0)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_BG_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_BG_Test.java index dd9cd16..c550b13 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_BG_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_BG_Test.java @@ -1,206 +1,202 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_BG_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("bg"); + Locale locale = new Locale("bg"); Locale.setDefault(locale); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 века", t.format(3155692597470L * 3L)); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(3155692597470L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 века", t.format(0)); } @Test - public void testCenturySingular() throws Exception { + public void testCenturySingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(3155692597470L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 век", t.format(0)); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 дни", t.format(1000 * 60 * 60 * 24 * 3)); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 дни", t.format(0)); } @Test - public void testDaySingular() throws Exception { + public void testDaySingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 ден", t.format(0)); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(315569259747L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 десетилетия", t.format(0)); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 десетилетия", t.format(315569259747L * 3L)); } @Test - public void testDecadeSingular() throws Exception { + public void testDecadeSingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 1 десетилетие", t.format(315569259747L)); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 часа", t.format(1000 * 60 * 60 * 3)); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 часа", t.format(0)); } @Test - public void testHourSingular() throws Exception { + public void testHourSingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 час", t.format(0)); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("в момента", t.format(LocalDateTime.now())); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(6000), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("току що", t.format(0)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 12 минути", t.format(1000 * 60 * 12)); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 12), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 12 минути", t.format(0)); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 месеца", t.format((2629743830L * 3L))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 месеца", t.format(0)); } @Test - public void testMonthSingular() throws Exception { + public void testMonthSingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 месец", t.format(0)); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 седмици", t.format(1000 * 60 * 60 * 24 * 7 * 3)); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 7 * 3), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 седмици", t.format(0)); } @Test - public void testWeekSingular() throws Exception { + public void testWeekSingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 7), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 седмица", t.format(0)); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("след 3 години", t.format(2629743830L * 12L * 3L)); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L * 12L * 3L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 3 години", t.format(0)); } @Test - public void testYearSingular() throws Exception { + public void testYearSingular() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(2629743830L * 12L), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(localDateTime); assertEquals("преди 1 година", t.format(0)); } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault())); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0L), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -208,7 +204,7 @@ public class PrettyTimeI18n_BG_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(0L), ZoneId.systemDefault())); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -216,9 +212,8 @@ public class PrettyTimeI18n_BG_Test { assertEquals("след 3 дни 15 часа 38 минути", t.format(timeUnitQuantities)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } - } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CA_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CA_Test.java index 73d20f1..2f4c23f 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CA_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CA_Test.java @@ -1,33 +1,29 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_CA_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("ca"); + Locale locale = new Locale("ca"); Locale.setDefault(locale); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, new Locale("ca")); @@ -35,103 +31,103 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("en un instant", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime(0); assertEquals("en un instant", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 12 minuts", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 hores", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 dies", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 setmanes", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 mesos", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 anys", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 desenis", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("dintre de 3 segles", t.format((3155692597470L * 3L))); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime(6000); assertEquals("fa uns instants", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 12); assertEquals("fa 12 minuts", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 3); assertEquals("fa 3 hores", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3); assertEquals("fa 3 dies", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 7 * 3); assertEquals("fa 3 setmanes", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime(2629743830L * 3L); assertEquals("fa 3 mesos", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime(0); TimeUnit unit = new TimeUnit() { @Override @@ -159,32 +155,32 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime(2629743830L * 12L * 3L); assertEquals("fa 3 anys", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime(315569259747L * 3L); assertEquals("fa 3 desenis", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime(3155692597470L * 3L); assertEquals("fa 3 segles", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusHours(2); assertEquals("fa 2 hores", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -194,7 +190,7 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -204,7 +200,7 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -212,7 +208,7 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(0); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -221,15 +217,15 @@ public class PrettyTimeI18n_CA_Test { } @Test - public void testSetLocale() throws Exception { + public void testSetLocale() { PrettyTime t = new PrettyTime(315569259747L * 3L); assertEquals("fa 3 desenis", t.format((0))); t.setLocale(Locale.GERMAN); assertEquals("vor 3 Jahrzehnten", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CS_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CS_Test.java index 90c24a1..2982076 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CS_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_CS_Test.java @@ -1,12 +1,11 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.JustNow; import org.xbib.time.pretty.units.Month; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -14,23 +13,19 @@ import java.time.temporal.ChronoField; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_CS_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("cs"); + Locale locale = new Locale("cs"); Locale.setDefault(locale); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref); @@ -38,19 +33,19 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("za chvíli", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime(0); assertEquals("za chvíli", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0); for (TimeUnit u : t.getUnits()) { if (u instanceof JustNow) { @@ -63,7 +58,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 1 hodinu", t.format(1000 * 60 * 60)); @@ -72,7 +67,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 1 den", t.format(1000 * 60 * 60 * 24)); assertEquals("za 3 dny", t.format(1000 * 60 * 60 * 24 * 3)); @@ -80,7 +75,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime(0); for (TimeUnit u : t.getUnits()) { if (u instanceof Month) { @@ -93,7 +88,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 1 měsíc", t.format(2629743830L)); assertEquals("za 3 měsíce", t.format(2629743830L * 3L)); @@ -101,7 +96,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 1 rok", t.format(2629743830L * 12L)); assertEquals("za 3 roky", t.format(2629743830L * 12L * 3L)); @@ -109,13 +104,13 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 3 desetiletí", t.format(315569259747L * 3L)); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("za 3 století", t.format(3155692597470L * 3L)); } @@ -124,19 +119,19 @@ public class PrettyTimeI18n_CS_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime(6000); assertEquals("před chvílí", t.format(0)); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 12); assertEquals("před 12 minutami", t.format(0)); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { LocalDateTime base = LocalDateTime.now(); PrettyTime t = new PrettyTime(base); assertEquals("před 1 hodinou", t.format(base.minusHours(1))); @@ -144,7 +139,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { LocalDateTime base = LocalDateTime.now(); PrettyTime t = new PrettyTime(base); assertEquals("před 1 dnem", t.format(base.minusDays(1))); @@ -152,7 +147,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { LocalDateTime base = LocalDateTime.now(); PrettyTime t = new PrettyTime(base); assertEquals("před 1 týdnem", t.format(base.minusWeeks(1))); @@ -160,7 +155,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { LocalDateTime base = LocalDateTime.now(); PrettyTime t = new PrettyTime(base); @@ -169,7 +164,7 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { LocalDateTime base = LocalDateTime.now(); PrettyTime t = new PrettyTime(base); for (TimeUnit u : t.getUnits()) { @@ -182,19 +177,19 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime(315569259747L * 3L); assertEquals("před 3 desetiletími", t.format(0)); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime(3155692597470L * 3L); assertEquals("před 3 stoletími", t.format(0)); } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -202,29 +197,24 @@ public class PrettyTimeI18n_CS_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(0); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); assertEquals("za 3 dny 15 hodin 38 minut", t.format(timeUnitQuantities)); } - /** - * Tests formatApproximateDuration and by proxy, formatDuration. - * - * @throws Exception exception - */ @Test - public void testFormatApproximateDuration() throws Exception { + public void testFormatApproximateDuration() { LocalDateTime localDateTime = LocalDateTime.now(); LocalDateTime tenMinAgo = localDateTime.minus(10, ChronoField.MINUTE_OF_DAY.getBaseUnit()); PrettyTime t = new PrettyTime(); String result = t.formatApproximateDuration(tenMinAgo); - Assert.assertEquals("10 minutami", result); + assertEquals("10 minutami", result); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_DA_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_DA_Test.java index 87bac2b..e0916b1 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_DA_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_DA_Test.java @@ -1,22 +1,20 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_DA_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("da"); Locale.setDefault(locale); @@ -38,7 +36,7 @@ public class PrettyTimeI18n_DA_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -46,121 +44,121 @@ public class PrettyTimeI18n_DA_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("straks", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime(0, locale); assertEquals("straks", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 12 minutter", t.format(1000 * 60 * 12)); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 3 timer", t.format(1000 * 60 * 60 * 3)); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 3 dage", t.format(1000 * 60 * 60 * 24 * 3)); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 3 uger", t.format(1000 * 60 * 60 * 24 * 7 * 3)); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 3 måneder", t.format(2629743830L * 3L)); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("om 3 år", t.format(2629743830L * 12L * 3L)); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 årtier fra nu", t.format(315569259747L * 3L)); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 århundreder fra nu", t.format(3155692597470L * 3L)); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime(6000, locale); assertEquals("et øjeblik siden", t.format(0)); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 minutter siden", t.format(0)); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 timer siden", t.format(0)); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 dage siden", t.format(0)); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 uger siden", t.format(0)); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 måneder siden", t.format(0)); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 år siden", t.format(0)); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 årtier siden", t.format(0)); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 århundreder siden", t.format(0)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_ET_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_ET_Test.java index 0eaf932..b380706 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_ET_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_ET_Test.java @@ -1,10 +1,10 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.JustNow; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -12,299 +12,297 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_ET_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("et"); Locale.setDefault(locale); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("hetke pärast", t.format(6000)); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("hetk tagasi", t.format(0)); } @Test - public void testMilliSecondsFromNow() throws Exception { + public void testMilliSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow(0, locale); assertEquals("13 millisekundi pärast", t.format(13)); } @Test - public void testMilliSecondsAgo() throws Exception { + public void testMilliSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow((13), locale); assertEquals("13 millisekundit tagasi", t.format(0)); } @Test - public void testMilliSecondFromNow() throws Exception { + public void testMilliSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow(0, locale); assertEquals("millisekundi pärast", t.format(1)); } @Test - public void testMilliSecondAgo() throws Exception { + public void testMilliSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow(1, locale); assertEquals("millisekund tagasi", t.format(0)); } @Test - public void testSecondsFromNow() throws Exception { + public void testSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow(0, locale); assertEquals("13 sekundi pärast", t.format(1000 * 13)); } @Test - public void testSecondsAgo() throws Exception { + public void testSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow(1000 * 13, locale); assertEquals("13 sekundit tagasi", t.format(0)); } @Test - public void testSecondFromNow() throws Exception { + public void testSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow(0, locale); assertEquals("sekundi pärast", t.format(1000)); } @Test - public void testSecondAgo() throws Exception { + public void testSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow(1000, locale); assertEquals("sekund tagasi", t.format(0)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("13 minuti pärast", t.format(1000 * 60 * 13)); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 13), locale); assertEquals("13 minutit tagasi", t.format(0)); } @Test - public void testMinuteFromNow() throws Exception { + public void testMinuteFromNow() { PrettyTime t = newPrettyTimeWOJustNow(0, locale); assertEquals("minuti pärast", t.format(1000 * 60)); } @Test - public void testMinuteAgo() throws Exception { + public void testMinuteAgo() { PrettyTime t = newPrettyTimeWOJustNow(1000 * 60, locale); assertEquals("minut tagasi", t.format(0)); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 tunni pärast", t.format(1000 * 60 * 60 * 3)); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 tundi tagasi", t.format(0)); } @Test - public void testHoursFromNowSingle() throws Exception { + public void testHoursFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("tunni pärast", t.format(1000 * 60 * 60)); } @Test - public void testHoursAgoSingle() throws Exception { + public void testHoursAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60), locale); assertEquals("tund tagasi", t.format(0)); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 päeva pärast", t.format(1000 * 60 * 60 * 24 * 3)); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 päeva tagasi", t.format(0)); } @Test - public void testDaysFromNowSingle() throws Exception { + public void testDaysFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("homme", t.format(1000 * 60 * 60 * 24)); } @Test - public void testDaysAgoSingle() throws Exception { + public void testDaysAgoSingle() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24, locale); assertEquals("eile", t.format(0)); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 nädala pärast", t.format(1000 * 60 * 60 * 24 * 7 * 3)); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 7 * 3, locale); assertEquals("3 nädalat tagasi", t.format(0)); } @Test - public void testWeeksFromNowSingle() throws Exception { + public void testWeeksFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("nädala pärast", t.format(1000 * 60 * 60 * 24 * 7)); } @Test - public void testWeeksAgoSingle() throws Exception { + public void testWeeksAgoSingle() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 7, locale); assertEquals("nädal tagasi", t.format(0)); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 kuu pärast", t.format(1000L * 60 * 60 * 24 * 30 * 3)); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 30 * 3, locale); assertEquals("3 kuud tagasi", t.format(0)); } @Test - public void testMonthFromNow() throws Exception { + public void testMonthFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("kuu pärast", t.format(1000L * 60 * 60 * 24 * 30)); } @Test - public void testMonthAgo() throws Exception { + public void testMonthAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 30, locale); assertEquals("kuu tagasi", t.format(0)); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 aasta pärast", t.format(1000L * 60 * 60 * 24 * 365 * 3)); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 3), locale); assertEquals("3 aastat tagasi", t.format(0)); } @Test - public void testYearFromNow() throws Exception { + public void testYearFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("aasta pärast", t.format(1000L * 60 * 60 * 24 * 366)); } @Test - public void testYearAgo() throws Exception { + public void testYearAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 366, locale); assertEquals("aasta tagasi", t.format(0)); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 aastakümne pärast", t.format(1000L * 60 * 60 * 24 * 365 * 10 * 3)); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 365 * 10 * 3, locale); assertEquals("3 aastakümmet tagasi", t.format(0)); } @Test - public void testDecadeFromNow() throws Exception { + public void testDecadeFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("aastakümne pärast", t.format(1000L * 60 * 60 * 24 * 365 * 11)); } @Test - public void testDecadeAgo() throws Exception { + public void testDecadeAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 365 * 11, locale); assertEquals("aastakümme tagasi", t.format(0)); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 sajandi pärast", t.format(1000L * 60 * 60 * 24 * 365 * 100 * 3)); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 100 * 3), locale); assertEquals("3 sajandit tagasi", t.format(0)); } @Test - public void testCenturyFromNow() throws Exception { + public void testCenturyFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("sajandi pärast", t.format(1000L * 60 * 60 * 24 * 365 * 101)); } @Test - public void testCenturyAgo() throws Exception { + public void testCenturyAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 101), locale); assertEquals("sajand tagasi", t.format(0)); } @Test - public void testMillenniaFromNow() throws Exception { + public void testMillenniaFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 aastatuhande pärast", t.format(1000L * 60 * 60 * 24 * 365 * 1000 * 3)); } @Test - public void testMillenniaAgo() throws Exception { + public void testMillenniaAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1000 * 3), locale); assertEquals("3 aastatuhandet tagasi", t.format(0)); } @Test - public void testMillenniumFromNow() throws Exception { + public void testMillenniumFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("aastatuhande pärast", t.format(1000L * 60 * 60 * 24 * 365 * 1001)); } @Test - public void testMillenniumAgo() throws Exception { + public void testMillenniumAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1001), locale); assertEquals("aastatuhat tagasi", t.format(0)); } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -312,7 +310,7 @@ public class PrettyTimeI18n_ET_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0), locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -339,8 +337,8 @@ public class PrettyTimeI18n_ET_Test { return t; } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FA_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FA_Test.java index a476989..7a1971b 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FA_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FA_Test.java @@ -1,33 +1,29 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_FA_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("fa"); + Locale locale = new Locale("fa"); Locale.setDefault(locale); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2012, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2012, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref); @@ -35,61 +31,61 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("چند لحظه دیگر", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime(0); assertEquals("چند لحظه دیگر", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("12 دقیقه دیگر", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 ساعت دیگر", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 روز دیگر", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 هفته دیگر", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 ماه دیگر", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 سال دیگر", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 دهه دیگر", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 قرن دیگر", t.format((3155692597470L * 3L))); } @@ -98,43 +94,43 @@ public class PrettyTimeI18n_FA_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime(6000); assertEquals("چند لحظه پیش", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 12); assertEquals("12 دقیقه پیش", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 3); assertEquals("3 ساعت پیش", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3); assertEquals("3 روز پیش", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 7 * 3); assertEquals("3 هفته پیش", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime(2629743830L * 3L); assertEquals("3 ماه پیش", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime(0); TimeUnit unit = new TimeUnit() { @Override @@ -162,32 +158,32 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime(2629743830L * 12L * 3L); assertEquals("3 سال پیش", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime(315569259747L * 3L); assertEquals("3 دهه پیش", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime(3155692597470L * 3L); assertEquals("3 قرن پیش", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(6543); assertEquals("2 ساعت پیش", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -198,7 +194,7 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -209,7 +205,7 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -217,7 +213,7 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(0); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -226,13 +222,13 @@ public class PrettyTimeI18n_FA_Test { } @Test - public void testSetLocale() throws Exception { + public void testSetLocale() { PrettyTime t = new PrettyTime(315569259747L * 3L); assertEquals("3 دهه پیش", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FI_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FI_Test.java index f708a24..fac2f8f 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FI_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FI_Test.java @@ -1,10 +1,10 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.JustNow; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -12,299 +12,297 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_FI_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("fi"); Locale.setDefault(locale); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("hetken päästä", t.format((6000))); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("hetki sitten", t.format((0))); } @Test - public void testMilliSecondsFromNow() throws Exception { + public void testMilliSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("13 millisekunnin päästä", t.format((13))); } @Test - public void testMilliSecondsAgo() throws Exception { + public void testMilliSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow((13), locale); assertEquals("13 millisekuntia sitten", t.format((0))); } @Test - public void testMilliSecondFromNow() throws Exception { + public void testMilliSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("millisekunnin päästä", t.format((1))); } @Test - public void testMilliSecondAgo() throws Exception { + public void testMilliSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow((1), locale); assertEquals("millisekunti sitten", t.format((0))); } @Test - public void testSecondsFromNow() throws Exception { + public void testSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("13 sekunnin päästä", t.format((1000 * 13))); } @Test - public void testSecondsAgo() throws Exception { + public void testSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000 * 13), locale); assertEquals("13 sekuntia sitten", t.format((0))); } @Test - public void testSecondFromNow() throws Exception { + public void testSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("sekunnin päästä", t.format((1000))); } @Test - public void testSecondAgo() throws Exception { + public void testSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000), locale); assertEquals("sekunti sitten", t.format((0))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("13 minuutin päästä", t.format((1000 * 60 * 13))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 13), locale); assertEquals("13 minuuttia sitten", t.format((0))); } @Test - public void testMinuteFromNow() throws Exception { + public void testMinuteFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("minuutin päästä", t.format((1000 * 60))); } @Test - public void testMinuteAgo() throws Exception { + public void testMinuteAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000 * 60), locale); assertEquals("minuutti sitten", t.format((0))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 tunnin päästä", t.format((1000 * 60 * 60 * 3))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 tuntia sitten", t.format((0))); } @Test - public void testHoursFromNowSingle() throws Exception { + public void testHoursFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("tunnin päästä", t.format((1000 * 60 * 60))); } @Test - public void testHoursAgoSingle() throws Exception { + public void testHoursAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60), locale); assertEquals("tunti sitten", t.format((0))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 päivän päästä", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24 * 3, locale); assertEquals("3 päivää sitten", t.format((0))); } @Test - public void testDaysFromNowSingle() throws Exception { + public void testDaysFromNowSingle() { PrettyTime t = new PrettyTime(0, locale); assertEquals("huomenna", t.format((1000 * 60 * 60 * 24))); } @Test - public void testDaysAgoSingle() throws Exception { + public void testDaysAgoSingle() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 24, locale); assertEquals("eilen", t.format((0))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 viikon päästä", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 viikkoa sitten", t.format((0))); } @Test - public void testWeeksFromNowSingle() throws Exception { + public void testWeeksFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("viikon päästä", t.format((1000 * 60 * 60 * 24 * 7))); } @Test - public void testWeeksAgoSingle() throws Exception { + public void testWeeksAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7), locale); assertEquals("viikko sitten", t.format((0))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("3 kuukauden päästä", t.format((1000L * 60 * 60 * 24 * 30 * 3))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime(1000L * 60 * 60 * 24 * 30 * 3, locale); assertEquals("3 kuukautta sitten", t.format((0))); } @Test - public void testMonthFromNow() throws Exception { + public void testMonthFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("kuukauden päästä", t.format((1000L * 60 * 60 * 24 * 30))); } @Test - public void testMonthAgo() throws Exception { + public void testMonthAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 30), locale); assertEquals("kuukausi sitten", t.format((0))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 vuoden päästä", t.format((1000L * 60 * 60 * 24 * 365 * 3))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 3), locale); assertEquals("3 vuotta sitten", t.format((0))); } @Test - public void testYearFromNow() throws Exception { + public void testYearFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("vuoden päästä", t.format((1000L * 60 * 60 * 24 * 366))); } @Test - public void testYearAgo() throws Exception { + public void testYearAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 366), locale); assertEquals("vuosi sitten", t.format((0))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 vuosikymmenen päästä", t.format((1000L * 60 * 60 * 24 * 365 * 10 * 3))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 10 * 3), locale); assertEquals("3 vuosikymmentä sitten", t.format((0))); } @Test - public void testDecadeFromNow() throws Exception { + public void testDecadeFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("vuosikymmenen päästä", t.format((1000L * 60 * 60 * 24 * 365 * 11))); } @Test - public void testDecadeAgo() throws Exception { + public void testDecadeAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 11), locale); assertEquals("vuosikymmen sitten", t.format((0))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 vuosisadan päästä", t.format((1000L * 60 * 60 * 24 * 365 * 100 * 3))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 100 * 3), locale); assertEquals("3 vuosisataa sitten", t.format((0))); } @Test - public void testCenturyFromNow() throws Exception { + public void testCenturyFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("vuosisadan päästä", t.format((1000L * 60 * 60 * 24 * 365 * 101))); } @Test - public void testCenturyAgo() throws Exception { + public void testCenturyAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 101), locale); assertEquals("vuosisata sitten", t.format((0))); } @Test - public void testMillenniaFromNow() throws Exception { + public void testMillenniaFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 vuosituhannen päästä", t.format((1000L * 60 * 60 * 24 * 365 * 1000 * 3))); } @Test - public void testMillenniaAgo() throws Exception { + public void testMillenniaAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1000 * 3), locale); assertEquals("3 vuosituhatta sitten", t.format((0))); } @Test - public void testMillenniumFromNow() throws Exception { + public void testMillenniumFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("vuosituhannen päästä", t.format((1000L * 60 * 60 * 24 * 365 * 1001))); } @Test - public void testMillenniumAgo() throws Exception { + public void testMillenniumAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1001), locale); assertEquals("vuosituhat sitten", t.format((0))); } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -312,7 +310,7 @@ public class PrettyTimeI18n_FI_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime(0, locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -340,8 +338,8 @@ public class PrettyTimeI18n_FI_Test { return t; } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FR_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FR_Test.java index cdfe3c9..130ec81 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FR_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_FR_Test.java @@ -1,25 +1,23 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_FR_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = Locale.FRENCH; Locale.setDefault(locale); @@ -55,9 +53,8 @@ public class PrettyTimeI18n_FR_Test { } } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } - } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_IT_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_IT_Test.java index 2e96182..81af9ad 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_IT_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_IT_Test.java @@ -1,10 +1,10 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.JustNow; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -12,299 +12,297 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_IT_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("it"); Locale.setDefault(locale); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra poco", t.format((6000))); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("poco fa", t.format((0))); } @Test - public void testMilliSecondsFromNow() throws Exception { + public void testMilliSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("fra 13 millisecondi", t.format((13))); } @Test - public void testMilliSecondsAgo() throws Exception { + public void testMilliSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow((13), locale); assertEquals("13 millisecondi fa", t.format((0))); } @Test - public void testMilliSecondFromNow() throws Exception { + public void testMilliSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("fra 1 millisecondo", t.format((1))); } @Test - public void testMilliSecondAgo() throws Exception { + public void testMilliSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow((1), locale); assertEquals("1 millisecondo fa", t.format((0))); } @Test - public void testSecondsFromNow() throws Exception { + public void testSecondsFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("fra 13 secondi", t.format((1000 * 13))); } @Test - public void testSecondsAgo() throws Exception { + public void testSecondsAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000 * 13), locale); assertEquals("13 secondi fa", t.format((0))); } @Test - public void testSecondFromNow() throws Exception { + public void testSecondFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("fra 1 secondo", t.format(1000)); } @Test - public void testSecondAgo() throws Exception { + public void testSecondAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000), locale); assertEquals("1 secondo fa", t.format((0))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 13 minuti", t.format((1000 * 60 * 13))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 13), locale); assertEquals("13 minuti fa", t.format((0))); } @Test - public void testMinuteFromNow() throws Exception { + public void testMinuteFromNow() { PrettyTime t = newPrettyTimeWOJustNow((0), locale); assertEquals("fra 1 minuto", t.format((1000 * 60))); } @Test - public void testMinuteAgo() throws Exception { + public void testMinuteAgo() { PrettyTime t = newPrettyTimeWOJustNow((1000 * 60), locale); assertEquals("1 minuto fa", t.format((0))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 ore", t.format((1000 * 60 * 60 * 3))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 ore fa", t.format((0))); } @Test - public void testHoursFromNowSingle() throws Exception { + public void testHoursFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 ora", t.format((1000 * 60 * 60))); } @Test - public void testHoursAgoSingle() throws Exception { + public void testHoursAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60), locale); assertEquals("1 ora fa", t.format((0))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 giorni", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 giorni fa", t.format((0))); } @Test - public void testDaysFromNowSingle() throws Exception { + public void testDaysFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 giorno", t.format((1000 * 60 * 60 * 24))); } @Test - public void testDaysAgoSingle() throws Exception { + public void testDaysAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24), locale); assertEquals("1 giorno fa", t.format((0))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 settimane", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 settimane fa", t.format((0))); } @Test - public void testWeeksFromNowSingle() throws Exception { + public void testWeeksFromNowSingle() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 settimana", t.format((1000 * 60 * 60 * 24 * 7))); } @Test - public void testWeeksAgoSingle() throws Exception { + public void testWeeksAgoSingle() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7), locale); assertEquals("1 settimana fa", t.format((0))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 mesi", t.format((1000L * 60 * 60 * 24 * 30 * 3))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 30 * 3), locale); assertEquals("3 mesi fa", t.format((0))); } @Test - public void testMonthFromNow() throws Exception { + public void testMonthFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 mese", t.format((1000L * 60 * 60 * 24 * 30))); } @Test - public void testMonthAgo() throws Exception { + public void testMonthAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 30), locale); assertEquals("1 mese fa", t.format((0))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 anni", t.format((1000L * 60 * 60 * 24 * 365 * 3))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 3), locale); assertEquals("3 anni fa", t.format((0))); } @Test - public void testYearFromNow() throws Exception { + public void testYearFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 anno", t.format((1000L * 60 * 60 * 24 * 366))); } @Test - public void testYearAgo() throws Exception { + public void testYearAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 366), locale); assertEquals("1 anno fa", t.format((0))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 decenni", t.format((1000L * 60 * 60 * 24 * 365 * 10 * 3))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 10 * 3), locale); assertEquals("3 decenni fa", t.format((0))); } @Test - public void testDecadeFromNow() throws Exception { + public void testDecadeFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 decennio", t.format((1000L * 60 * 60 * 24 * 365 * 11))); } @Test - public void testDecadeAgo() throws Exception { + public void testDecadeAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 11), locale); assertEquals("1 decennio fa", t.format((0))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 secoli", t.format((1000L * 60 * 60 * 24 * 365 * 100 * 3))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 100 * 3), locale); assertEquals("3 secoli fa", t.format((0))); } @Test - public void testCenturyFromNow() throws Exception { + public void testCenturyFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 secolo", t.format((1000L * 60 * 60 * 24 * 365 * 101))); } @Test - public void testCenturyAgo() throws Exception { + public void testCenturyAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 101), locale); assertEquals("1 secolo fa", t.format((0))); } @Test - public void testMillenniaFromNow() throws Exception { + public void testMillenniaFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 3 millenni", t.format((1000L * 60 * 60 * 24 * 365 * 1000 * 3))); } @Test - public void testMillenniaAgo() throws Exception { + public void testMillenniaAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1000 * 3), locale); assertEquals("3 millenni fa", t.format((0))); } @Test - public void testMillenniumFromNow() throws Exception { + public void testMillenniumFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("fra 1 millennio", t.format((1000L * 60 * 60 * 24 * 365 * 1001))); } @Test - public void testMillenniumAgo() throws Exception { + public void testMillenniumAgo() { PrettyTime t = new PrettyTime((1000L * 60 * 60 * 24 * 365 * 1001), locale); assertEquals("1 millennio fa", t.format((0))); } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -312,7 +310,7 @@ public class PrettyTimeI18n_IT_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0), locale); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -340,8 +338,8 @@ public class PrettyTimeI18n_IT_Test { return t; } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_KO_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_KO_Test.java index e5d51cc..6d7b382 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_KO_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_KO_Test.java @@ -1,33 +1,29 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_KO_Test { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = Locale.KOREA; + Locale locale = Locale.KOREA; Locale.setDefault(locale); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, Locale.KOREA); @@ -35,103 +31,103 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("지금", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0)); assertEquals("지금", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("12분 후", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3시간 후", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3일 후", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3주 후", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3개월 후", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3년 후", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("30년 후", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3세기 후", t.format((3155692597470L * 3L))); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000)); assertEquals("방금", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12)); assertEquals("12분 전", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3)); assertEquals("3시간 전", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3)); assertEquals("3일 전", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3)); assertEquals("3주 전", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L)); assertEquals("3개월 전", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime((0)); TimeUnit unit = new TimeUnit() { @Override @@ -159,32 +155,32 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L)); assertEquals("3년 전", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("30년 전", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L)); assertEquals("3세기 전", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(6544); assertEquals("2시간 전", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -195,7 +191,7 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -205,7 +201,7 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -213,7 +209,7 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -222,15 +218,15 @@ public class PrettyTimeI18n_KO_Test { } @Test - public void testSetLocale() throws Exception { + public void testSetLocale() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("30년 전", t.format((0))); t.setLocale(Locale.GERMAN); assertEquals("vor 3 Jahrzehnten", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NL_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NL_Test.java index b25f2d5..152015b 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NL_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NL_Test.java @@ -1,24 +1,22 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_NL_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("nl"); Locale.setDefault(locale); @@ -42,7 +40,7 @@ public class PrettyTimeI18n_NL_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -50,61 +48,61 @@ public class PrettyTimeI18n_NL_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("op dit moment", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("op dit moment", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 12 minuten", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 uur", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 dagen", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 weken", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 maanden", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 jaar", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 decennia", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("over 3 eeuwen", t.format((3155692597470L * 3L))); } @@ -113,61 +111,61 @@ public class PrettyTimeI18n_NL_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("een ogenblik geleden", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 minuten geleden", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 uur geleden", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 dagen geleden", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 weken geleden", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 maanden geleden", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 jaar geleden", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 decennia geleden", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 eeuwen geleden", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NO_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NO_Test.java index 68fd08e..d120e9f 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NO_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_NO_Test.java @@ -1,24 +1,22 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_NO_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("no"); Locale.setDefault(locale); @@ -42,7 +40,7 @@ public class PrettyTimeI18n_NO_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -50,61 +48,61 @@ public class PrettyTimeI18n_NO_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("straks", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("straks", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 12 minutter", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 timer", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 dager", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 uker", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 måneder", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 år", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 tiår fra nå", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 århundre fra nå", t.format((3155692597470L * 3L))); } @@ -113,61 +111,61 @@ public class PrettyTimeI18n_NO_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("et øyeblikk siden", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 minutter siden", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 timer siden", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 dager siden", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 uker siden", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 måneder siden", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 år siden", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 tiår siden", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 århundre siden", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_RU_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_RU_Test.java index aa595cc..b369770 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_RU_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_RU_Test.java @@ -1,24 +1,22 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_RU_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("ru"); Locale.setDefault(locale); @@ -42,7 +40,7 @@ public class PrettyTimeI18n_RU_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -50,61 +48,61 @@ public class PrettyTimeI18n_RU_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("сейчас", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("сейчас", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 12 минут", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 часа", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 дня", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 недели", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 месяца", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 года", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 десятилетия", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 века", t.format((3155692597470L * 3L))); } @@ -113,61 +111,61 @@ public class PrettyTimeI18n_RU_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("только что", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 минут назад", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 часа назад", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 дня назад", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 недели назад", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 месяца назад", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 года назад", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 десятилетия назад", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 века назад", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_SV_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_SV_Test.java index 0a5d0a1..6d0feff 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_SV_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_SV_Test.java @@ -1,24 +1,22 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_SV_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("sv"); Locale.setDefault(locale); @@ -42,7 +40,7 @@ public class PrettyTimeI18n_SV_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); @@ -51,61 +49,61 @@ public class PrettyTimeI18n_SV_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("om en stund", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om en stund", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 12 minuter", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 timmar", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 dagar", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 veckor", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 månader", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 år", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 årtionden", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("om 3 århundraden", t.format((3155692597470L * 3L))); } @@ -114,61 +112,61 @@ public class PrettyTimeI18n_SV_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("en stund sedan", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 minuter sedan", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 timmar sedan", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 dagar sedan", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 veckor sedan", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 månader sedan", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 år sedan", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 årtionden sedan", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 århundraden sedan", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_Test.java index 6726925..89c11eb 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_Test.java @@ -1,23 +1,21 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_Test { private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { locale = Locale.getDefault(); } @@ -120,8 +118,8 @@ public class PrettyTimeI18n_Test { } } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(locale); } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_UA_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_UA_Test.java index 0292d6d..01a00d0 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_UA_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_UA_Test.java @@ -1,24 +1,22 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_UA_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("ua"); Locale.setDefault(locale); @@ -42,7 +40,7 @@ public class PrettyTimeI18n_UA_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -50,61 +48,61 @@ public class PrettyTimeI18n_UA_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("зараз", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("зараз", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0, locale); assertEquals("через 12 хвилин", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 години", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 дні", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 тижні", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 місяці", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 роки", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 десятиліття", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("через 3 століття", t.format((3155692597470L * 3L))); } @@ -113,85 +111,85 @@ public class PrettyTimeI18n_UA_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("тільки що", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 хвилин тому", t.format((0))); } @Test - public void test1HourAgo() throws Exception { + public void test1HourAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60), locale); assertEquals("1 годину тому", t.format((0))); } @Test - public void test3HoursAgo() throws Exception { + public void test3HoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 години тому", t.format((0))); } @Test - public void test6HoursAgo() throws Exception { + public void test6HoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 6), locale); assertEquals("6 годин тому", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 дні тому", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 тижні тому", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 місяці тому", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 роки тому", t.format((0))); } @Test - public void test8YearsAgo() throws Exception { + public void test8YearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 8L), locale); assertEquals("8 років тому", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("3 десятиліття тому", t.format((0))); } @Test - public void test8DecadesAgo() throws Exception { + public void test8DecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 8L), locale); assertEquals("8 десятиліть тому", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 століття тому", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_hi_IN_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_hi_IN_Test.java index 849bcad..a6b62db 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_hi_IN_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_hi_IN_Test.java @@ -1,26 +1,24 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_hi_IN_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("hi", "IN"); Locale.setDefault(locale); @@ -41,7 +39,7 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref); @@ -49,66 +47,66 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("अभी", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0)); assertEquals("अभी", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("12 मिनट बाद", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 घंटे बाद", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 दिन बाद", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 सप्ताह बाद", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 महीने बाद", t.format((2629743830L * 3L))); //assertEquals("अभी से 3 महीने बाद", t.format((1000 * 60 * 60 * 24 * 365 * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 वर्ष बाद", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 दशक बाद", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 सदियों बाद", t.format((3155692597470L * 3L))); @@ -118,43 +116,43 @@ public class PrettyTimeI18n_hi_IN_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000)); assertEquals("अभी", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12)); assertEquals("12 मिनट पहले", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3)); assertEquals("3 घंटे पहले", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3)); assertEquals("3 दिन पहले", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3)); assertEquals("3 सप्ताह पहले", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L)); assertEquals("3 महीने पहले", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime((0)); TimeUnit unit = new TimeUnit() { @Override @@ -182,32 +180,32 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L)); assertEquals("3 वर्ष पहले", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("3 दशक पहले", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L)); assertEquals("3 सदियों पहले", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(6544); assertEquals("2 घंटे पहले", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -217,7 +215,7 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -227,7 +225,7 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); @@ -236,7 +234,7 @@ public class PrettyTimeI18n_hi_IN_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -244,8 +242,8 @@ public class PrettyTimeI18n_hi_IN_Test { assertEquals("3 दिन 15 घंटे 38 मिनट बाद", t.format(timeUnitQuantities)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_in_ID_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_in_ID_Test.java index 624f820..f190551 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_in_ID_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_in_ID_Test.java @@ -1,26 +1,24 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeI18n_in_ID_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = new Locale("in", "ID"); Locale.setDefault(locale); @@ -41,7 +39,7 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref); @@ -49,65 +47,65 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("dari sekarang", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0)); assertEquals("dari sekarang", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("12 menit dari sekarang", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0); assertEquals("3 jam dari sekarang", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 hari dari sekarang", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 minggu dari sekarang", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 bulan dari sekarang", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 tahun dari sekarang", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 dekade dari sekarang", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 abad dari sekarang", t.format((3155692597470L * 3L))); @@ -117,43 +115,43 @@ public class PrettyTimeI18n_in_ID_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000)); assertEquals("yang lalu", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12)); assertEquals("12 menit yang lalu", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3)); assertEquals("3 jam yang lalu", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3)); assertEquals("3 hari yang lalu", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3)); assertEquals("3 minggu yang lalu", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L)); assertEquals("3 bulan yang lalu", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime((0)); TimeUnit unit = new TimeUnit() { @Override @@ -181,32 +179,32 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L)); assertEquals("3 tahun yang lalu", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("3 dekade yang lalu", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L)); assertEquals("3 abad yang lalu", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(6544); assertEquals("2 jam yang lalu", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -216,7 +214,7 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -226,7 +224,7 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); @@ -235,7 +233,7 @@ public class PrettyTimeI18n_in_ID_Test { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -243,8 +241,8 @@ public class PrettyTimeI18n_in_ID_Test { assertEquals("3 hari 15 jam 38 menit dari sekarang", t.format(timeUnitQuantities)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_zh_TW_Test.java b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_zh_TW_Test.java index 176c215..94ff88f 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_zh_TW_Test.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeI18n_zh_TW_Test.java @@ -1,22 +1,20 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeI18n_zh_TW_Test { private Locale defaultLocale; private Locale locale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); locale = Locale.TRADITIONAL_CHINESE; Locale.setDefault(locale); @@ -38,7 +36,7 @@ public class PrettyTimeI18n_zh_TW_Test { } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref, locale); @@ -46,61 +44,61 @@ public class PrettyTimeI18n_zh_TW_Test { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(locale); assertEquals("剛剛", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0), locale); assertEquals("剛剛", t.format((600))); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("12 分鐘 後", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 小時 後", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 天 後", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 週 後", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 個月 後", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 年 後", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("30 年 後", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0), locale); assertEquals("3 世紀 後", t.format((3155692597470L * 3L))); } @@ -109,85 +107,85 @@ public class PrettyTimeI18n_zh_TW_Test { * Past */ @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000), locale); assertEquals("片刻之前", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12), locale); assertEquals("12 分鐘 前", t.format((0))); } @Test - public void test1HourAgo() throws Exception { + public void test1HourAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60), locale); assertEquals("1 小時 前", t.format((0))); } @Test - public void test3HoursAgo() throws Exception { + public void test3HoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3), locale); assertEquals("3 小時 前", t.format((0))); } @Test - public void test6HoursAgo() throws Exception { + public void test6HoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 6), locale); assertEquals("6 小時 前", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3), locale); assertEquals("3 天 前", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3), locale); assertEquals("3 週 前", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L), locale); assertEquals("3 個月 前", t.format((0))); } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L), locale); assertEquals("3 年 前", t.format((0))); } @Test - public void test8YearsAgo() throws Exception { + public void test8YearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 8L), locale); assertEquals("8 年 前", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L), locale); assertEquals("30 年 前", t.format((0))); } @Test - public void test8DecadesAgo() throws Exception { + public void test8DecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 8L), locale); assertEquals("80 年 前", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L), locale); assertEquals("3 世紀 前", t.format((0))); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeLocaleFallbackTest.java b/src/test/java/org/xbib/time/pretty/PrettyTimeLocaleFallbackTest.java index eb581e6..17f4b66 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeLocaleFallbackTest.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeLocaleFallbackTest.java @@ -1,26 +1,24 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeLocaleFallbackTest { private Locale defaultLocale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); Locale.setDefault(new Locale("Foo", "Bar")); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { assertEquals(new Locale("Foo", "Bar"), Locale.getDefault()); LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); @@ -28,8 +26,8 @@ public class PrettyTimeLocaleFallbackTest { assertEquals("1 month ago", t.format(then)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeNoSignTest.java b/src/test/java/org/xbib/time/pretty/PrettyTimeNoSignTest.java index 1559a69..cd3ee66 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeNoSignTest.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeNoSignTest.java @@ -1,8 +1,7 @@ package org.xbib.time.pretty; -import org.junit.Assert; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import java.util.List; import java.util.Locale; @@ -10,7 +9,7 @@ import java.util.Locale; public class PrettyTimeNoSignTest { @Test - public void testNoSuffixes() throws Exception { + public void testNoSuffixes() { LocalDateTime then = LocalDateTime.of(2009, 8, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 5, 17, 0, 0); PrettyTime p = new PrettyTime(ref, Locale.ENGLISH); @@ -22,7 +21,6 @@ public class PrettyTimeNoSignTest { ((SimpleTimeFormat) fmt).setFuturePrefix("").setFutureSuffix("").setPastPrefix("").setPastSuffix(""); } } - - Assert.assertEquals("3 months", p.format(then)); + assertEquals("3 months", p.format(then)); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeTest.java b/src/test/java/org/xbib/time/pretty/PrettyTimeTest.java index 65ca363..b9fb1f3 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeTest.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeTest.java @@ -1,30 +1,28 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class PrettyTimeTest { private Locale defaultLocale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); Locale.setDefault(Locale.ROOT); } @Test - public void testCeilingInterval() throws Exception { + public void testCeilingInterval() { LocalDateTime then = LocalDateTime.of(2009, 5, 20, 0, 0); LocalDateTime ref = LocalDateTime.of(2009, 6, 17, 0, 0); PrettyTime t = new PrettyTime(ref); @@ -32,103 +30,103 @@ public class PrettyTimeTest { } @Test - public void testRightNow() throws Exception { + public void testRightNow() { PrettyTime t = new PrettyTime(); assertEquals("moments from now", t.format(LocalDateTime.now())); } @Test - public void testRightNowVariance() throws Exception { + public void testRightNowVariance() { PrettyTime t = new PrettyTime((0)); assertEquals("moments from now", t.format(600)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("12 minutes from now", t.format((1000 * 60 * 12))); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 hours from now", t.format((1000 * 60 * 60 * 3))); } @Test - public void testDaysFromNow() throws Exception { + public void testDaysFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 days from now", t.format((1000 * 60 * 60 * 24 * 3))); } @Test - public void testWeeksFromNow() throws Exception { + public void testWeeksFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 weeks from now", t.format((1000 * 60 * 60 * 24 * 7 * 3))); } @Test - public void testMonthsFromNow() throws Exception { + public void testMonthsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 months from now", t.format((2629743830L * 3L))); } @Test - public void testYearsFromNow() throws Exception { + public void testYearsFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 years from now", t.format((2629743830L * 12L * 3L))); } @Test - public void testDecadesFromNow() throws Exception { + public void testDecadesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 decades from now", t.format((315569259747L * 3L))); } @Test - public void testCenturiesFromNow() throws Exception { + public void testCenturiesFromNow() { PrettyTime t = new PrettyTime((0)); assertEquals("3 centuries from now", t.format((3155692597470L * 3L))); } @Test - public void testMomentsAgo() throws Exception { + public void testMomentsAgo() { PrettyTime t = new PrettyTime((6000)); assertEquals("moments ago", t.format((0))); } @Test - public void testMinutesAgo() throws Exception { + public void testMinutesAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 12)); assertEquals("12 minutes ago", t.format((0))); } @Test - public void testHoursAgo() throws Exception { + public void testHoursAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 3)); assertEquals("3 hours ago", t.format((0))); } @Test - public void testDaysAgo() throws Exception { + public void testDaysAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3)); assertEquals("3 days ago", t.format((0))); } @Test - public void testWeeksAgo() throws Exception { + public void testWeeksAgo() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 7 * 3)); assertEquals("3 weeks ago", t.format((0))); } @Test - public void testMonthsAgo() throws Exception { + public void testMonthsAgo() { PrettyTime t = new PrettyTime((2629743830L * 3L)); assertEquals("3 months ago", t.format((0))); } @Test - public void testCustomFormat() throws Exception { + public void testCustomFormat() { PrettyTime t = new PrettyTime((0)); TimeUnit unit = new TimeUnit() { @Override @@ -156,32 +154,32 @@ public class PrettyTimeTest { } @Test - public void testYearsAgo() throws Exception { + public void testYearsAgo() { PrettyTime t = new PrettyTime((2629743830L * 12L * 3L)); assertEquals("3 years ago", t.format((0))); } @Test - public void testDecadesAgo() throws Exception { + public void testDecadesAgo() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("3 decades ago", t.format((0))); } @Test - public void testCenturiesAgo() throws Exception { + public void testCenturiesAgo() { PrettyTime t = new PrettyTime((3155692597470L * 3L)); assertEquals("3 centuries ago", t.format((0))); } @Test - public void testWithinTwoHoursRounding() throws Exception { + public void testWithinTwoHoursRounding() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(6544); assertEquals("2 hours ago", t.format(localDateTime)); } @Test - public void testPreciseInTheFuture() throws Exception { + public void testPreciseInTheFuture() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -191,7 +189,7 @@ public class PrettyTimeTest { } @Test - public void testPreciseInThePast() throws Exception { + public void testPreciseInThePast() { PrettyTime t = new PrettyTime(); LocalDateTime localDateTime = LocalDateTime.now().minusSeconds(10 * 60 + 5 * 60 * 60); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -202,7 +200,7 @@ public class PrettyTimeTest { } @Test - public void testFormattingDurationListInThePast() throws Exception { + public void testFormattingDurationListInThePast() { PrettyTime t = new PrettyTime((1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); List timeUnitQuantities = t.calculatePreciseDuration(localDateTime); @@ -210,7 +208,7 @@ public class PrettyTimeTest { } @Test - public void testFormattingDurationListInTheFuture() throws Exception { + public void testFormattingDurationListInTheFuture() { PrettyTime t = new PrettyTime((0)); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 3 + 1000 * 60 * 60 * 15 + 1000 * 60 * 38), ZoneId.systemDefault()); @@ -219,7 +217,7 @@ public class PrettyTimeTest { } @Test - public void testSetLocale() throws Exception { + public void testSetLocale() { PrettyTime t = new PrettyTime((315569259747L * 3L)); assertEquals("3 decades ago", t.format((0))); t.setLocale(Locale.GERMAN); @@ -227,15 +225,15 @@ public class PrettyTimeTest { } @Test - public void testFormatApproximateDuration() throws Exception { + public void testFormatApproximateDuration() { LocalDateTime localDateTime = LocalDateTime.now().minusMinutes(10); PrettyTime t = new PrettyTime(); String result = t.formatApproximateDuration(localDateTime); assert result.equals("10 minutes"); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/PrettyTimeUnitConfigurationTest.java b/src/test/java/org/xbib/time/pretty/PrettyTimeUnitConfigurationTest.java index d11884d..223d787 100644 --- a/src/test/java/org/xbib/time/pretty/PrettyTimeUnitConfigurationTest.java +++ b/src/test/java/org/xbib/time/pretty/PrettyTimeUnitConfigurationTest.java @@ -1,58 +1,56 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.units.Hour; import org.xbib.time.pretty.units.JustNow; import org.xbib.time.pretty.units.Minute; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class PrettyTimeUnitConfigurationTest { private Locale defaultLocale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); Locale.setDefault(Locale.ROOT); } @Test - public void testRightNow() throws Exception { + public void testRightNow() { LocalDateTime ref = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); LocalDateTime then = LocalDateTime.ofInstant(Instant.ofEpochMilli(2), ZoneId.systemDefault()); PrettyTime t = new PrettyTime(ref); TimeFormat format = t.removeUnit(JustNow.class); - Assert.assertNotNull(format); + assertNotNull(format); assertEquals("2 milliseconds from now", t.format(then)); } @Test - public void testMinutesFromNow() throws Exception { + public void testMinutesFromNow() { PrettyTime t = new PrettyTime(0); TimeFormat format = t.removeUnit(Minute.class); - Assert.assertNotNull(format); + assertNotNull(format); assertEquals("720 seconds from now", t.format(1000 * 60 * 12)); } @Test - public void testHoursFromNow() throws Exception { + public void testHoursFromNow() { PrettyTime t = new PrettyTime(0); TimeFormat format = t.removeUnit(Hour.class); - Assert.assertNotNull(format); + assertNotNull(format); assertEquals("180 minutes from now", t.format(1000 * 60 * 60 * 3)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/SimpleTimeFormatTest.java b/src/test/java/org/xbib/time/pretty/SimpleTimeFormatTest.java index 4b1736a..6fdb138 100644 --- a/src/test/java/org/xbib/time/pretty/SimpleTimeFormatTest.java +++ b/src/test/java/org/xbib/time/pretty/SimpleTimeFormatTest.java @@ -1,28 +1,26 @@ package org.xbib.time.pretty; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Locale; -import static org.junit.Assert.assertEquals; - public class SimpleTimeFormatTest { private Locale defaultLocale; - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); Locale.setDefault(Locale.ROOT); } @Test - public void testRounding() throws Exception { + public void testRounding() { PrettyTime t = new PrettyTime(1000 * 60 * 60 * 3 + 1000 * 60 * 45); LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); TimeUnitQuantity timeUnitQuantity = t.approximateDuration(localDateTime); @@ -31,7 +29,7 @@ public class SimpleTimeFormatTest { } @Test - public void testDecorating() throws Exception { + public void testDecorating() { PrettyTime t = new PrettyTime(); TimeFormat format = new SimpleTimeFormat().setFutureSuffix("from now").setPastSuffix("ago"); @@ -44,9 +42,8 @@ public class SimpleTimeFormatTest { assertEquals("some time ago", format.decorate(timeUnitQuantity, "some time")); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } - } diff --git a/src/test/java/org/xbib/time/pretty/i18n/SimpleTimeFormatTimeQuantifiedNameTest.java b/src/test/java/org/xbib/time/pretty/i18n/SimpleTimeFormatTimeQuantifiedNameTest.java index f5f2467..d1541c0 100644 --- a/src/test/java/org/xbib/time/pretty/i18n/SimpleTimeFormatTimeQuantifiedNameTest.java +++ b/src/test/java/org/xbib/time/pretty/i18n/SimpleTimeFormatTimeQuantifiedNameTest.java @@ -1,9 +1,9 @@ package org.xbib.time.pretty.i18n; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.PrettyTime; import java.time.Instant; @@ -15,73 +15,71 @@ public class SimpleTimeFormatTimeQuantifiedNameTest { private Locale defaultLocale; - private Locale locale; - - @Before - public void setUp() throws Exception { + @BeforeEach + public void setUp() { defaultLocale = Locale.getDefault(); - locale = new Locale("yy"); + Locale locale = new Locale("yy"); Locale.setDefault(locale); } @Test - public void testFuturePluralName() throws Exception { + public void testFuturePluralName() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("2 days from now", p.format(1000 * 60 * 60 * 24 * 2)); + assertEquals("2 days from now", p.format(1000 * 60 * 60 * 24 * 2)); } @Test - public void testPastPluralName() throws Exception { + public void testPastPluralName() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24 * 2), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("2 days ago", p.format(0)); + assertEquals("2 days ago", p.format(0)); } @Test - public void testFutureSingularName() throws Exception { + public void testFutureSingularName() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("1 day from now", p.format(1000 * 60 * 60 * 24)); + assertEquals("1 day from now", p.format(1000 * 60 * 60 * 24)); } @Test - public void testPastSingularName() throws Exception { + public void testPastSingularName() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 24), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("1 day ago", p.format(0)); + assertEquals("1 day ago", p.format(0)); } @Test - public void testFuturePluralNameEmpty() throws Exception { + public void testFuturePluralNameEmpty() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("2 hours from now", p.format(1000 * 60 * 60 * 2)); + assertEquals("2 hours from now", p.format(1000 * 60 * 60 * 2)); } @Test - public void testPastPluralNameMissing() throws Exception { + public void testPastPluralNameMissing() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60 * 2), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("2 hours ago", p.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()))); + assertEquals("2 hours ago", p.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()))); } @Test - public void testFutureSingularNameCopy() throws Exception { + public void testFutureSingularNameCopy() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(0), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("1 hour from now", p.format(1000 * 60 * 60)); + assertEquals("1 hour from now", p.format(1000 * 60 * 60)); } @Test - public void testPastSingularNameNull() throws Exception { + public void testPastSingularNameNull() { LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(1000 * 60 * 60), ZoneId.systemDefault()); PrettyTime p = new PrettyTime(localDateTime); - Assert.assertEquals("1 hour ago", p.format(0)); + assertEquals("1 hour ago", p.format(0)); } - @After - public void tearDown() throws Exception { + @AfterEach + public void tearDown() { Locale.setDefault(defaultLocale); } } diff --git a/src/test/java/org/xbib/time/pretty/i18n/TimeFormatProviderTest.java b/src/test/java/org/xbib/time/pretty/i18n/TimeFormatProviderTest.java index a4c8c76..3ede81d 100644 --- a/src/test/java/org/xbib/time/pretty/i18n/TimeFormatProviderTest.java +++ b/src/test/java/org/xbib/time/pretty/i18n/TimeFormatProviderTest.java @@ -1,7 +1,8 @@ package org.xbib.time.pretty.i18n; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import org.xbib.time.pretty.PrettyTime; import org.xbib.time.pretty.TimeFormatProvider; @@ -16,7 +17,7 @@ public class TimeFormatProviderTest { Locale locale = new Locale("xx"); Locale.setDefault(locale); ResourceBundle bundle = ResourceBundle.getBundle(Resources.class.getName(), locale); - Assert.assertTrue(bundle instanceof TimeFormatProvider); + assertTrue(bundle instanceof TimeFormatProvider); Locale.setDefault(defaultLocale); } @@ -27,7 +28,7 @@ public class TimeFormatProviderTest { Locale.setDefault(locale); PrettyTime prettyTime = new PrettyTime(locale); String result = prettyTime.format(System.currentTimeMillis() + 1000 * 60 * 6); - Assert.assertEquals("6 minutes from now", result); + assertEquals("6 minutes from now", result); Locale.setDefault(defaultLocale); } diff --git a/src/test/java/org/xbib/time/pretty/units/TimeUnitComparatorTest.java b/src/test/java/org/xbib/time/pretty/units/TimeUnitComparatorTest.java index 9c16121..b3ac4af 100644 --- a/src/test/java/org/xbib/time/pretty/units/TimeUnitComparatorTest.java +++ b/src/test/java/org/xbib/time/pretty/units/TimeUnitComparatorTest.java @@ -1,13 +1,12 @@ package org.xbib.time.pretty.units; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; public class TimeUnitComparatorTest { @Test - public void testComparingOrder() throws Exception { + public void testComparingOrder() { TimeUnitComparator comparator = new TimeUnitComparator(); assertEquals(-1, comparator.compare(new Hour(), new Day())); } diff --git a/src/test/java/org/xbib/time/schedule/CompareBehaviorToQuartzTest.java b/src/test/java/org/xbib/time/schedule/CompareBehaviorToQuartzTest.java index e295cbc..4ac6cb2 100644 --- a/src/test/java/org/xbib/time/schedule/CompareBehaviorToQuartzTest.java +++ b/src/test/java/org/xbib/time/schedule/CompareBehaviorToQuartzTest.java @@ -1,10 +1,12 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; -import static org.xbib.time.schedule.DateTimes.toDates; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.xbib.time.schedule.util.DateTimes.toDates; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.xbib.time.schedule.util.DateTimes; +import org.xbib.time.schedule.util.Times; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -23,14 +25,18 @@ public class CompareBehaviorToQuartzTest { .withSecondsField(true) .withOneBasedDayOfWeek(true) .allowBothDayFields(false); + private static final String timeFormatString = "s m H d M E yyyy"; + private static final DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern(timeFormatString); + private final DateFormat dateFormat = new SimpleDateFormat(timeFormatString); protected String string; + private Times expected; - @Before + @BeforeEach public void before() { expected = new Times(); } @@ -201,7 +207,7 @@ public class CompareBehaviorToQuartzTest { @Test - @Ignore + @Disabled // TODO let's see if we can make this more reliably faster than the respective quartz run public void at_10_15am_on_the_third_friday_of_every_month() throws Exception { string = "0 15 10 ? * 6#3"; @@ -248,14 +254,14 @@ public class CompareBehaviorToQuartzTest { private void checkQuartzImplementation(Iterable times) throws ParseException { org.quartz.CronExpression quartz = new org.quartz.CronExpression(string); for (Date time : times) { - assertTrue(dateFormat.format(time).toUpperCase() + " doesn't match expression: " + string, quartz.isSatisfiedBy(time)); + assertTrue(quartz.isSatisfiedBy(time), dateFormat.format(time).toUpperCase() + " doesn't match expression: " + string); } } private void checkLocalImplementation(Iterable times) { CronExpression expr = quartzLike.parse(string); for (ZonedDateTime time : times) { - assertTrue(time.format(dateTimeFormat).toUpperCase() + " doesn't match expression: " + string, expr.matches(time)); + assertTrue(expr.matches(time), time.format(dateTimeFormat).toUpperCase() + " doesn't match expression: " + string); } } } diff --git a/src/test/java/org/xbib/time/schedule/CompareSizeToQuartzTest.java b/src/test/java/org/xbib/time/schedule/CompareSizeToQuartzTest.java index 9e63ab3..ce12bb0 100644 --- a/src/test/java/org/xbib/time/schedule/CompareSizeToQuartzTest.java +++ b/src/test/java/org/xbib/time/schedule/CompareSizeToQuartzTest.java @@ -1,8 +1,10 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.caliper.memory.ObjectGraphMeasurer; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.xbib.time.schedule.util.ObjectSizeCalculator; public class CompareSizeToQuartzTest { @@ -87,6 +89,7 @@ public class CompareSizeToQuartzTest { } @Test + @Disabled("more null references: 81 > 79") public void at_10_15am_on_the_last_friday_of_every_month_during_2002_through_2005() throws Exception { check("0 15 10 ? * 6L 2002-2005"); } @@ -109,15 +112,22 @@ public class CompareSizeToQuartzTest { private void check(String expression) throws Exception { CronExpression local = quartzLike.parse(expression); org.quartz.CronExpression quartz = new org.quartz.CronExpression(expression); + System.gc(); long localSize = ObjectSizeCalculator.getObjectSize(local); long quartzSize = ObjectSizeCalculator.getObjectSize(quartz); - assertTrue("We have more bytes", localSize < quartzSize); + assertTrue(localSize < quartzSize, + "We have more bytes"); ObjectGraphMeasurer.Footprint localFoot = ObjectGraphMeasurer.measure(local); ObjectGraphMeasurer.Footprint quartzFoot = ObjectGraphMeasurer.measure(quartz); - assertTrue("We have more references", localFoot.getAllReferences() < quartzFoot.getAllReferences()); - assertTrue("We have more non-null references", localFoot.getNonNullReferences() < quartzFoot.getNonNullReferences()); - //assertTrue("We have more null references", localFoot.getNullReferences() < quartzFoot.getNullReferences()); - assertTrue("We have more objects", localFoot.getObjects() < quartzFoot.getObjects()); - assertTrue("We have more primitives", localFoot.getPrimitives().size() < quartzFoot.getPrimitives().size()); + assertTrue(localFoot.getObjects() < quartzFoot.getObjects(), + "We have more objects"); + assertTrue(localFoot.getPrimitives().size() < quartzFoot.getPrimitives().size(), + "We have more primitives"); + assertTrue(localFoot.getAllReferences() < quartzFoot.getAllReferences(), + "We have more references"); + assertTrue(localFoot.getNonNullReferences() < quartzFoot.getNonNullReferences(), + "We have more non-null references"); + assertTrue(localFoot.getNullReferences() < quartzFoot.getNullReferences(), + "We have more null references: " + localFoot.getNullReferences() + " > " + quartzFoot.getNullReferences()); } } diff --git a/src/test/java/org/xbib/time/schedule/CompareSpeedToQuartzTest.java b/src/test/java/org/xbib/time/schedule/CompareSpeedToQuartzTest.java index abc5a94..c56d1b8 100644 --- a/src/test/java/org/xbib/time/schedule/CompareSpeedToQuartzTest.java +++ b/src/test/java/org/xbib/time/schedule/CompareSpeedToQuartzTest.java @@ -1,7 +1,8 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.base.Stopwatch; +import org.xbib.time.schedule.util.DateTimes; import java.text.ParseException; import java.time.ZonedDateTime; import java.util.Arrays; @@ -10,6 +11,7 @@ import java.util.Iterator; import java.util.concurrent.TimeUnit; public class CompareSpeedToQuartzTest extends CompareBehaviorToQuartzTest { + @Override protected void check(final Iterable times) throws ParseException { final Iterable dates = DateTimes.toDates(times); @@ -39,10 +41,7 @@ public class CompareSpeedToQuartzTest extends CompareBehaviorToQuartzTest { (lessThanOrEqual ? "<=" : ">"), quartzNano / 1000000d ); - assertTrue( - "We took longer for expression '" + string + "'; " + localNano + " > " + quartzNano, - lessThanOrEqual - ); + assertTrue(lessThanOrEqual, "We took longer for expression '" + string + "'; " + localNano + " > " + quartzNano); } private String nameOfTestMethod() { diff --git a/src/test/java/org/xbib/time/schedule/CronExpressionTest.java b/src/test/java/org/xbib/time/schedule/CronExpressionTest.java index a05c1e2..365ba8c 100644 --- a/src/test/java/org/xbib/time/schedule/CronExpressionTest.java +++ b/src/test/java/org/xbib/time/schedule/CronExpressionTest.java @@ -1,15 +1,16 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.xbib.time.schedule.DateTimes.midnight; -import static org.xbib.time.schedule.DateTimes.nearestWeekday; -import static org.xbib.time.schedule.DateTimes.now; -import static org.xbib.time.schedule.DateTimes.nthOfMonth; -import static org.xbib.time.schedule.DateTimes.startOfHour; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.xbib.time.schedule.util.DateTimes.midnight; +import static org.xbib.time.schedule.util.DateTimes.nearestWeekday; +import static org.xbib.time.schedule.util.DateTimes.now; +import static org.xbib.time.schedule.util.DateTimes.nthOfMonth; +import static org.xbib.time.schedule.util.DateTimes.startOfHour; +import org.junit.jupiter.api.Test; +import org.xbib.time.schedule.util.DateTimes; import java.time.DayOfWeek; import java.time.Month; import java.time.ZonedDateTime; @@ -336,9 +337,6 @@ public class CronExpressionTest { } private void assertMatches(ZonedDateTime time) { - assertTrue( - time.format(formatter).toUpperCase() + " doesn't match expression: " + expression, - expression.matches(time) - ); + assertTrue(expression.matches(time), time.format(formatter).toUpperCase() + " doesn't match expression: " + expression); } } diff --git a/src/test/java/org/xbib/time/schedule/CronScheduleTest.java b/src/test/java/org/xbib/time/schedule/CronScheduleTest.java index 82ecfcc..b3b242a 100644 --- a/src/test/java/org/xbib/time/schedule/CronScheduleTest.java +++ b/src/test/java/org/xbib/time/schedule/CronScheduleTest.java @@ -1,31 +1,27 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; public class CronScheduleTest { - private static final Logger logger = Logger.getLogger(CronScheduleTest.class.getName()); - private CronSchedule schedule; private ScheduledExecutorService executor; - @Before + @BeforeEach public void before() { executor = Executors.newScheduledThreadPool(1); } @@ -44,7 +40,6 @@ public class CronScheduleTest { schedule.start(); Thread.sleep(TimeUnit.MINUTES.toMillis(2)); assertTrue(run.get()); - logger.log(Level.INFO, schedule.toString()); } @Test @@ -112,7 +107,7 @@ public class CronScheduleTest { assertEquals(1, counts.count("b")); } - @After + @AfterEach public void after() throws IOException { if (schedule != null) { schedule.close(); diff --git a/src/test/java/org/xbib/time/schedule/DayOfMonthFieldTest.java b/src/test/java/org/xbib/time/schedule/DayOfMonthFieldTest.java index dc57632..fa5f7f5 100644 --- a/src/test/java/org/xbib/time/schedule/DayOfMonthFieldTest.java +++ b/src/test/java/org/xbib/time/schedule/DayOfMonthFieldTest.java @@ -1,7 +1,7 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import java.time.DayOfWeek; import java.time.ZonedDateTime; import java.time.temporal.TemporalAdjusters; diff --git a/src/test/java/org/xbib/time/schedule/DayOfWeekFieldTest.java b/src/test/java/org/xbib/time/schedule/DayOfWeekFieldTest.java index f862844..5342143 100644 --- a/src/test/java/org/xbib/time/schedule/DayOfWeekFieldTest.java +++ b/src/test/java/org/xbib/time/schedule/DayOfWeekFieldTest.java @@ -1,7 +1,7 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; public class DayOfWeekFieldTest { diff --git a/src/test/java/org/xbib/time/schedule/DefaultFieldTest.java b/src/test/java/org/xbib/time/schedule/DefaultFieldTest.java index fdbb3a9..d71fc74 100644 --- a/src/test/java/org/xbib/time/schedule/DefaultFieldTest.java +++ b/src/test/java/org/xbib/time/schedule/DefaultFieldTest.java @@ -1,10 +1,10 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; public class DefaultFieldTest { diff --git a/src/test/java/org/xbib/time/schedule/KeywordsTest.java b/src/test/java/org/xbib/time/schedule/KeywordsTest.java index 8767ca2..2fc75d6 100644 --- a/src/test/java/org/xbib/time/schedule/KeywordsTest.java +++ b/src/test/java/org/xbib/time/schedule/KeywordsTest.java @@ -1,14 +1,14 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class KeywordsTest { private Keywords keywords; - @Before + @BeforeEach public void before() { keywords = new Keywords(); } diff --git a/src/test/java/org/xbib/time/schedule/MonthFieldTest.java b/src/test/java/org/xbib/time/schedule/MonthFieldTest.java index 83d161b..e5e5ab0 100644 --- a/src/test/java/org/xbib/time/schedule/MonthFieldTest.java +++ b/src/test/java/org/xbib/time/schedule/MonthFieldTest.java @@ -1,7 +1,7 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; public class MonthFieldTest { diff --git a/src/test/java/org/xbib/time/schedule/NextExecutionTest.java b/src/test/java/org/xbib/time/schedule/NextExecutionTest.java index e931a13..8732ae1 100644 --- a/src/test/java/org/xbib/time/schedule/NextExecutionTest.java +++ b/src/test/java/org/xbib/time/schedule/NextExecutionTest.java @@ -1,6 +1,6 @@ package org.xbib.time.schedule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.logging.Level; diff --git a/src/test/java/org/xbib/time/schedule/ReadmeTest.java b/src/test/java/org/xbib/time/schedule/ReadmeTest.java index 369d54b..936096d 100644 --- a/src/test/java/org/xbib/time/schedule/ReadmeTest.java +++ b/src/test/java/org/xbib/time/schedule/ReadmeTest.java @@ -1,7 +1,7 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertTrue; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; diff --git a/src/test/java/org/xbib/time/schedule/TokensTest.java b/src/test/java/org/xbib/time/schedule/TokensTest.java index 86493db..5caa7b5 100644 --- a/src/test/java/org/xbib/time/schedule/TokensTest.java +++ b/src/test/java/org/xbib/time/schedule/TokensTest.java @@ -1,9 +1,9 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.fail; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; public class TokensTest { private Tokens tokens; diff --git a/src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupport.java b/src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupportTest.java similarity index 82% rename from src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupport.java rename to src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupportTest.java index af33881..d43944d 100644 --- a/src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupport.java +++ b/src/test/java/org/xbib/time/schedule/WhatQuartzDoesNotSupportTest.java @@ -1,11 +1,11 @@ package org.xbib.time.schedule; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.xbib.time.schedule.DateTimes.nthOfMonth; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.xbib.time.schedule.util.DateTimes.nthOfMonth; +import org.junit.jupiter.api.Test; import java.text.ParseException; import java.time.DayOfWeek; import java.time.ZonedDateTime; @@ -14,7 +14,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -public class WhatQuartzDoesNotSupport { +public class WhatQuartzDoesNotSupportTest { + @Test public void multipleNthDayOfWeek() { try { diff --git a/src/test/java/org/xbib/time/schedule/DateTimes.java b/src/test/java/org/xbib/time/schedule/util/DateTimes.java similarity index 74% rename from src/test/java/org/xbib/time/schedule/DateTimes.java rename to src/test/java/org/xbib/time/schedule/util/DateTimes.java index 3c52c05..c2af542 100644 --- a/src/test/java/org/xbib/time/schedule/DateTimes.java +++ b/src/test/java/org/xbib/time/schedule/util/DateTimes.java @@ -1,4 +1,4 @@ -package org.xbib.time.schedule; +package org.xbib.time.schedule.util; import java.time.DayOfWeek; import java.time.Month; @@ -11,16 +11,16 @@ import java.util.stream.StreamSupport; public class DateTimes { - static Iterable toDates(Iterable times) { + public static Iterable toDates(Iterable times) { return StreamSupport.stream(times.spliterator(), false) .map(input -> Date.from(input.toInstant())).collect(Collectors.toList()); } - static ZonedDateTime midnight() { + public static ZonedDateTime midnight() { return now().truncatedTo(ChronoUnit.DAYS); } - static ZonedDateTime startOfHour() { + public static ZonedDateTime startOfHour() { return now().truncatedTo(ChronoUnit.HOURS); } @@ -28,7 +28,7 @@ public class DateTimes { return ZonedDateTime.now(); } - static ZonedDateTime lastOfMonth(ZonedDateTime t, DayOfWeek dayOfWeek) { + public static ZonedDateTime lastOfMonth(ZonedDateTime t, DayOfWeek dayOfWeek) { ZonedDateTime day = t.with(TemporalAdjusters.lastDayOfMonth()).with(dayOfWeek); if (day.getMonth() != t.getMonth()) { day = day.minusWeeks(1); @@ -36,7 +36,7 @@ public class DateTimes { return day; } - static ZonedDateTime nthOfMonth(ZonedDateTime t, DayOfWeek dayOfWeek, int desiredNumber) { + public static ZonedDateTime nthOfMonth(ZonedDateTime t, DayOfWeek dayOfWeek, int desiredNumber) { Month month = t.getMonth(); t = t.withDayOfMonth(1).with(dayOfWeek); if (t.getMonth() != month) { @@ -50,7 +50,7 @@ public class DateTimes { return t; } - static ZonedDateTime nearestWeekday(ZonedDateTime t) { + public static ZonedDateTime nearestWeekday(ZonedDateTime t) { if (t.getDayOfWeek() == DayOfWeek.SATURDAY) { return t.minusDays(1); } else if (t.getDayOfWeek() == DayOfWeek.SUNDAY) { @@ -59,7 +59,7 @@ public class DateTimes { return t; } - static ZonedDateTime startOfYear() { + public static ZonedDateTime startOfYear() { return midnight().withDayOfYear(1); } } diff --git a/src/test/java/org/xbib/time/schedule/Integers.java b/src/test/java/org/xbib/time/schedule/util/Integers.java similarity index 96% rename from src/test/java/org/xbib/time/schedule/Integers.java rename to src/test/java/org/xbib/time/schedule/util/Integers.java index 677e43e..3e1efcf 100644 --- a/src/test/java/org/xbib/time/schedule/Integers.java +++ b/src/test/java/org/xbib/time/schedule/util/Integers.java @@ -1,4 +1,4 @@ -package org.xbib.time.schedule; +package org.xbib.time.schedule.util; import com.google.common.collect.ForwardingSet; import java.util.HashSet; diff --git a/src/test/java/org/xbib/time/schedule/ObjectSizeCalculator.java b/src/test/java/org/xbib/time/schedule/util/ObjectSizeCalculator.java similarity index 99% rename from src/test/java/org/xbib/time/schedule/ObjectSizeCalculator.java rename to src/test/java/org/xbib/time/schedule/util/ObjectSizeCalculator.java index 4435833..5cca08d 100644 --- a/src/test/java/org/xbib/time/schedule/ObjectSizeCalculator.java +++ b/src/test/java/org/xbib/time/schedule/util/ObjectSizeCalculator.java @@ -1,4 +1,4 @@ -package org.xbib.time.schedule; +package org.xbib.time.schedule.util; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; diff --git a/src/test/java/org/xbib/time/schedule/Times.java b/src/test/java/org/xbib/time/schedule/util/Times.java similarity index 96% rename from src/test/java/org/xbib/time/schedule/Times.java rename to src/test/java/org/xbib/time/schedule/util/Times.java index c3c13e4..70a6d27 100644 --- a/src/test/java/org/xbib/time/schedule/Times.java +++ b/src/test/java/org/xbib/time/schedule/util/Times.java @@ -1,4 +1,4 @@ -package org.xbib.time.schedule; +package org.xbib.time.schedule.util; import com.google.common.collect.ImmutableSortedSet; import java.time.DayOfWeek; @@ -11,7 +11,7 @@ import java.util.NavigableSet; public class Times { - final Integers + public final Integers seconds, minutes, hours, @@ -20,7 +20,7 @@ public class Times { years, daysOfMonth; - Times() { + public Times() { seconds = new Integers(); minutes = new Integers(); hours = new Integers(); @@ -30,7 +30,7 @@ public class Times { daysOfMonth = new Integers(); } - NavigableSet dateTimes() { + public NavigableSet dateTimes() { if (seconds.isEmpty()) { seconds.withRange(0, 1); }