use of com.cloud.configuration.DefaultInterceptorLibrary in project CloudStack-archive by CloudStack-extras.
the class CheckPointManagerTest method setUp.
@Override
@Before
public void setUp() {
MockComponentLocator locator = new MockComponentLocator("management-server");
locator.addDao("StackMaidDao", StackMaidDaoImpl.class);
locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
locator.addManager("ClusterManager", MockClusterManager.class);
locator.makeActive(new DefaultInterceptorLibrary());
MockMaid.map.clear();
s_logger.info("Cleaning up the database");
Connection conn = Transaction.getStandaloneConnection();
try {
conn.setAutoCommit(true);
PreparedStatement stmt = conn.prepareStatement("DELETE FROM stack_maid");
stmt.executeUpdate();
stmt.close();
conn.close();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to setup database", e);
}
}
use of com.cloud.configuration.DefaultInterceptorLibrary in project CloudStack-archive by CloudStack-extras.
the class SecurityGroupManagerImpl2Test method setUp.
@Before
@Override
public void setUp() {
MockComponentLocator locator = new MockComponentLocator("management-server");
locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
locator.addDao("SecurityGroupDao", SecurityGroupDaoImpl.class);
//locator.addDao("IngressRuleDao", IngressRuleDaoImpl.class);
locator.addDao("SecurityGroupVMMapDao", SecurityGroupVMMapDaoImpl.class);
locator.addDao("SecurityGroupRulesDao", SecurityGroupRulesDaoImpl.class);
locator.addDao("UserVmDao", UserVmDaoImpl.class);
locator.addDao("AccountDao", AccountDaoImpl.class);
locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
locator.addDao("SecurityGroupWorkDao", SecurityGroupWorkDaoImpl.class);
locator.addDao("VmRulesetLogDao", VmRulesetLogDaoImpl.class);
locator.addDao("VMInstanceDao", VMInstanceDaoImpl.class);
locator.addDao("DomainDao", DomainDaoImpl.class);
locator.addManager("AgentManager", MockAgentManagerImpl.class);
locator.addManager("VirtualMachineManager", MockVirtualMachineManagerImpl.class);
locator.addManager("UserVmManager", MockUserVmManagerImpl.class);
locator.addManager("NetworkManager", MockNetworkManagerImpl.class);
locator.addManager("AccountManager", MockAccountManagerImpl.class);
locator.makeActive(new DefaultInterceptorLibrary());
_sgMgr = ComponentLocator.inject(SecurityGroupManagerImpl2.class);
}
Aggregations