<commit_before>package com.spectralogic.ds3client.helpers.channels;

import com.google.common.collect.ImmutableMultimap;
import com.spectralogic.ds3client.models.Range;
import com.spectralogic.ds3client.models.bulk.BulkObject;
import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel;
import org.junit.Test;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

public class RangedSeekableByteChannel_Test {

    @Test
    public void noRanges() {

    }

    @Test
    public void singleBlobWithRange() {

    }

    @Test
    public void multipleRangesWithSingleBlob() {

    }

    @Test
    public void multipleRangesWithMultipleBlobs() throws IOException {
        final String firstPartialBlob = "First blob text";
        final String secondPartialBlob = "Second Blob text";

        final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(Charset.forName("UTF-8")));
        final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(Charset.forName("UTF-8")));

        final ImmutableMultimap.Builder<BulkObject, Range> builder = ImmutableMultimap.builder();

        final BulkObject blob1 = new BulkObject("obj1.txt", 50, true, 0);
        final BulkObject blob2 = new BulkObject("obj1.txt", 50, true, 50);

        builder.put(blob1, Range.byLength(0, firstBlobData.limit()));
        builder.put(blob2, Range.byLength(50, secondBlobData.limit()));

        final ImmutableMultimap<BulkObject, Range> ranges = builder.build();<commit_msg>Removin unimplemented test stubs<commit_after>package com.spectralogic.ds3client.helpers.channels;

import com.google.common.collect.ImmutableMultimap;
import com.spectralogic.ds3client.models.Range;
import com.spectralogic.ds3client.models.bulk.BulkObject;
import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel;
import org.junit.Test;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

public class RangedSeekableByteChannel_Test {

    @Test
    public void multipleRangesWithMultipleBlobs() throws IOException {
        final String firstPartialBlob = "First blob text";
        final String secondPartialBlob = "Second Blob text";

        final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(Charset.forName("UTF-8")));
        final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(Charset.forName("UTF-8")));

        final ImmutableMultimap.Builder<BulkObject, Range> builder = ImmutableMultimap.builder();

        final BulkObject blob1 = new BulkObject("obj1.txt", 50, true, 0);
        final BulkObject blob2 = new BulkObject("obj1.txt", 50, true, 50);

        builder.put(blob1, Range.byLength(0, firstBlobData.limit()));
        builder.put(blob2, Range.byLength(50, secondBlobData.limit()));

        final ImmutableMultimap<BulkObject, Range> ranges = builder.build();
{'fraction_non_alphanumeric': 0.10408098702942106, 'fraction_numerical': 0.013919645681746282, 'mean_word_length': 4.527972027972028, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6725947', 'n_tokens_mistral': 983, 'n_tokens_neox': 951, 'n_words': 190}