bypassGlobals = ((QuotaGlobalsSettingsBypass) other).getBypass();
assertTrue(userBypass.merge(userBypass).getBypass()); expectFailure(userBypass, new QuotaGlobalsSettingsBypass("frank", null, null, null, false)); expectFailure(userBypass, tableBypass); assertTrue(tableBypass.merge(tableBypass).getBypass()); expectFailure(tableBypass, userBypass); expectFailure(tableBypass, assertTrue(namespaceBypass.merge(namespaceBypass).getBypass()); expectFailure(namespaceBypass, userBypass); expectFailure(namespaceBypass, tableBypass); assertTrue(regionServerBypass.merge(regionServerBypass).getBypass()); expectFailure(regionServerBypass, userBypass); expectFailure(regionServerBypass, tableBypass); assertTrue(userOnTableBypass.merge(userOnTableBypass).getBypass()); expectFailure(userOnTableBypass, userBypass); expectFailure(userOnTableBypass, tableBypass); assertTrue(userOnNamespaceBypass.merge(userOnNamespaceBypass).getBypass()); expectFailure(userOnNamespaceBypass, userBypass); expectFailure(userOnNamespaceBypass, tableBypass); assertTrue(userOnRegionServerBypass.merge(userOnRegionServerBypass).getBypass()); expectFailure(userOnRegionServerBypass, userBypass); expectFailure(userOnRegionServerBypass, tableBypass);
"joe", null, "ns", true); assertTrue(userBypass.merge(userBypass).getBypass()); expectFailure(userBypass, new QuotaGlobalsSettingsBypass("frank", null, null, false)); expectFailure(userBypass, tableBypass); expectFailure(userBypass, userOnNamespaceBypass); assertTrue(tableBypass.merge(tableBypass).getBypass()); expectFailure(tableBypass, userBypass); expectFailure(tableBypass, new QuotaGlobalsSettingsBypass( expectFailure(tableBypass, userOnNamespaceBypass); assertTrue(namespaceBypass.merge(namespaceBypass).getBypass()); expectFailure(namespaceBypass, userBypass); expectFailure(namespaceBypass, tableBypass); expectFailure(namespaceBypass, userOnNamespaceBypass); assertTrue(userOnTableBypass.merge(userOnTableBypass).getBypass()); expectFailure(userOnTableBypass, userBypass); expectFailure(userOnTableBypass, tableBypass); assertTrue(userOnNamespaceBypass.merge(userOnNamespaceBypass).getBypass()); expectFailure(userOnNamespaceBypass, userBypass); expectFailure(userOnNamespaceBypass, tableBypass);
@Override protected QuotaGlobalsSettingsBypass merge(QuotaSettings newSettings) throws IOException { if (newSettings instanceof QuotaGlobalsSettingsBypass) { QuotaGlobalsSettingsBypass other = (QuotaGlobalsSettingsBypass) newSettings; validateQuotaTarget(other); if (getBypass() != other.getBypass()) { return other; } } return this; } }
@Test public void testMerge() throws IOException { QuotaGlobalsSettingsBypass orig = new QuotaGlobalsSettingsBypass("joe", null, null, true); assertFalse(orig.merge(new QuotaGlobalsSettingsBypass( "joe", null, null, false)).getBypass()); }
@Override protected QuotaGlobalsSettingsBypass merge(QuotaSettings newSettings) throws IOException { if (newSettings instanceof QuotaGlobalsSettingsBypass) { QuotaGlobalsSettingsBypass other = (QuotaGlobalsSettingsBypass) newSettings; validateQuotaTarget(other); if (getBypass() != other.getBypass()) { return other; } } return this; } }
@Override protected QuotaGlobalsSettingsBypass merge(QuotaSettings newSettings) throws IOException { if (newSettings instanceof QuotaGlobalsSettingsBypass) { QuotaGlobalsSettingsBypass other = (QuotaGlobalsSettingsBypass) newSettings; validateQuotaTarget(other); if (getBypass() != other.getBypass()) { return other; } } return this; } }
@Test public void testMerge() throws IOException { QuotaGlobalsSettingsBypass orig = new QuotaGlobalsSettingsBypass("joe", null, null, null, true); assertFalse( orig.merge(new QuotaGlobalsSettingsBypass("joe", null, null, null, false)).getBypass()); }