@Test public void testExecuteUpgradeDDLUpdates() throws Exception{ final DBAccessor dbAccessor = createNiceMock(DBAccessor.class); dbAccessor.addColumn(eq("upgrade"), anyObject(DBAccessor.DBColumnInfo.class)); expectLastCall().times(3); replay(dbAccessor); Module module = new Module() { @Override public void configure(Binder binder) { binder.bind(DBAccessor.class).toInstance(dbAccessor); binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class)); binder.bind(EntityManager.class).toInstance(entityManager); } }; Injector injector = Guice.createInjector(module); UpgradeCatalog220 upgradeCatalog220 = injector.getInstance(UpgradeCatalog220.class); upgradeCatalog220.executeUpgradeDDLUpdates(); verify(dbAccessor); }
protected void executeUpgradeDDLUpdates() throws AmbariException, SQLException { updateUpgradesDDL(); }
UpgradeCatalog220 extends AbstractUpgradeCatalog { protected void executeUpgradeDDLUpdates() throws AmbariException, SQLException { updateUpgradesDDL(); } }
UpgradeCatalog220 extends AbstractUpgradeCatalog { protected void executeUpgradeDDLUpdates() throws AmbariException, SQLException { updateUpgradesDDL(); } @Inject  UpgradeCatalog220(Injector injector); }
UpgradeCatalog220 extends AbstractUpgradeCatalog { protected void executeUpgradeDDLUpdates() throws AmbariException, SQLException { updateUpgradesDDL(); } @Inject  UpgradeCatalog220(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); @Transactional void bootstrapRepoVersionForHDP21(); }
UpgradeCatalog220 extends AbstractUpgradeCatalog { protected void executeUpgradeDDLUpdates() throws AmbariException, SQLException { updateUpgradesDDL(); } @Inject  UpgradeCatalog220(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); @Transactional void bootstrapRepoVersionForHDP21(); static final String UPGRADE_PACKAGE_COL; static final String UPGRADE_TYPE_COL; static final String REPO_VERSION_TABLE; }