Search in sources :

Example 1 with RealmRepository

use of org.jaffa.rules.realm.RealmRepository in project jaffa-framework by jaffa-projects.

the class RealmRepositoryTest method testAddRealm.

/**
 * Registering a Rule should behave as though it were loaded from an XML element.
 */
@Test
public void testAddRealm() {
    Realm realm = new Realm("x");
    realm.setSource("s");
    RealmRepository target = RealmRepository.instance();
    target.addRealm(realm);
    List<Realm> actual = target.getRealmsBySource("s");
    assertEquals(1, actual.size());
    assertSame(realm, actual.get(0));
}
Also used : RealmRepository(org.jaffa.rules.realm.RealmRepository) Realm(org.jaffa.rules.realm.Realm) Test(org.junit.Test)

Aggregations

Realm (org.jaffa.rules.realm.Realm)1 RealmRepository (org.jaffa.rules.realm.RealmRepository)1 Test (org.junit.Test)1