<commit_before>package org.fcrepo.utils.infinispan;

import org.apache.commons.io.IOUtils;
import org.infinispan.Cache;
import org.infinispan.loaders.CacheLoaderManager;
import org.infinispan.loaders.CacheStore;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.junit.Test;
import org.modeshape.jcr.value.binary.BinaryStore;
import org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore;

import java.io.IOException;
import java.io.InputStream;
import java.util.Set;

import static org.junit.Assert.assertEquals;

public class StoreChunkInputStreamTest {

    @Test
    public void tryRetrievingContentFromInfinispanTest() throws IOException {
        EmbeddedCacheManager cm = new DefaultCacheManager("test_infinispan_configuration.xml");
        BinaryStore store = new InfinispanBinaryStore(cm, false, "FedoraRepository", "FedoraRepository");

        Cache<String, byte[]> ispn = cm.getCache("FedoraRepository");


        CacheStore cs = ispn.getAdvancedCache().getComponentRegistry()
                .getComponent(CacheLoaderManager.class)
                .getCacheStore();

        ispn.put("key-data-0", "0".getBytes());
        ispn.put("key-data-1", "1".getBytes());
        ispn.put("key-data-2", "2".getBytes());
        ispn.put("key-data-3", "3".getBytes());
        ispn.put("key-data-4", "4".getBytes());
        ispn.put("key-data-5", "5".getBytes());


        Set s = ispn.keySet();
        InputStream is = new StoreChunkInputStream(cs, "key-data");

        String data = IOUtils.toString(is);

        assertEquals("012345", data);
    }
}<commit_msg>Removes unused code. Cleans up imports.<commit_after>package org.fcrepo.utils.infinispan;

import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;
import org.infinispan.Cache;
import org.infinispan.loaders.CacheLoaderManager;
import org.infinispan.loaders.CacheStore;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.junit.Test;

public class StoreChunkInputStreamTest {

    @Test
    public void tryRetrievingContentFromInfinispanTest() throws IOException {
        EmbeddedCacheManager cm = new DefaultCacheManager("test_infinispan_configuration.xml");

        Cache<String, byte[]> ispn = cm.getCache("FedoraRepository");

        CacheStore cs = ispn.getAdvancedCache().getComponentRegistry()
                .getComponent(CacheLoaderManager.class)
                .getCacheStore();

        ispn.put("key-data-0", "0".getBytes());
        ispn.put("key-data-1", "1".getBytes());
        ispn.put("key-data-2", "2".getBytes());
        ispn.put("key-data-3", "3".getBytes());
        ispn.put("key-data-4", "4".getBytes());
        ispn.put("key-data-5", "5".getBytes());

        InputStream is = new StoreChunkInputStream(cs, "key-data");

        String data = IOUtils.toString(is);

        assertEquals("012345", data);
    }
}
{'fraction_non_alphanumeric': 0.13513513513513514, 'fraction_numerical': 0.011865524060646011, 'mean_word_length': 3.7720125786163523, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5329595', 'n_tokens_mistral': 974, 'n_tokens_neox': 924, 'n_words': 155}