<commit_before>package org.gazzax.labs.solrdf.search.component;

import static org.gazzax.labs.solrdf.TestUtility.DUMMY_BASE_URI;
import static org.junit.Assert.*;

import org.apache.jena.riot.Lang;
import org.junit.Before;
import org.junit.Test;

import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetRewindable;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;

import static org.mockito.Mockito.*;

/**
 * Test case for {@link PagedResultSet}.
 * 
 * @author <NAME>
 * @since 1.0
 */
public class PagedResultSetTestCase {
	private Model model;
	
	/**
	 * Setup fixture for this test case.
	 * 
	 * @throws Exception hopefully never, otherwise the corresponding test fails.
	 */
	@Before
	public void setUp() throws Exception {
		model = ModelFactory.createDefaultModel();
		model.read(getClass().getResourceAsStream("/sample-data/bsbm-generated-dataset.nt"), DUMMY_BASE_URI, Lang.NTRIPLES.getLabel());
	}
	
	/**
	 * If the required size (+offset) is greater than the underlying resultset size then only the available rows will be returned. 
	 */
	@Test
	public void sizeGreaterThanEffectiveSize() {
		final ResultSetRewindable cut = new PagedResultSet(executeQuery(), 10, (int)(model.size() - 5));

		while (cut.hasNext()) {
			cut.next();<commit_msg>[ issue #47 ] fix on IT<commit_after>package org.gazzax.labs.solrdf.search.component;

import static org.gazzax.labs.solrdf.TestUtility.DUMMY_BASE_URI;
import static org.junit.Assert.*;

import org.apache.jena.riot.Lang;
import org.junit.Before;
import org.junit.Test;

import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetRewindable;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;

import static org.mockito.Mockito.*;

/**
 * Test case for {@link PagedResultSet}.
 * 
 * @author <NAME>
 * @since 1.0
 */
public class PagedResultSetTestCase {
	private Model model;
	
	/**
	 * Setup fixture for this test case.
	 * 
	 * @throws Exception hopefully never, otherwise the corresponding test fails.
	 */
	@Before
	public void setUp() throws Exception {
		model = ModelFactory.createDefaultModel();
		model.read(getClass().getResourceAsStream("/sample_data/bsbm-generated-dataset.nt"), DUMMY_BASE_URI, Lang.NTRIPLES.getLabel());
	}
	
	/**
	 * If the required size (+offset) is greater than the underlying resultset size then only the available rows will be returned. 
	 */
	@Test
	public void sizeGreaterThanEffectiveSize() {
		final ResultSetRewindable cut = new PagedResultSet(executeQuery(), 10, (int)(model.size() - 5));

		while (cut.hasNext()) {
			cut.next();
{'fraction_non_alphanumeric': 0.1282565130260521, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 4.4653284671532845, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4268495', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1000, 'n_words': 222}