Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17287 refactor TestSTFactory to JUnit #3419

Merged
merged 7 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/cldr-apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.stephenc.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<version>1.0-1</version>
<scope>test</scope>
</dependency>

<!-- mail / rss -->

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

package org.unicode.cldr.unittest.web;

import static org.junit.jupiter.api.Assumptions.assumeTrue;

import com.ibm.icu.dev.test.TestFmwk.TestGroup;
import com.ibm.icu.dev.test.TestLog;
import com.ibm.icu.text.Collator;
import com.ibm.icu.text.RuleBasedCollator;
import java.io.BufferedReader;
import java.io.File;
import java.io.PrintWriter;
import java.sql.SQLException;
Expand All @@ -19,7 +20,6 @@
import org.unicode.cldr.util.CLDRPaths;
import org.unicode.cldr.util.CldrUtility;
import org.unicode.cldr.util.Factory;
import org.unicode.cldr.util.FileReaders;
import org.unicode.cldr.util.StandardCodes;
import org.unicode.cldr.util.SupplementalDataInfo;
import org.unicode.cldr.web.CLDRProgressIndicator;
Expand Down Expand Up @@ -100,7 +100,7 @@ public static int main(String[] args, PrintWriter logs) {
public static String[] doResetDb(String[] args) {
if (CLDRConfig.getInstance().getEnvironment() != Environment.UNITTEST) {
throw new InternalError(
"Error: the CLDRConfig Environment is not UNITTEST. Please set -DCLDR_ENVIRONMENT=UNITTESTS");
"Error: the CLDRConfig Environment is not UNITTEST. Please set -DCLDR_ENVIRONMENT=UNITTEST");
}
return args;
}
Expand All @@ -113,7 +113,6 @@ public TestAll() {
TestIntHash.class.getName(),
TestXPathTable.class.getName(),
TestMisc.class.getName(),
TestSTFactory.class.getName(),
TestUserSettingsData.class.getName(),
TestAnnotationVotes.class.getName(),
TestUserRegistry.class.getName(),
Expand Down Expand Up @@ -333,15 +332,6 @@ public long startTime() {
};
}

/**
* Fetch data from jar
*
* @param name name of thing to load (org.unicode.cldr.unittest.web.data.name)
*/
public static BufferedReader getUTF8Data(String name) throws java.io.IOException {
return FileReaders.openFile(TestAll.class, "data/" + name);
}

public static final boolean skipIfNoDb() {
if (!HAVE_TEST_DB) {
System.err.println(
Expand All @@ -352,4 +342,15 @@ public static final boolean skipIfNoDb() {
}
return false;
}

/**
* @see #skipIfNoDb() - same but for JUnit
*/
public static void assumeHaveDb() {
assumeTrue(
HAVE_TEST_DB,
String.format(
"DB tests skipped because -D%s was not set to a MySQL URL.",
CLDR_TEST_JDBC));
}
}
Loading
Loading