<commit_before>package org.yestech.episodic.util;

import static junit.framework.Assert.*;
import org.junit.Test;
import org.yestech.episodic.objectmodel.*;
import static org.yestech.episodic.util.EpisodicUtil.*;

import javax.xml.bind.JAXBException;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedSet;

/**
 * @author <NAME>
 */
public class EpisodicUtilUnitTest {

    @Test
    public void testUnmarshallShows() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(ShowsUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof Shows);
    }

    @Test
    public void testCreateAssertResponse() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(CreateAssetResponseUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof CreateAssetResponse);
    }

    @Test
    public void testCreateEpisodeResponse() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(CreateEpisodeResponseUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof CreateEpisodeResponse);
    }

    @Test
    public void testJoin() {
        String[] array = new String[]{"foo", "bar", "baz"};
        String result = join(array);
        assertEquals("foo,bar,baz", result);
    }

    @Test
    public void testSortedKeys() {
        Map<String, String> map = new HashMap<String, String>(3);
        map.put("beta", "slkdfjfdjlk");
        map.put("gamma", "sjldkfjklsdf");
        map.put("alpha", "sdlkafjdfs");

        SortedSet<String> strings = sortedKeys(map);
        assertNotNull(strings);
        assertEquals(3, strings.size());
        Iterator<String> it = strings.iterator();
        assertEquals("alpha", it.next());
        assertEquals("beta", it.next());
        assertEquals("gamma", it.next());
    }


}<commit_msg>added a test for the expires method.<commit_after>package org.yestech.episodic.util;

import static junit.framework.Assert.*;
import org.junit.Test;
import org.yestech.episodic.objectmodel.*;
import static org.yestech.episodic.util.EpisodicUtil.*;

import javax.xml.bind.JAXBException;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedSet;

/**
 * @author <NAME>
 */
public class EpisodicUtilUnitTest {

    @Test
    public void testUnmarshallShows() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(ShowsUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof Shows);
    }

    @Test
    public void testCreateAssertResponse() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(CreateAssetResponseUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof CreateAssetResponse);
    }

    @Test
    public void testCreateEpisodeResponse() throws JAXBException, UnsupportedEncodingException {
        Object o = unmarshall(new ByteArrayInputStream(CreateEpisodeResponseUnitTest.XML.getBytes("utf-8")));
        assertNotNull(o);
        assertTrue(o instanceof CreateEpisodeResponse);
    }

    @Test
    public void testJoin() {
        String[] array = new String[]{"foo", "bar", "baz"};
        String result = join(array);
        assertEquals("foo,bar,baz", result);
    }

    @Test
    public void testSortedKeys() {
        Map<String, String> map = new HashMap<String, String>(3);
        map.put("beta", "slkdfjfdjlk");
        map.put("gamma", "sjldkfjklsdf");
        map.put("alpha", "sdlkafjdfs");

        SortedSet<String> strings = sortedKeys(map);
        assertNotNull(strings);
        assertEquals(3, strings.size());
        Iterator<String> it = strings.iterator();
        assertEquals("alpha", it.next());
        assertEquals("beta", it.next());
        assertEquals("gamma", it.next());
    }

    @Test
    public void testExpires() {
        long now = System.currentTimeMillis();
        String s = EpisodicUtil.expires();
        long value = Long.parseLong(s) * 1000L;
        assertTrue(value > now);
    }


}
{'fraction_non_alphanumeric': 0.12229413077438071, 'fraction_numerical': 0.003124302611024325, 'mean_word_length': 3.5595116988809767, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6439968', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1291, 'n_words': 266}