/** * <p> * Create a {@link ServerManager} instance. * </p> * <p> * Will be overridden in tests. * </p> */ @VisibleForTesting protected ServerManager createServerManager(final MasterServices master) throws IOException { // We put this out here in a method so can do a Mockito.spy and stub it out // w/ a mocked up ServerManager. setupClusterConnection(); return new ServerManager(master); }
this.serverManager = new ServerManager(this); this.tableStateManager = Mockito.mock(TableStateManager.class); Mockito.when(this.tableStateManager.getTableState(Mockito.any())).
@Test public void testClockSkewDetection() throws Exception { final Configuration conf = HBaseConfiguration.create(); ServerManager sm = new ServerManager(new MockNoopMasterServices(conf) { @Override public ClusterConnection getClusterConnection() {
/** * Create a {@link ServerManager} instance. * @param master * @param services * @return An instance of {@link ServerManager} * @throws org.apache.hadoop.hbase.ZooKeeperConnectionException * @throws IOException */ ServerManager createServerManager(final Server master, final MasterServices services) throws IOException { // We put this out here in a method so can do a Mockito.spy and stub it out // w/ a mocked up ServerManager. return new ServerManager(master, services); }
ServerManager serverManager = new ServerManager(); var site = serverManager.Sites.Where(s => s.Id == 1).SingleOrDefault(); Configuration siteConfig = serverManager.GetApplicationHostConfiguration(); ConfigurationSection handlersSection = siteConfig.GetSection("system.webServer/handlers", site.Name); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); foreach (var item in handlersCollection) { Console.WriteLine(item.Attributes["name"].Value); }
ServerManager serverManager = new ServerManager(); Configuration siteConfig = serverManager.GetWebConfiguration("Default Web Site"); ConfigurationSection handlersSection = siteConfig.GetSection("system.webServer/handlers"); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); foreach (var item in handlersCollection) { Console.WriteLine(item.Attributes["name"].Value); }
public class StatusPane extends JPanel{ private ServerManager mServer; public StatusPane() { ... mServer = new ServerManager(); mServer.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { System.out.println(evt.getPropertyName() + " cambia su valor de " + evt.getOldValue() + " a " + evt.getNewValue()); } }); ... } }
this.serverManager = new ServerManager(this); this.tableStateManager = Mockito.mock(TableStateManager.class); Mockito.when(this.tableStateManager.getTableState(Mockito.any())).
@Test public void testClockSkewDetection() throws Exception { final Configuration conf = HBaseConfiguration.create(); ServerManager sm = new ServerManager(new MockNoopMasterServices(conf) { @Override public ClusterConnection getClusterConnection() {
if (!masterRecovery) { this.executorService = new ExecutorService(getServerName().toString()); this.serverManager = new ServerManager(this, this);