<commit_before>package net.time4j.tz.threeten;

import net.time4j.Moment;
import net.time4j.PlainDate;
import net.time4j.PlainTime;
import net.time4j.tz.OffsetSign;
import net.time4j.tz.TransitionHistory;
import net.time4j.tz.ZonalOffset;
import net.time4j.tz.ZonalTransition;
import net.time4j.tz.ZoneModelProvider;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.IOException;

import static net.time4j.ClockUnit.MINUTES;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;


@RunWith(JUnit4.class)
public class JdkZoneProviderTest {

    private static ZoneModelProvider zp = null;

    @BeforeClass
    public static void init() {
        zp = new JdkZoneProviderSPI();
        System.out.println("Test of Threeten-ZoneProvider: version=" + zp.getVersion());
    }

    @Test
    public void getFallback() {
        assertThat(zp.getFallback(), is(""));
    }

    @Test
    public void getLocation() {
        assertThat(zp.getLocation(), is("{java.home}/lib/tzdb.dat"));
    }

    @Test
    public void getName() {
        assertThat(zp.getName(), is("TZDB"));
    }

    @Test
    public void getAliases() {
        assertThat(
            zp.getAliases().isEmpty(),
            is(true));
    }

    /*
    @Test
    public void normalized() {
        assertThat(
            ZoneId.of("Atlantic/Jan_Mayen").normalized().getId(),
            is("Europe/Oslo")); // normalization does not work (is just relevant for resolving fixed offsets)
    }
    */

    @Test
    public void compareAliasWithOriginal() {
        TransitionHistory histJanMayen = zp.load("Atlantic/Jan_Mayen");
        TransitionHistory histOslo = zp.load("Europe/Oslo");
        assertThat(histJanMayen, is(histOslo)); // same rules as expected for an alias
    }

    @Test
    public void loadSystemV() {
        TransitionHistory h = zp.load("SystemV/EST5");
        assertThat(h.isEmpty(), is(true));
        assertThat(
            h.getInitialOffset(),
            is(ZonalOffset.ofHours(OffsetSign.BEHIND_UTC, 5)));
    }

    @Test
    public void loadAllData() {
        for (String tzid : zp.getAvailableIDs()) {
            try {<commit_msg>extra test for standard java<commit_after>package net.time4j.tz.threeten;

import net.time4j.Moment;
import net.time4j.PlainDate;
import net.time4j.PlainTime;
import net.time4j.tz.OffsetSign;
import net.time4j.tz.Timezone;
import net.time4j.tz.TransitionHistory;
import net.time4j.tz.ZonalOffset;
import net.time4j.tz.ZonalTransition;
import net.time4j.tz.ZoneModelProvider;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.IOException;

import static net.time4j.ClockUnit.MINUTES;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;


@RunWith(JUnit4.class)
public class JdkZoneProviderTest {

    private static ZoneModelProvider zp = null;

    @BeforeClass
    public static void init() {
        zp = new JdkZoneProviderSPI();
        System.out.println("Test of Threeten-ZoneProvider: version=" + zp.getVersion());
    }

    @Test
    public void getFallback() {
        assertThat(zp.getFallback(), is(""));
    }

    @Test
    public void getLocation() {
        assertThat(zp.getLocation(), is("{java.home}/lib/tzdb.dat"));
    }

    @Test
    public void getName() {
        assertThat(zp.getName(), is("TZDB"));
    }

    @Test
    public void getAliases() {
        assertThat(
            zp.getAliases().isEmpty(),
            is(true));
    }

    @Test
    public void normalize() {
        assertThat(
            Timezone.normalize("Asia/Calcutta").canonical().equals("Asia/Kolkata"),
            is(false)); // no support for normalization in JSR-310
    }

    /*
    @Test
    public void normalized() {
        assertThat(
            ZoneId.of("Atlantic/Jan_Mayen").normalized().getId(),
            is("Europe/Oslo")); // normalization does not work (is just relevant for resolving fixed offsets)
    }
    */

    @Test
    public void compareAliasWithOriginal() {
        TransitionHistory histJanMayen = zp.load("Atlantic/Jan_Mayen");
        TransitionHistory histOslo = zp.load("Europe/Oslo");
        assertThat(histJanMayen, is(histOslo)); // same rules as expected for an alias
    }

    @Test
    public void loadSystemV() {
        TransitionHistory h = zp.load("SystemV/EST5");
        assertThat(h.isEmpty(), is(true));
        assertThat(
            h.getInitialOffset(),
            is(ZonalOffset.ofHours(OffsetSign.BEHIND_UTC, 5)));
    }

    @Test
    public void loadAllData() {
        for (String tzid : zp.getAvailableIDs()) {
            try {
{'fraction_non_alphanumeric': 0.12176898222940226, 'fraction_numerical': 0.006462035541195477, 'mean_word_length': 2.915415019762846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1565396', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1552, 'n_words': 317}