Skip to content

Commit

Permalink
AMBARI-21068 : Kafka broker goes down after Ambari upgrade from 2.5.0…
Browse files Browse the repository at this point in the history
… to 2.5.1 due to missing 'kafka.timeline.metrics.instanceId' property. (dsen via avijayan)

(cherry picked from commit a8a90fe)

Change-Id: I57d5b9e82dc791899bb25ec45a36366dacfcf29a
  • Loading branch information
Aravindan Vijayan authored and [email protected] committed May 20, 2017
1 parent b5b5c31 commit b6d8473
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ protected void executePreDMLUpdates() throws AmbariException, SQLException {
*/
@Override
protected void executeDMLUpdates() throws AmbariException, SQLException {
addNewConfigurationsFromXml();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@

import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.createMockBuilder;
import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.newCapture;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;

import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
Expand Down Expand Up @@ -163,4 +166,21 @@ public void configure(Binder binder) {
Assert.assertEquals(Integer.valueOf(0), captured.getDefaultValue());
Assert.assertEquals(Short.class, captured.getType());
}

@Test
public void testExecuteDMLUpdates() throws Exception {
Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
UpgradeCatalog251 upgradeCatalog251 = createMockBuilder(UpgradeCatalog251.class)
.addMockedMethod(addNewConfigurationsFromXml)
.createMock();

upgradeCatalog251.addNewConfigurationsFromXml();
expectLastCall().once();

replay(upgradeCatalog251);

upgradeCatalog251.executeDMLUpdates();

verify(upgradeCatalog251);
}
}

0 comments on commit b6d8473

Please sign in to comment.