@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()); }
@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); }
@Test public void testExtensionRenamingIsTotal() { Renaming r = Renaming.extension(sid, ssid, name, sname); assertEquals(r.apply(city), city); }
@Test public void testItSupportsExtensionRenaming() { Renaming r = Renaming.extension(sid, ssid, name, sname); assertEquals(r.apply(sid), ssid); assertEquals(r.apply(name), sname); }