Exemple #1
0
 @Test
 public void testExtensionRenamingIsReversible() {
   Renaming r = Renaming.extension(sid, ssid, name, sname);
   assertTrue(r.isReversible());
   Renaming reverse = Renaming.extension(ssid, sid, sname, name);
   assertEquals(reverse, r.reverse());
 }
Exemple #2
0
  @Test
  public void testProjectOnExtension() {
    Renaming r = Renaming.extension(sid, ssid, name, sname);
    Renaming expected = Renaming.extension(name, sname);

    // it works with a subset of original attributes
    AttrList list = AttrList.attrs(name);
    Renaming got = r.project(list);
    assertEquals(expected, got);

    // it is robust to a superset too (city was not part of it)
    list = AttrList.attrs(name, city);
    got = r.project(list);
    assertEquals(expected, got);
  }
Exemple #3
0
 @Test
 public void testExtensionRenamingIsTotal() {
   Renaming r = Renaming.extension(sid, ssid, name, sname);
   assertEquals(r.apply(city), city);
 }
Exemple #4
0
 @Test
 public void testItSupportsExtensionRenaming() {
   Renaming r = Renaming.extension(sid, ssid, name, sname);
   assertEquals(r.apply(sid), ssid);
   assertEquals(r.apply(name), sname);
 }