<commit_before>package org.demyo.test;

import javax.naming.NamingException;
import javax.sql.DataSource;

import org.demyo.test.desktop.TestDesktopCallbacks;

import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.mock.jndi.SimpleNamingContextBuilder;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Base class for persistence tests.
 */
@RunWith(SpringJUnit4ClassRunner.class)
public abstract class AbstractPersistenceTest {
	protected static final int DEFAULT_PAGE_SIZE = 10;

	/**
	 * Initializes the JNDI information.
	 * 
	 * @throws NamingException If binding fails.
	 */
	@BeforeClass
	public static void setupJNDI() throws NamingException {
		SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
		DataSource ds = new DriverManagerDataSource("jdbc:h2:mem:demyo_tests;DB_CLOSE_DELAY=120;IGNORECASE=TRUE");
		builder.bind("org.demyo.services.dataSource", ds);

		builder.bind("org.demyo.services.desktop", new TestDesktopCallbacks());
	}
}<commit_msg>Adding a TODO<commit_after>package org.demyo.test;

import javax.naming.NamingException;
import javax.sql.DataSource;

import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.mock.jndi.SimpleNamingContextBuilder;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.demyo.test.desktop.TestDesktopCallbacks;

/**
 * Base class for persistence tests.
 */
@RunWith(SpringJUnit4ClassRunner.class)
// TODO: try to solve https://stackoverflow.com/questions/27652689/spring-test-dbunit-warning
public abstract class AbstractPersistenceTest {
	protected static final int DEFAULT_PAGE_SIZE = 10;

	/**
	 * Initializes the JNDI information.
	 * 
	 * @throws NamingException If binding fails.
	 */
	@BeforeClass
	public static void setupJNDI() throws NamingException {
		SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
		DataSource ds = new DriverManagerDataSource("jdbc:h2:mem:demyo_tests;DB_CLOSE_DELAY=120;IGNORECASE=TRUE");
		builder.bind("org.demyo.services.dataSource", ds);

		builder.bind("org.demyo.services.desktop", new TestDesktopCallbacks());
	}
}
{'fraction_non_alphanumeric': 0.09932375316990702, 'fraction_numerical': 0.01098901098901099, 'mean_word_length': 6.350931677018633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3635860', 'n_tokens_mistral': 752, 'n_tokens_neox': 688, 'n_words': 131}