Search in sources :

Example 1 with TestEntityManager

use of com.tyndalehouse.step.core.data.entities.impl.TestEntityManager in project step by STEPBible.

the class TestUtils method createEntities.

/**
 * writes entities to the index
 *
 * @param entityName the name of the entity
 * @param fields the fields in the entity
 */
public static void createEntities(final String entityName, final String... fields) {
    final TestEntityManager manager = new TestEntityManager();
    final EntityIndexWriterImpl newWriter = manager.getNewWriter(entityName);
    for (int ii = 0; ii < fields.length; ii = ii + 2) {
        newWriter.addFieldToCurrentDocument(fields[ii], fields[ii + 1]);
    }
    newWriter.save();
    newWriter.close();
    manager.close();
}
Also used : TestEntityManager(com.tyndalehouse.step.core.data.entities.impl.TestEntityManager) EntityIndexWriterImpl(com.tyndalehouse.step.core.data.entities.impl.EntityIndexWriterImpl)

Example 2 with TestEntityManager

use of com.tyndalehouse.step.core.data.entities.impl.TestEntityManager in project step by STEPBible.

the class LoaderTest method setUp.

/**
 * sets up the test path for entities
 */
@Before
public void setUp() {
    this.entityManager = new TestEntityManager();
    final ClientSession session = mock(ClientSession.class);
    when(this.clientSessionProvider.get()).thenReturn(session);
    when(session.getLocale()).thenReturn(Locale.ENGLISH);
}
Also used : ClientSession(com.tyndalehouse.step.core.models.ClientSession) TestEntityManager(com.tyndalehouse.step.core.data.entities.impl.TestEntityManager) Before(org.junit.Before)

Example 3 with TestEntityManager

use of com.tyndalehouse.step.core.data.entities.impl.TestEntityManager in project step by STEPBible.

the class SearchServiceImplTest method setUp.

@Before
public void setUp() {
    entityManager = new TestEntityManager();
    searchServiceUnderTest = getSearchServiceUnderTest();
}
Also used : TestEntityManager(com.tyndalehouse.step.core.data.entities.impl.TestEntityManager) Before(org.junit.Before)

Aggregations

TestEntityManager (com.tyndalehouse.step.core.data.entities.impl.TestEntityManager)3 Before (org.junit.Before)2 EntityIndexWriterImpl (com.tyndalehouse.step.core.data.entities.impl.EntityIndexWriterImpl)1 ClientSession (com.tyndalehouse.step.core.models.ClientSession)1