target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testThresholdCrossedDescending() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(30, 50); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = new MyThresholdListener...
public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
@Test public void testThresholdCrossedAscendingWithStep() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(0, 5, 2); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = new MyThreshold...
public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
@Test public void testThresholdCrossedDescendingWithStep() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(30, 50, 2); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = new MyThresh...
public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
@Test public void testThresholdCrossedMixedBagWithStep() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(30, 50, 2.2); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = new MyThresh...
public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
@Test public void testClearAll() { Statistics stat = new Statistics(); for (int i = 0; i < 5; i++) { stat.clearAll(); assertClean(stat); } List<Double> list = new ArrayList<>(); list.add((double) 0); list.add((double) 1); list.add((double) 2); stat.setValues(list); assertCorrect(list, stat); for (int i = 0; i < 5; i++)...
public void clearAll() { v.clear(); }
Statistics { public void clearAll() { v.clear(); } }
Statistics { public void clearAll() { v.clear(); } Statistics(); Statistics(Iterable<Double> values); }
Statistics { public void clearAll() { v.clear(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector getValues(); void addValue(Double ...
Statistics { public void clearAll() { v.clear(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector getValues(); void addValue(Double ...
@Test public void testThresholdCrossedMixedBagOfPercentsWithStep() throws Exception { BoundedThresholdManager thresholdManager = new BoundedThresholdManager("foo"); ThresholdValues thresholdValues = new ThresholdValues(.30, .50, .1); thresholdManager.setThresholdValues(thresholdValues); MyThresholdListener listener = n...
public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed = false; direction = CLEARED; thresholdValues.incTh...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
BoundedThresholdManager extends ThresholdManager { public void checkThreshold(Calculable calculable) { ThresholdValues thresholdValues = getThresholdValues(); double value = calculable.getValue(); if(thresholdCrossed) { if(direction == BREACHED_UPPER) { if(value < thresholdValues.getHighThreshold()) { thresholdCrossed ...
@Test public void testExport() throws Exception { final int N = 3; Integer[] counts = new Integer[N]; for (int i = 0; i < N; i++) { counts[i] = i; } Object[][] combinations = ArrayUtils.combinations(new Object[][] { counts, counts, booleanAxis}); int i = 0; while (i < combinations.length) { int exportCount = (Integer) ...
public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logger.error("Getting watchDataSourceExporter", e); } } proxy = (WatchDataSource)expo...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logger.error("Gett...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logger.error("Gett...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logger.error("Gett...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logger.error("Gett...
@Test public void testUnexport() throws Exception { final int N = 3; Integer[] counts = new Integer[N]; for (int i = 0; i < N; i++) { counts[i] = i; } Object[][] combinations = ArrayUtils.combinations(new Object[][] { counts, counts, booleanAxis}); for (Object[] combination : combinations) { int exportCount = (Integer)...
public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initial...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initial...
@Test public void testGetProxy() throws Exception { final int N = 5; Integer[] counts = new Integer[N]; for (int i = 0; i < N; i++) { counts[i] = i; } Object[][] combinations = ArrayUtils.combinations(new Object[][] { counts, counts, booleanAxis}); for (Object[] combination : combinations) { int exportCount = (Integer)...
public WatchDataSource getProxy() { return (proxy); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource getProxy() { return (proxy); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource getProxy() { return (proxy); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource getProxy() { return (proxy); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); voi...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource getProxy() { return (proxy); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); voi...
@Test public void testGetID() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); Assert.assertEquals("watch", impl.getID()); impl.setID("aaa"); Assert.assertEquals("aaa", impl.getID()); impl.close(); }
public String getID() { return (id); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getID() { return (id); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getID() { return (id); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getID() { return (id); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unexport(bool...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getID() { return (id); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unexport(bool...
@Test public void testSetID() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("aaa"); Assert.assertEquals("aaa", impl.getID()); impl.setID(""); Assert.assertEquals("", impl.getID()); try { impl.setID("bbb"); impl.setID(null); Assert.fail("IllegalArgumentException expected but not thr...
public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getP...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getP...
@Test public void testClear() throws Exception { final int DCS = WatchDataSourceImpl.DEFAULT_COLLECTION_SIZE; WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(EmptyConfiguration.INSTANCE); for (int j = 0; j < DCS; j++) { impl.addCalculable(new Calculable()); } DataSourceM...
public void clear() { synchronized(history) { history.clear(); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void clear() { synchronized(history) { history.clear(); } } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void clear() { synchronized(history) { history.clear(); } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void clear() { synchronized(history) { history.clear(); } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void clear() { synchronized(history) { history.clear(); } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration...
@Test public void testGetCurrentSize() throws Exception { final int DCS = WatchDataSourceImpl.DEFAULT_COLLECTION_SIZE; WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(EmptyConfiguration.INSTANCE); for (int j = 0; j < DCS; j++) { impl.addCalculable(new Calculable()); } Da...
public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy...
@Test public void testAddCalculable() throws Exception { doTestAddCalculable(LoggingWatchDataReplicator.class.getName()); doTestAddCalculable(RemoteWDR.class.getName()); }
@SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : getWatchDataReplicators()) { if(logger.isTraceEnabled()) logger.trace("Replicating...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { @SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : getWatchDataRep...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { @SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : getWatchDataRep...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { @SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : getWatchDataRep...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { @SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : getWatchDataRep...
@Test public void testAddWatchDataReplicator() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(new DynamicConfiguration()); WatchDataReplicator wdr1 = new LoggingWatchDataReplicator(); impl.addWatchDataReplicator(wdr1); Assert.assertSame(wdr1, impl.get...
public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } Wa...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } Wa...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } Wa...
@Test public void testGetValues() { Statistics stat = new Statistics(); Assert.assertEquals(new Vector(), stat.getValues()); for (int i = 0; i < 10; i++) { Vector<Double> v = new Vector<>(); int count = (int) (Math.random() * 1000); for (int j = 0; j < count; j++) { double d = Math.random(); stat.addValue(d); v.add(d);...
public Vector getValues() { return (Vector)v.clone(); }
Statistics { public Vector getValues() { return (Vector)v.clone(); } }
Statistics { public Vector getValues() { return (Vector)v.clone(); } Statistics(); Statistics(Iterable<Double> values); }
Statistics { public Vector getValues() { return (Vector)v.clone(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector getValues(); voi...
Statistics { public Vector getValues() { return (Vector)v.clone(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector getValues(); voi...
@Test public void testGetThresholdValues() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setThresholdManager(new BoundedThresholdManager("watch")); impl.setID("watch"); impl.setConfiguration(EmptyConfiguration.INSTANCE); ThresholdValues tv = impl.getThresholdValues(); Assert.assertNotNul...
public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; } WatchDataSourceImp...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; } WatchDataSourceImp...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; } WatchDataSourceImp...
@Test public void testSetThresholdValues() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setThresholdManager(new BoundedThresholdManager("watch")); impl.setConfiguration(EmptyConfiguration.INSTANCE); ThresholdValues tv = new ThresholdValues(); impl.setThresholdValues...
public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(...
@Test public void testClose() throws Exception { final int N = 3; Integer[] counts = new Integer[N]; for (int i = 0; i < N; i++) { counts[i] = i; } Object[][] combinations = ArrayUtils.combinations(new Object[][] { counts, counts, counts}); for (Object[] combination : combinations) { int exportCount = (Integer) combina...
public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configur...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configur...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configur...
@Test public void testGetView() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(EmptyConfiguration.INSTANCE); Assert.assertEquals(null, impl.getView()); impl.setView("abcd"); Assert.assertEquals("abcd", impl.getView()); impl.close(); }
public String getView() { return (viewClass); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getView() { return (viewClass); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getView() { return (viewClass); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getView() { return (viewClass); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unex...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getView() { return (viewClass); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unex...
@Test public void testSetView() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(EmptyConfiguration.INSTANCE); impl.setView("abcd"); Assert.assertEquals("abcd", impl.getView()); impl.setView(""); Assert.assertEquals("", impl.getView()); impl.setView(nul...
public void setView(String viewClass) { this.viewClass = viewClass; }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setView(String viewClass) { this.viewClass = viewClass; } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setView(String viewClass) { this.viewClass = viewClass; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setView(String viewClass) { this.viewClass = viewClass; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configurat...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setView(String viewClass) { this.viewClass = viewClass; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configurat...
@Test public void testGetProxyVerifier() throws Exception { final int N = 3; Integer[] counts = new Integer[N]; for (int i = 0; i < N; i++) { counts[i] = i; } Object[][] combinations = ArrayUtils.combinations(new Object[][] { counts, counts}); for (Object[] combination : combinations) { int exportCount = (Integer) comb...
public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfi...
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfi...
@Test public void testGetPeriod() { MyPeriodicWatch watch = new MyPeriodicWatch("watch"); Assert.assertEquals(PeriodicWatch.DEFAULT_PERIOD, watch.getPeriod()); for (int i = 0; i < 10; i++) { long value = Math.round(Math.random() * 100) + 1; watch.setPeriod(value); Assert.assertEquals(value, watch.getPeriod()); } Utils....
public long getPeriod() { return (period); }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public long getPeriod() { return (period); } }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public long getPeriod() { return (period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public long getPeriod() { return (period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); void start(); void stop(); long getPeriod(); void setPeriod(long newPer...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public long getPeriod() { return (period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); void start(); void stop(); long getPeriod(); void setPeriod(long newPer...
@Test public void testSetPeriod() { MyPeriodicWatch watch = new MyPeriodicWatch("watch"); watch.start(); Assert.assertEquals(PeriodicWatch.DEFAULT_PERIOD, watch.getPeriod()); for (int i = 0; i < 10; i++) { long value = Math.round(Math.random() * 100) + 1; watch.setPeriod(value); Assert.assertEquals(value, watch.getPeri...
public void setPeriod(long newPeriod) { if(newPeriod == period) return; if(newPeriod <= 0) throw new IllegalArgumentException("period cannot be less then or equal to zero"); this.period = newPeriod; if(watchTimer!=null) { stop(); start(); } }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void setPeriod(long newPeriod) { if(newPeriod == period) return; if(newPeriod <= 0) throw new IllegalArgumentException("period cannot be less then or equal to zero"); this.period = newPeriod; if(watchTimer!=null) { stop(); start(); } } }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void setPeriod(long newPeriod) { if(newPeriod == period) return; if(newPeriod <= 0) throw new IllegalArgumentException("period cannot be less then or equal to zero"); this.period = newPeriod; if(watchTimer!=null) { stop(); start(); } } Periodic...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void setPeriod(long newPeriod) { if(newPeriod == period) return; if(newPeriod <= 0) throw new IllegalArgumentException("period cannot be less then or equal to zero"); this.period = newPeriod; if(watchTimer!=null) { stop(); start(); } } Periodic...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void setPeriod(long newPeriod) { if(newPeriod == period) return; if(newPeriod <= 0) throw new IllegalArgumentException("period cannot be less then or equal to zero"); this.period = newPeriod; if(watchTimer!=null) { stop(); start(); } } Periodic...
@Test public void testStart() { MyPeriodicWatch watch = new MyPeriodicWatch("watch"); watch.setPeriod(500); watch.stop(); watch.start(); Utils.sleep(5000); watch.stop(); Assert.assertTrue(watch.log().length() >= 8); Assert.assertTrue(watch.log().length() <= 12); watch.log().delete(0, watch.log().length()); watch.start(...
public void start() { long now = System.currentTimeMillis(); stop(); watchTimer = new Timer(true); watchTimer.schedule(new PeriodicTask(), new Date(now+period), period); }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void start() { long now = System.currentTimeMillis(); stop(); watchTimer = new Timer(true); watchTimer.schedule(new PeriodicTask(), new Date(now+period), period); } }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void start() { long now = System.currentTimeMillis(); stop(); watchTimer = new Timer(true); watchTimer.schedule(new PeriodicTask(), new Date(now+period), period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); Per...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void start() { long now = System.currentTimeMillis(); stop(); watchTimer = new Timer(true); watchTimer.schedule(new PeriodicTask(), new Date(now+period), period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); Per...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void start() { long now = System.currentTimeMillis(); stop(); watchTimer = new Timer(true); watchTimer.schedule(new PeriodicTask(), new Date(now+period), period); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); Per...
@Test public void testStop() { MyPeriodicWatch watch = new MyPeriodicWatch("watch"); watch.start(); watch.setPeriod(500); Utils.sleep(5000); watch.stop(); Assert.assertTrue(watch.log().length() >= 8); Assert.assertTrue(watch.log().length() <= 12); watch.log().delete(0, watch.log().length()); Utils.sleep(2000); Assert.a...
public void stop() { if(watchTimer != null) watchTimer.cancel(); }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void stop() { if(watchTimer != null) watchTimer.cancel(); } }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void stop() { if(watchTimer != null) watchTimer.cancel(); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); }
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void stop() { if(watchTimer != null) watchTimer.cancel(); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); void start(); void stop(); long getPeriod(); void...
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public void stop() { if(watchTimer != null) watchTimer.cancel(); } PeriodicWatch(String id); PeriodicWatch(String id, Configuration config); PeriodicWatch(WatchDataSource watchDataSource, String id); void start(); void stop(); long getPeriod(); void...
@Test public void testSetValues() { Statistics stat = new Statistics(); for (int i = 0; i < 10; i++) { Vector<Double> v = new Vector<>(); int count = (int) (Math.random() * 100); for (int j = 0; j < count; j++) { v.add(Math.random()); stat.setValues(v); Assert.assertEquals(v, stat.getValues()); Assert.assertNotSame(v, ...
public void setValues(Iterable<Double> vals) { if(vals==null) throw new IllegalArgumentException("vector is null"); v.clear(); for(Double d : vals) v.add(d); }
Statistics { public void setValues(Iterable<Double> vals) { if(vals==null) throw new IllegalArgumentException("vector is null"); v.clear(); for(Double d : vals) v.add(d); } }
Statistics { public void setValues(Iterable<Double> vals) { if(vals==null) throw new IllegalArgumentException("vector is null"); v.clear(); for(Double d : vals) v.add(d); } Statistics(); Statistics(Iterable<Double> values); }
Statistics { public void setValues(Iterable<Double> vals) { if(vals==null) throw new IllegalArgumentException("vector is null"); v.clear(); for(Double d : vals) v.add(d); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); doubl...
Statistics { public void setValues(Iterable<Double> vals) { if(vals==null) throw new IllegalArgumentException("vector is null"); v.clear(); for(Double d : vals) v.add(d); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); doubl...
@Test public void testAddValue1() throws RemoteException { String id = "watch"; GaugeWatch watch = new GaugeWatch(id); DataSourceMonitor mon = new DataSourceMonitor(watch); final int checkpoints[] = new int[] {0, 1, 50, 1000, 1001, 2000, 10000}; final int collectionSize = 1000; List<Double> added = new ArrayList<Double...
public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); void addValue(long value); void addValue(d...
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); void addValue(long value); void addValue(d...
@Test public void testAddValue2() throws RemoteException { String id = "watch"; GaugeWatch watch = new GaugeWatch(id); DataSourceMonitor mon = new DataSourceMonitor(watch); final int checkpoints[] = new int[] {0, 1, 50, 1000, 1001, 2000, 10000}; final int collectionSize = 1000; List<Long> added = new ArrayList<Long>();...
public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); }
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); void addValue(long value); void addValue(d...
GaugeWatch extends ThresholdWatch { public void addValue(long value) { addWatchRecord(new Calculable(id, (double)value, System.currentTimeMillis())); } GaugeWatch(String id); GaugeWatch(String id, Configuration config); GaugeWatch(WatchDataSource watchDataSource, String id); void addValue(long value); void addValue(d...
@Test public void testCloseAll() { WatchDataSourceRegistry registry = new WatchDataSourceRegistry(); int[] counts = new int[] {0, 1, 10, 100}; for (int count : counts) { Collection<Watch> watches = new ArrayList<Watch>(); for (int j = 0; j < count; j++) { String id = "watch" + j; LoggingWatchDataSource ds = new Logging...
public void closeAll() { Watch[] watches = watchRegistry.toArray(new Watch[0]); for(Watch w : watches) { if(w instanceof PeriodicWatch) ((PeriodicWatch)w).stop(); try { WatchDataSource wd = w.getWatchDataSource(); if (wd != null) wd.close(); watchRegistry.remove(w); } catch (Exception e) { logger.warn("Closing WatchDat...
WatchDataSourceRegistry implements WatchRegistry { public void closeAll() { Watch[] watches = watchRegistry.toArray(new Watch[0]); for(Watch w : watches) { if(w instanceof PeriodicWatch) ((PeriodicWatch)w).stop(); try { WatchDataSource wd = w.getWatchDataSource(); if (wd != null) wd.close(); watchRegistry.remove(w); } ...
WatchDataSourceRegistry implements WatchRegistry { public void closeAll() { Watch[] watches = watchRegistry.toArray(new Watch[0]); for(Watch w : watches) { if(w instanceof PeriodicWatch) ((PeriodicWatch)w).stop(); try { WatchDataSource wd = w.getWatchDataSource(); if (wd != null) wd.close(); watchRegistry.remove(w); } ...
WatchDataSourceRegistry implements WatchRegistry { public void closeAll() { Watch[] watches = watchRegistry.toArray(new Watch[0]); for(Watch w : watches) { if(w instanceof PeriodicWatch) ((PeriodicWatch)w).stop(); try { WatchDataSource wd = w.getWatchDataSource(); if (wd != null) wd.close(); watchRegistry.remove(w); } ...
WatchDataSourceRegistry implements WatchRegistry { public void closeAll() { Watch[] watches = watchRegistry.toArray(new Watch[0]); for(Watch w : watches) { if(w instanceof PeriodicWatch) ((PeriodicWatch)w).stop(); try { WatchDataSource wd = w.getWatchDataSource(); if (wd != null) wd.close(); watchRegistry.remove(w); } ...
@Test public void testFindWatch() { WatchDataSourceRegistry registry = new WatchDataSourceRegistry(); int[] counts = new int[] {0, 1, 10, 100}; for (int count : counts) { Collection<Watch> watches = new ArrayList<Watch>(); for (int k = 0; k < count; k++) { String id = "watch" + k; if (k == 1) { id = ""; } WatchDataSour...
public Watch findWatch(String id) { if(id == null) throw new IllegalArgumentException("id is null"); Watch watch = null; for(Watch w : watchRegistry) { if(id.equals(w.getId())) { watch = w; break; } } return watch; }
WatchDataSourceRegistry implements WatchRegistry { public Watch findWatch(String id) { if(id == null) throw new IllegalArgumentException("id is null"); Watch watch = null; for(Watch w : watchRegistry) { if(id.equals(w.getId())) { watch = w; break; } } return watch; } }
WatchDataSourceRegistry implements WatchRegistry { public Watch findWatch(String id) { if(id == null) throw new IllegalArgumentException("id is null"); Watch watch = null; for(Watch w : watchRegistry) { if(id.equals(w.getId())) { watch = w; break; } } return watch; } }
WatchDataSourceRegistry implements WatchRegistry { public Watch findWatch(String id) { if(id == null) throw new IllegalArgumentException("id is null"); Watch watch = null; for(Watch w : watchRegistry) { if(id.equals(w.getId())) { watch = w; break; } } return watch; } void deregister(Watch... watches); void closeAll();...
WatchDataSourceRegistry implements WatchRegistry { public Watch findWatch(String id) { if(id == null) throw new IllegalArgumentException("id is null"); Watch watch = null; for(Watch w : watchRegistry) { if(id.equals(w.getId())) { watch = w; break; } } return watch; } void deregister(Watch... watches); void closeAll();...
@Test public void testAddThresholdListener() { WatchDataSourceRegistry registry = new WatchDataSourceRegistry(); int[] watchCounts = new int[] {1, 5, 10}; int[] listenerCounts = new int[] {1, 5, 10}; for (int ordering = 0; ordering < 3; ordering++) { for (int watchCount : watchCounts) { for (int listenerCount : listene...
public void addThresholdListener(String id, ThresholdListener thresholdListener) { if(id==null) throw new IllegalArgumentException("id is null"); if(thresholdListener==null) throw new IllegalArgumentException("thresholdListener is null"); Collection<ThresholdListener> collection; if(thresholdListenerTable.containsKey(i...
WatchDataSourceRegistry implements WatchRegistry { public void addThresholdListener(String id, ThresholdListener thresholdListener) { if(id==null) throw new IllegalArgumentException("id is null"); if(thresholdListener==null) throw new IllegalArgumentException("thresholdListener is null"); Collection<ThresholdListener> ...
WatchDataSourceRegistry implements WatchRegistry { public void addThresholdListener(String id, ThresholdListener thresholdListener) { if(id==null) throw new IllegalArgumentException("id is null"); if(thresholdListener==null) throw new IllegalArgumentException("thresholdListener is null"); Collection<ThresholdListener> ...
WatchDataSourceRegistry implements WatchRegistry { public void addThresholdListener(String id, ThresholdListener thresholdListener) { if(id==null) throw new IllegalArgumentException("id is null"); if(thresholdListener==null) throw new IllegalArgumentException("thresholdListener is null"); Collection<ThresholdListener> ...
WatchDataSourceRegistry implements WatchRegistry { public void addThresholdListener(String id, ThresholdListener thresholdListener) { if(id==null) throw new IllegalArgumentException("id is null"); if(thresholdListener==null) throw new IllegalArgumentException("thresholdListener is null"); Collection<ThresholdListener> ...
@Test(expected = IllegalArgumentException.class) public void testGetConfigArgsNoCLassLoader() throws IOException { ConfigHelper.getConfigArgs(new ServiceElement(), null); }
public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
@Test public void testUsingConfig() throws IOException { ServiceElement service = new ServiceElement(); service.getServiceBeanConfig().setConfigArgs(getConfig()); String[] args = ConfigHelper.getConfigArgs(service); Assert.assertNotNull(args); Assert.assertEquals(1, args.length); File file = new File(args[0]); Assert.a...
public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
@Test public void testUsingGroovyConfig() throws IOException { ServiceElement service = new ServiceElement(); service.getServiceBeanConfig().setConfigArgs(getGroovyConfig()); String[] args = ConfigHelper.getConfigArgs(service); Assert.assertNotNull(args); Assert.assertEquals(1, args.length); File file = new File(args[0...
public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
@Test(expected = FileNotFoundException.class) public void testUsingMissingGroovyFile() throws IOException { ServiceElement service = new ServiceElement(); service.getServiceBeanConfig().setConfigArgs("file:foo"); String[] args = ConfigHelper.getConfigArgs(service); Assert.assertNotNull(args); Configuration configuratio...
public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } }
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
ConfigHelper { public static String[] getConfigArgs(final ServiceElement service) throws IOException { return getConfigArgs(service, Thread.currentThread().getContextClassLoader()); } static String[] getConfigArgs(final ServiceElement service); static String[] getConfigArgs(final ServiceElement service, final ClassLoa...
@Test public void testLoadClass() throws Exception { ClassBundle classBundle = new ClassBundle(JustForTesting.class.getName()); classBundle.setCodebase(System.getProperty("user.dir")+File.separator+ "target"+File.separator+ "test-classes"+File.separator); Class testClass = ClassBundleLoader.loadClass(classBundle); Asse...
public static Class<?> loadClass(ClassBundle bundle) throws ClassNotFoundException, MalformedURLException { Class<?> theClass; final Thread currentThread = Thread.currentThread(); final ClassLoader cCL = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>) currentThread::getContextClassLoader); try { theClass...
ClassBundleLoader { public static Class<?> loadClass(ClassBundle bundle) throws ClassNotFoundException, MalformedURLException { Class<?> theClass; final Thread currentThread = Thread.currentThread(); final ClassLoader cCL = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>) currentThread::getContextClassLoa...
ClassBundleLoader { public static Class<?> loadClass(ClassBundle bundle) throws ClassNotFoundException, MalformedURLException { Class<?> theClass; final Thread currentThread = Thread.currentThread(); final ClassLoader cCL = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>) currentThread::getContextClassLoa...
ClassBundleLoader { public static Class<?> loadClass(ClassBundle bundle) throws ClassNotFoundException, MalformedURLException { Class<?> theClass; final Thread currentThread = Thread.currentThread(); final ClassLoader cCL = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>) currentThread::getContextClassLoa...
ClassBundleLoader { public static Class<?> loadClass(ClassBundle bundle) throws ClassNotFoundException, MalformedURLException { Class<?> theClass; final Thread currentThread = Thread.currentThread(); final ClassLoader cCL = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>) currentThread::getContextClassLoa...
@Test public void testRemoveValue() { List<Double> v = asList(new double[]{ 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); Statistics stat = new Statistics(v); while (stat.count() > 0) { int i = (int) (Math.random() * stat.count...
public void removeValue(int location) { if(location < v.size() && location >= 0) v.removeElementAt(location); }
Statistics { public void removeValue(int location) { if(location < v.size() && location >= 0) v.removeElementAt(location); } }
Statistics { public void removeValue(int location) { if(location < v.size() && location >= 0) v.removeElementAt(location); } Statistics(); Statistics(Iterable<Double> values); }
Statistics { public void removeValue(int location) { if(location < v.size() && location >= 0) v.removeElementAt(location); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double rang...
Statistics { public void removeValue(int location) { if(location < v.size() && location >= 0) v.removeElementAt(location); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double rang...
@Test public void testInjectProxy() { Association<Dummy> a = new DefaultAssociation<Dummy>(createAssociationDescriptor()); Target1 t = new Target1(); AssociationInjector<Dummy> ai = new AssociationInjector<Dummy>(t); for(int i=0; i<10; i++) { Dummy dummy = new DummyImpl(i); a.addServiceItem(AssociationUtils.makeService...
public void discovered(Association<T> association, T service) { inject(association, service); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
@Test public void testInjectProxyWithListener() { Association<Dummy> a = new DefaultAssociation<Dummy>(createAssociationDescriptor()); Target1 t = new Target1(); AssociationInjector<Dummy> ai = new AssociationInjector<Dummy>(t); AL aL = new AL(); a.registerAssociationServiceListener(aL); for(int i=0; i<10; i++) { Dummy...
public void discovered(Association<T> association, T service) { inject(association, service); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
@Test public void testInjectIterable() { Association<Dummy> a = new DefaultAssociation<Dummy>(createAssociationDescriptor()); Target2 t = new Target2(); AssociationInjector<Dummy> ai = new AssociationInjector<Dummy>(t); for(int i=0; i<10; i++) { Dummy dummy = new DummyImpl(i); a.addServiceItem(AssociationUtils.makeServ...
public void discovered(Association<T> association, T service) { inject(association, service); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
@Test public void testInjectAssociation() { Association<Dummy> a = new DefaultAssociation<Dummy>(createAssociationDescriptor()); Target3 t = new Target3(); AssociationInjector<Dummy> ai = new AssociationInjector<Dummy>(t); for(int i=0; i<10; i++) { Dummy dummy = new DummyImpl(i); ServiceItem item = AssociationUtils.mak...
public void discovered(Association<T> association, T service) { inject(association, service); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); }
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
AssociationInjector implements AssociationListener<T> { public void discovered(Association<T> association, T service) { inject(association, service); } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> ...
@Test public void testEagerInjection() { DefaultAssociationManagement aMgr = new DefaultAssociationManagement(); Target5 target = new Target5(); aMgr.setBackend(target); AssociationDescriptor descriptor = createAssociationDescriptor(); descriptor.setLazyInject(false); Association<Dummy> a = aMgr.addAssociationDescripto...
public void setBackend(Object target) { this.target = target; }
AssociationInjector implements AssociationListener<T> { public void setBackend(Object target) { this.target = target; } }
AssociationInjector implements AssociationListener<T> { public void setBackend(Object target) { this.target = target; } AssociationInjector(Object target); }
AssociationInjector implements AssociationListener<T> { public void setBackend(Object target) { this.target = target; } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> getInvocationMap(); void injectE...
AssociationInjector implements AssociationListener<T> { public void setBackend(Object target) { this.target = target; } AssociationInjector(Object target); void setBackend(Object target); void setCallerClassLoader(ClassLoader callerCL); void terminate(); Map<AssociationDescriptor, Long> getInvocationMap(); void injectE...
@Test public void testGetAssociationFromProxy() { Association<Dummy> association = AssociationProxyUtil.getAssociation(t.getDummy()); Assert.assertNotNull(association); }
public static <T> Association<T> getAssociation(T proxy) { Association<T> association = null; if(proxy instanceof AssociationProxy) { association = ((AssociationProxy<T>)proxy).getAssociation(); } return association; }
AssociationProxyUtil { public static <T> Association<T> getAssociation(T proxy) { Association<T> association = null; if(proxy instanceof AssociationProxy) { association = ((AssociationProxy<T>)proxy).getAssociation(); } return association; } }
AssociationProxyUtil { public static <T> Association<T> getAssociation(T proxy) { Association<T> association = null; if(proxy instanceof AssociationProxy) { association = ((AssociationProxy<T>)proxy).getAssociation(); } return association; } }
AssociationProxyUtil { public static <T> Association<T> getAssociation(T proxy) { Association<T> association = null; if(proxy instanceof AssociationProxy) { association = ((AssociationProxy<T>)proxy).getAssociation(); } return association; } static T getService(T proxy); static T regenProxy(T proxy); static T getFirst...
AssociationProxyUtil { public static <T> Association<T> getAssociation(T proxy) { Association<T> association = null; if(proxy instanceof AssociationProxy) { association = ((AssociationProxy<T>)proxy).getAssociation(); } return association; } static T getService(T proxy); static T regenProxy(T proxy); static T getFirst...
@Test public void testRegen() throws ClassNotFoundException, IllegalAccessException, InstantiationException { Dummy d = t.getDummy(); int index = d.getIndex(); Dummy d1 = AssociationProxyUtil.regenProxy(t.getDummy()); Assert.assertEquals(index, d1.getIndex()); }
public static <T> T regenProxy(T proxy) throws ClassNotFoundException, InstantiationException, IllegalAccessException { T newProxy = null; if(proxy instanceof AssociationProxy) { AssociationProxy<T> aProxy = (AssociationProxy)proxy; Association<T> association = aProxy.getAssociation(); String proxyClass = association.g...
AssociationProxyUtil { public static <T> T regenProxy(T proxy) throws ClassNotFoundException, InstantiationException, IllegalAccessException { T newProxy = null; if(proxy instanceof AssociationProxy) { AssociationProxy<T> aProxy = (AssociationProxy)proxy; Association<T> association = aProxy.getAssociation(); String pro...
AssociationProxyUtil { public static <T> T regenProxy(T proxy) throws ClassNotFoundException, InstantiationException, IllegalAccessException { T newProxy = null; if(proxy instanceof AssociationProxy) { AssociationProxy<T> aProxy = (AssociationProxy)proxy; Association<T> association = aProxy.getAssociation(); String pro...
AssociationProxyUtil { public static <T> T regenProxy(T proxy) throws ClassNotFoundException, InstantiationException, IllegalAccessException { T newProxy = null; if(proxy instanceof AssociationProxy) { AssociationProxy<T> aProxy = (AssociationProxy)proxy; Association<T> association = aProxy.getAssociation(); String pro...
AssociationProxyUtil { public static <T> T regenProxy(T proxy) throws ClassNotFoundException, InstantiationException, IllegalAccessException { T newProxy = null; if(proxy instanceof AssociationProxy) { AssociationProxy<T> aProxy = (AssociationProxy)proxy; Association<T> association = aProxy.getAssociation(); String pro...
@Test public void getComputeResource() throws Exception { ComputeResource computeResource = ComputeResourceAccessor.getComputeResource(); ComputeResourceUtilization cru = computeResource.getComputeResourceUtilization(); assertNotNull(cru); String systemCPUPercent = formatPercent(cru.getCpuUtilization().getValue()); ass...
public static ComputeResource getComputeResource() { if(computeResource==null) { try { computeResource = new ComputeResource(); computeResource.boot(); } catch (ConfigurationException | UnknownHostException e) { logger.error("Unable to create default ComputeResource", e); } } return computeResource; }
ComputeResourceAccessor { public static ComputeResource getComputeResource() { if(computeResource==null) { try { computeResource = new ComputeResource(); computeResource.boot(); } catch (ConfigurationException | UnknownHostException e) { logger.error("Unable to create default ComputeResource", e); } } return computeRes...
ComputeResourceAccessor { public static ComputeResource getComputeResource() { if(computeResource==null) { try { computeResource = new ComputeResource(); computeResource.boot(); } catch (ConfigurationException | UnknownHostException e) { logger.error("Unable to create default ComputeResource", e); } } return computeRes...
ComputeResourceAccessor { public static ComputeResource getComputeResource() { if(computeResource==null) { try { computeResource = new ComputeResource(); computeResource.boot(); } catch (ConfigurationException | UnknownHostException e) { logger.error("Unable to create default ComputeResource", e); } } return computeRes...
ComputeResourceAccessor { public static ComputeResource getComputeResource() { if(computeResource==null) { try { computeResource = new ComputeResource(); computeResource.boot(); } catch (ConfigurationException | UnknownHostException e) { logger.error("Unable to create default ComputeResource", e); } } return computeRes...
@Test public void testGetMeasurableCapabilities() throws Exception { MeasurableCapability[] mCaps = systemCapabilities.getMeasurableCapabilities(new DynamicConfiguration()); int expected = 5; for(MeasurableCapability m : mCaps) System.out.println("===> "+m.getId()); Assert.assertEquals("Expected "+expected, expected, m...
public MeasurableCapability[] getMeasurableCapabilities(Configuration config) { if(config==null) throw new IllegalArgumentException("config is null"); List<MeasurableCapability> measurables = new ArrayList<>(); MeasurableCapability memory = new Memory(config); if(memory.isEnabled()) measurables.add(memory); MeasurableC...
SystemCapabilities implements SystemCapabilitiesLoader { public MeasurableCapability[] getMeasurableCapabilities(Configuration config) { if(config==null) throw new IllegalArgumentException("config is null"); List<MeasurableCapability> measurables = new ArrayList<>(); MeasurableCapability memory = new Memory(config); if...
SystemCapabilities implements SystemCapabilitiesLoader { public MeasurableCapability[] getMeasurableCapabilities(Configuration config) { if(config==null) throw new IllegalArgumentException("config is null"); List<MeasurableCapability> measurables = new ArrayList<>(); MeasurableCapability memory = new Memory(config); if...
SystemCapabilities implements SystemCapabilitiesLoader { public MeasurableCapability[] getMeasurableCapabilities(Configuration config) { if(config==null) throw new IllegalArgumentException("config is null"); List<MeasurableCapability> measurables = new ArrayList<>(); MeasurableCapability memory = new Memory(config); if...
SystemCapabilities implements SystemCapabilitiesLoader { public MeasurableCapability[] getMeasurableCapabilities(Configuration config) { if(config==null) throw new IllegalArgumentException("config is null"); List<MeasurableCapability> measurables = new ArrayList<>(); MeasurableCapability memory = new Memory(config); if...
@Test public void testGetPlatformCapabilities() throws Exception { PlatformCapability[] pCaps = systemCapabilities.getPlatformCapabilities(new DynamicConfiguration()); Assert.assertTrue("Expected at least 7", pCaps.length>=7); ProcessorArchitecture processorArchitecture = getCapability(ProcessorArchitecture.class, pCap...
public PlatformCapability[] getPlatformCapabilities(Configuration config) { List<PlatformCapability> platforms = new ArrayList<>(); try { ProcessorArchitecture processor = new ProcessorArchitecture(); platforms.add(processor); PlatformCapability operatingSystem = new OperatingSystem(); platforms.add(operatingSystem); P...
SystemCapabilities implements SystemCapabilitiesLoader { public PlatformCapability[] getPlatformCapabilities(Configuration config) { List<PlatformCapability> platforms = new ArrayList<>(); try { ProcessorArchitecture processor = new ProcessorArchitecture(); platforms.add(processor); PlatformCapability operatingSystem =...
SystemCapabilities implements SystemCapabilitiesLoader { public PlatformCapability[] getPlatformCapabilities(Configuration config) { List<PlatformCapability> platforms = new ArrayList<>(); try { ProcessorArchitecture processor = new ProcessorArchitecture(); platforms.add(processor); PlatformCapability operatingSystem =...
SystemCapabilities implements SystemCapabilitiesLoader { public PlatformCapability[] getPlatformCapabilities(Configuration config) { List<PlatformCapability> platforms = new ArrayList<>(); try { ProcessorArchitecture processor = new ProcessorArchitecture(); platforms.add(processor); PlatformCapability operatingSystem =...
SystemCapabilities implements SystemCapabilitiesLoader { public PlatformCapability[] getPlatformCapabilities(Configuration config) { List<PlatformCapability> platforms = new ArrayList<>(); try { ProcessorArchitecture processor = new ProcessorArchitecture(); platforms.add(processor); PlatformCapability operatingSystem =...
@Test public void testStartWithConfig() throws Exception { DynamicConfiguration config = new DynamicConfiguration(); config.setEntry(Jetty.COMPONENT,"port", int.class,9020); config.setEntry(Jetty.COMPONENT,"roots", String[].class, new String[]{ System.getProperty("user.dir") + "/build/classes", System.getProperty("user...
public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); Jetty setRoots(String... roots); Jetty setPort(int port); Jetty setMinThreads(int minThread...
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); Jetty setRoots(String... roots); Jetty setPort(int port); Jetty setMinThreads(int minThread...
@Test public void testGenericCostModel() { GenericCostModel gcm = new GenericCostModel(0.01); gcm.addTimeBoundary(new ResourceCostModel.TimeBoundary(5, 10, ResourceCostModel.TimeBoundary.SECONDS)); gcm.addTimeBoundary(new ResourceCostModel.TimeBoundary(5, 100, ResourceCostModel.TimeBoundary.MINUTES)); System.out.printl...
public GenericCostModel(double value) { this(value, null, DEFAULT_DESCRIPTION); }
GenericCostModel implements ResourceCostModel { public GenericCostModel(double value) { this(value, null, DEFAULT_DESCRIPTION); } }
GenericCostModel implements ResourceCostModel { public GenericCostModel(double value) { this(value, null, DEFAULT_DESCRIPTION); } GenericCostModel(double value); GenericCostModel(double value, TimeBoundary[] timeBoundaries); GenericCostModel(double value, TimeBoundary[] timeBoundaries, ...
GenericCostModel implements ResourceCostModel { public GenericCostModel(double value) { this(value, null, DEFAULT_DESCRIPTION); } GenericCostModel(double value); GenericCostModel(double value, TimeBoundary[] timeBoundaries); GenericCostModel(double value, TimeBoundary[] timeBoundaries, ...
GenericCostModel implements ResourceCostModel { public GenericCostModel(double value) { this(value, null, DEFAULT_DESCRIPTION); } GenericCostModel(double value); GenericCostModel(double value, TimeBoundary[] timeBoundaries); GenericCostModel(double value, TimeBoundary[] timeBoundaries, ...
@Test public void testRegisteringAnEventProducerAndFiringAnEvent() throws Exception { BasicEventConsumer consumer = new BasicEventConsumer(getEventDescriptor()); Listener listener = new Listener(); consumer.register(listener); Producer p = new Producer(); p.createDEH(); ServiceItem serviceItem = createServiceItem(p); E...
public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
@Test public void testRegisteringAnEventProducerAndFiringAnEventWithLeaseBeingDropped() throws Exception { BasicEventConsumer consumer = new BasicEventConsumer(getEventDescriptor()); Listener listener = new Listener(); consumer.register(listener); Producer p = new Producer(); p.setLeaseTime(3 * 1000); p.createDEH(); Se...
public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
@Test public void testRegisteringAnEventProducerAndFiringEventsUsingRoundRobin() throws Exception { Producer p = new Producer(); p.createRoundRobin(); ServiceItem serviceItem = createServiceItem(p); BasicEventConsumer consumer1 = new BasicEventConsumer(getEventDescriptor()); Listener listener1 = new Listener(2); consum...
public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate); BasicEventConsumer(final RemoteServiceEventListener<?> listener); BasicEventConsumer(final Eve...
@Test public void testCreateEventDescriptors() throws Exception { List<EventDescriptor> list = EventDescriptorFactory.createEventDescriptors(null, "org.rioproject.sla.SLAThresholdEvent"); Assert.assertNotNull(list); Assert.assertEquals(1, list.size()); }
public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames.length==0) throw new Ille...
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
@Test public void testCreateEventDescriptorsMulti() throws Exception { List<EventDescriptor> list = EventDescriptorFactory.createEventDescriptors (null, "org.rioproject.sla.SLAThresholdEvent", "org.rioproject.watch.ThresholdEvent"); Assert.assertNotNull(list); Assert.assertEquals(2, list.size()); }
public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames.length==0) throw new Ille...
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
@Test(expected = IllegalArgumentException.class) public void testCreateEventDescriptorsNullClassNames() throws Exception { EventDescriptorFactory.createEventDescriptors (null); }
public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames.length==0) throw new Ille...
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
@Test(expected = MalformedURLException.class) public void testCreateEventDescriptorsBadClassPath() throws Exception { EventDescriptorFactory.createEventDescriptors ("foo", ""); }
public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames.length==0) throw new Ille...
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
EventDescriptorFactory { public static List<EventDescriptor> createEventDescriptors(String classpath, String... classNames) throws MalformedURLException, ResolverException, ClassNotFoundException, URISyntaxException { if(classNames==null) throw new IllegalArgumentException("classNames must not be null"); if(classNames....
@Test public void testExactVersionSupported() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertTrue(versionMatcher.versionSupported("1.2.7", "1.2.7")); }
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testExactVersionNotSupported() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertFalse(versionMatcher.versionSupported("1.2", "1.2.7")); }
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testStartWithGroovyConfig() throws Exception { String projectDir = System.getProperty("projectDir"); String resources = new File(projectDir+"/src/test/resources").getPath(); File config = new File(resources +"/jetty.groovy"); Jetty jetty = new Jetty(config); assertEquals(9029, jetty.getPort()); }
public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); }
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); Jetty setRoots(String... roots); Jetty setPort(int port); Jetty setMinThreads(int minThread...
Jetty implements WebsterService { public int getPort() { if (server == null) { return port; } return ((ServerConnector)server.getConnectors()[0]).getLocalPort(); } Jetty(); Jetty(File jettyConfig); Jetty(Configuration config); Jetty setRoots(String... roots); Jetty setPort(int port); Jetty setMinThreads(int minThread...
@Test public void testMinorVersionSupported() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertTrue(versionMatcher.versionSupported("1.2*", "1.2.7")); Assert.assertTrue(versionMatcher.versionSupported("1*", "1.2.7")); Assert.assertTrue(versionMatcher.versionSupported("1*", "1-M")); ...
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testMinorVersionSupported2() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertFalse(versionMatcher.versionSupported("1*", "2")); }
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testMinorVersionNotSupported() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertFalse(versionMatcher.versionSupported("1.2*", "1.3-7")); Assert.assertFalse(versionMatcher.versionSupported("2*", "1.3.7")); }
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testMajorVersionSupported() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertTrue(versionMatcher.versionSupported("1.2+", "1.3.7")); Assert.assertTrue(versionMatcher.versionSupported("2+", "3.7")); Assert.assertTrue(versionMatcher.versionSupported("2+", "2")); Asse...
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testVersionRanges() { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertFalse(versionMatcher.versionSupported("3.24.1", "3.23.13.4, 3.24")); Assert.assertFalse(versionMatcher.versionSupported("3.23.1", "3.23.13.4, 3.24")); Assert.assertTrue(versionMatcher.versionSupported("3.23.1", "3...
public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is null"); } boolean supported; Version vers...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
VersionMatcher implements Serializable { public boolean versionSupported(final String requiredVersion, final String publishedVersion) { if (requiredVersion == null) { throw new IllegalArgumentException("requiredVersion is null"); } if (publishedVersion == null) { throw new IllegalArgumentException("publishedVersion is ...
@Test public void testIsRange() throws Exception { Version v = new Version("1,2"); Assert.assertTrue(v.isRange()); Version v1 = new Version("1.2"); Assert.assertFalse(v1.isRange()); }
public boolean isRange() { return version.contains(","); }
Version { public boolean isRange() { return version.contains(","); } }
Version { public boolean isRange() { return version.contains(","); } Version(final String version); }
Version { public boolean isRange() { return version.contains(","); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode(); }
Version { public boolean isRange() { return version.contains(","); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void testGetVersion() throws Exception { Version v = new Version("1,2"); Assert.assertNotNull(v.getVersion()); }
public String getVersion() { if (minorVersionSupport() || majorVersionSupport()) { return version.substring(0, version.length()-1).trim(); } return version.trim(); }
Version { public String getVersion() { if (minorVersionSupport() || majorVersionSupport()) { return version.substring(0, version.length()-1).trim(); } return version.trim(); } }
Version { public String getVersion() { if (minorVersionSupport() || majorVersionSupport()) { return version.substring(0, version.length()-1).trim(); } return version.trim(); } Version(final String version); }
Version { public String getVersion() { if (minorVersionSupport() || majorVersionSupport()) { return version.substring(0, version.length()-1).trim(); } return version.trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport...
Version { public String getVersion() { if (minorVersionSupport() || majorVersionSupport()) { return version.substring(0, version.length()-1).trim(); } return version.trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport...
@Test public void testGetStartRange() throws Exception { Version v = new Version("1,2"); Assert.assertNotNull(v.getStartRange()); Assert.assertEquals("1", v.getStartRange()); Version v1 = new Version("1.2"); Assert.assertNotNull(v1.getStartRange()); }
public String getStartRange() { String[] parts = version.split(",", 2); return parts[0].trim(); }
Version { public String getStartRange() { String[] parts = version.split(",", 2); return parts[0].trim(); } }
Version { public String getStartRange() { String[] parts = version.split(",", 2); return parts[0].trim(); } Version(final String version); }
Version { public String getStartRange() { String[] parts = version.split(",", 2); return parts[0].trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o...
Version { public String getStartRange() { String[] parts = version.split(",", 2); return parts[0].trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o...
@Test public void testGetEndRange() throws Exception { Version v = new Version("1,2"); Assert.assertNotNull(v.getEndRange()); Assert.assertEquals("2", v.getEndRange()); Version v1 = new Version("1.2"); Assert.assertNotNull(v1.getEndRange()); }
public String getEndRange() { if (!isRange()) return getVersion(); String[] parts = version.split(",", 2); return parts[1].trim(); }
Version { public String getEndRange() { if (!isRange()) return getVersion(); String[] parts = version.split(",", 2); return parts[1].trim(); } }
Version { public String getEndRange() { if (!isRange()) return getVersion(); String[] parts = version.split(",", 2); return parts[1].trim(); } Version(final String version); }
Version { public String getEndRange() { if (!isRange()) return getVersion(); String[] parts = version.split(",", 2); return parts[1].trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport()...
Version { public String getEndRange() { if (!isRange()) return getVersion(); String[] parts = version.split(",", 2); return parts[1].trim(); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport()...
@Test public void testMinorVersionSupport() throws Exception { Version v = new Version("1.1*"); Assert.assertTrue(v.minorVersionSupport()); Version v1 = new Version("1.2"); Assert.assertFalse(v1.minorVersionSupport()); }
public boolean minorVersionSupport() { return version.endsWith("*"); }
Version { public boolean minorVersionSupport() { return version.endsWith("*"); } }
Version { public boolean minorVersionSupport() { return version.endsWith("*"); } Version(final String version); }
Version { public boolean minorVersionSupport() { return version.endsWith("*"); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode()...
Version { public boolean minorVersionSupport() { return version.endsWith("*"); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode()...
@Test public void testStart() throws Exception { String projectDir = System.getProperty("projectDir"); String resources = new File(projectDir+"/src/test/resources").getPath(); File fileDir = new File(projectDir+"/build/files-2"); if(fileDir.mkdirs()) System.out.println("Created "+fileDir.getPath()); Jetty jetty = new J...
@Override public void start() throws Exception { createServer(); ServerConnector connector = new ServerConnector(server); connector.setPort(port); String address = HostUtil.getHostAddressFromProperty("java.rmi.server.hostname"); connector.setHost(address); server.setConnectors(new Connector[] { connector }); server.set...
Jetty implements WebsterService { @Override public void start() throws Exception { createServer(); ServerConnector connector = new ServerConnector(server); connector.setPort(port); String address = HostUtil.getHostAddressFromProperty("java.rmi.server.hostname"); connector.setHost(address); server.setConnectors(new Conn...
Jetty implements WebsterService { @Override public void start() throws Exception { createServer(); ServerConnector connector = new ServerConnector(server); connector.setPort(port); String address = HostUtil.getHostAddressFromProperty("java.rmi.server.hostname"); connector.setHost(address); server.setConnectors(new Conn...
Jetty implements WebsterService { @Override public void start() throws Exception { createServer(); ServerConnector connector = new ServerConnector(server); connector.setPort(port); String address = HostUtil.getHostAddressFromProperty("java.rmi.server.hostname"); connector.setHost(address); server.setConnectors(new Conn...
Jetty implements WebsterService { @Override public void start() throws Exception { createServer(); ServerConnector connector = new ServerConnector(server); connector.setPort(port); String address = HostUtil.getHostAddressFromProperty("java.rmi.server.hostname"); connector.setHost(address); server.setConnectors(new Conn...
@Test public void testMajorVersionSupport() throws Exception { Version v = new Version("1+"); Assert.assertTrue(v.majorVersionSupport()); Version v1 = new Version("1.2"); Assert.assertFalse(v1.majorVersionSupport()); }
public boolean majorVersionSupport() { return version.endsWith("+"); }
Version { public boolean majorVersionSupport() { return version.endsWith("+"); } }
Version { public boolean majorVersionSupport() { return version.endsWith("+"); } Version(final String version); }
Version { public boolean majorVersionSupport() { return version.endsWith("+"); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode()...
Version { public boolean majorVersionSupport() { return version.endsWith("+"); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); String getEndRange(); boolean minorVersionSupport(); boolean majorVersionSupport(); @Override boolean equals(Object o); @Override int hashCode()...
@Test public void testEquals() throws Exception { Version v = new Version("1.2"); Version v1 = new Version("1.2"); Assert.assertTrue(v.equals(v1)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Version version1 = (Version) o; return version.equals(version1.version); }
Version { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Version version1 = (Version) o; return version.equals(version1.version); } }
Version { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Version version1 = (Version) o; return version.equals(version1.version); } Version(final String version); }
Version { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Version version1 = (Version) o; return version.equals(version1.version); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); S...
Version { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Version version1 = (Version) o; return version.equals(version1.version); } Version(final String version); boolean isRange(); String getVersion(); String getStartRange(); S...
@Test public void testLoadFromEnv() { try { System.setProperty(Constants.ENV_PROPERTY_NAME, System.getProperty("user.dir") + "/src/test/resources/config/rio.env"); RioProperties.load(); String locators = System.getProperty(Constants.LOCATOR_PROPERTY_NAME); Assert.assertNotNull(locators); } finally { System.clearPropert...
public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndS...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
@Test public void testLoadFromRioHome() { String oldRioHome = System.getProperty("rio.home"); try { System.setProperty("rio.home", System.getProperty("user.dir") + "/src/test/resources"); RioProperties.load(); String locators = System.getProperty(Constants.LOCATOR_PROPERTY_NAME); Assert.assertNotNull(locators); } final...
public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exists()) { loadAndS...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
RioProperties { public static void load() { File rioEnv; String rioEnvFileName = System.getProperty(Constants.ENV_PROPERTY_NAME, System.getenv(Constants.ENV_PROPERTY_NAME)); if(rioEnvFileName==null) { File rioRoot = new File(System.getProperty("user.home"), ".rio"); rioEnv = new File(rioRoot, "rio.env"); if(rioEnv.exis...
@Test public void testMeetsGeneralRequirements() { ProvisionRequest request = createProvisionRequest(); assertTrue(instantiatorResource.meetsGeneralRequirements(request)); }
boolean meetsGeneralRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); String[] machineCluster = sElem.getCluster(); if (machineCluster != null && machineCluster.length > 0) { logger.debug("ServiceBean [{}] has a cluster requirement", LoggingUtil.getLogg...
InstantiatorResource { boolean meetsGeneralRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); String[] machineCluster = sElem.getCluster(); if (machineCluster != null && machineCluster.length > 0) { logger.debug("ServiceBean [{}] has a cluster requiremen...
InstantiatorResource { boolean meetsGeneralRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); String[] machineCluster = sElem.getCluster(); if (machineCluster != null && machineCluster.length > 0) { logger.debug("ServiceBean [{}] has a cluster requiremen...
InstantiatorResource { boolean meetsGeneralRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); String[] machineCluster = sElem.getCluster(); if (machineCluster != null && machineCluster.length > 0) { logger.debug("ServiceBean [{}] has a cluster requiremen...
InstantiatorResource { boolean meetsGeneralRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); String[] machineCluster = sElem.getCluster(); if (machineCluster != null && machineCluster.length > 0) { logger.debug("ServiceBean [{}] has a cluster requiremen...
@Test public void testMeetsQualitativeRequirements() { ProvisionRequest request = createProvisionRequest(); request.getServiceElement().setServiceLevelAgreements(createServiceLevelAgreements(true, true)); Collection<SystemComponent> notSupported = instantiatorResource.meetsQualitativeRequirements(request); assertEquals...
Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents(); List<SystemComponent> ...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
@Test public void testDoesNotMeetArchitectureRequirements() { ProvisionRequest request = createProvisionRequest(); request.getServiceElement().setServiceLevelAgreements(createServiceLevelAgreements(false, true)); Collection<SystemComponent> notSupported = instantiatorResource.meetsQualitativeRequirements(request); asse...
Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents(); List<SystemComponent> ...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
@Test public void testDoesNotMeetOperatingSystemRequirements() { ProvisionRequest request = createProvisionRequest(); request.getServiceElement().setServiceLevelAgreements(createServiceLevelAgreements(true, false)); Collection<SystemComponent> notSupported = instantiatorResource.meetsQualitativeRequirements(request); a...
Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents(); List<SystemComponent> ...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
InstantiatorResource { Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) { ServiceElement sElem = request.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();...
@Test public void testMeetsQuantitativeRequirements() { ProvisionRequest request = createProvisionRequest(); assertTrue(instantiatorResource.meetsQuantitativeRequirements(request)); }
boolean meetsQuantitativeRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); boolean provisionable = true; String[] systemThresholdIDs = sla.getSystemRequirements().getSystemThresholdIDs(); i...
InstantiatorResource { boolean meetsQuantitativeRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); boolean provisionable = true; String[] systemThresholdIDs = sla.getSystemRequirements().get...
InstantiatorResource { boolean meetsQuantitativeRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); boolean provisionable = true; String[] systemThresholdIDs = sla.getSystemRequirements().get...
InstantiatorResource { boolean meetsQuantitativeRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); boolean provisionable = true; String[] systemThresholdIDs = sla.getSystemRequirements().get...
InstantiatorResource { boolean meetsQuantitativeRequirements(final ProvisionRequest provisionRequest) { ServiceElement sElem = provisionRequest.getServiceElement(); ServiceLevelAgreements sla = sElem.getServiceLevelAgreements(); boolean provisionable = true; String[] systemThresholdIDs = sla.getSystemRequirements().get...
@Test public void testMeetsExcludeWithMatching() throws ProvisionException { ProvisionRequest request = createProvisionRequest(); request.getServiceElement().setServiceLevelAgreements(createClusterServiceLevelAgreements(true, "10.0.1.33")); assertTrue(instantiatorResource.canProvision(request)); }
public boolean canProvision(final ProvisionRequest provisionRequest) throws ProvisionException { ServiceElement sElem = provisionRequest.getServiceElement(); if (sElem.getPlanned() == 0) { return false; } String provType = sElem.getProvisionType().toString(); if (getServiceElementCount() == serviceLimit.get() && !provT...
InstantiatorResource { public boolean canProvision(final ProvisionRequest provisionRequest) throws ProvisionException { ServiceElement sElem = provisionRequest.getServiceElement(); if (sElem.getPlanned() == 0) { return false; } String provType = sElem.getProvisionType().toString(); if (getServiceElementCount() == servi...
InstantiatorResource { public boolean canProvision(final ProvisionRequest provisionRequest) throws ProvisionException { ServiceElement sElem = provisionRequest.getServiceElement(); if (sElem.getPlanned() == 0) { return false; } String provType = sElem.getProvisionType().toString(); if (getServiceElementCount() == servi...
InstantiatorResource { public boolean canProvision(final ProvisionRequest provisionRequest) throws ProvisionException { ServiceElement sElem = provisionRequest.getServiceElement(); if (sElem.getPlanned() == 0) { return false; } String provType = sElem.getProvisionType().toString(); if (getServiceElementCount() == servi...
InstantiatorResource { public boolean canProvision(final ProvisionRequest provisionRequest) throws ProvisionException { ServiceElement sElem = provisionRequest.getServiceElement(); if (sElem.getPlanned() == 0) { return false; } String provType = sElem.getProvisionType().toString(); if (getServiceElementCount() == servi...
@Test public void testGetSettings() throws Exception { Settings settings = SettingsUtil.getSettings(); Assert.assertNotNull(settings); }
public static Settings getSettings() throws SettingsBuildingException { DefaultSettingsBuilder defaultSettingsBuilder = new DefaultSettingsBuilder(); DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); File userSettingsFile = new File(System.getProperty("user.home"), ".m2" + File.separator + ...
SettingsUtil { public static Settings getSettings() throws SettingsBuildingException { DefaultSettingsBuilder defaultSettingsBuilder = new DefaultSettingsBuilder(); DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); File userSettingsFile = new File(System.getProperty("user.home"), ".m2" + Fi...
SettingsUtil { public static Settings getSettings() throws SettingsBuildingException { DefaultSettingsBuilder defaultSettingsBuilder = new DefaultSettingsBuilder(); DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); File userSettingsFile = new File(System.getProperty("user.home"), ".m2" + Fi...
SettingsUtil { public static Settings getSettings() throws SettingsBuildingException { DefaultSettingsBuilder defaultSettingsBuilder = new DefaultSettingsBuilder(); DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); File userSettingsFile = new File(System.getProperty("user.home"), ".m2" + Fi...
SettingsUtil { public static Settings getSettings() throws SettingsBuildingException { DefaultSettingsBuilder defaultSettingsBuilder = new DefaultSettingsBuilder(); DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); File userSettingsFile = new File(System.getProperty("user.home"), ".m2" + Fi...
@Test public void gaugeReportsDirectMemoryUsageValue() throws Exception { when(metricUnderTest.usedDirectMemory()).thenReturn(1L); NettyAllocatorMetricSet metricSet = new NettyAllocatorMetricSet("test-metric", metricUnderTest); Gauge<Long> metric = (Gauge<Long>) metricSet.getMetrics().get("test-metric.usedDirectMemory"...
@Override public Map<String, Metric> getMetrics() { Map<String, Metric> gauges = new HashMap<>(); gauges.put(name(namespace, "usedDirectMemory"), (Gauge<Long>) metric::usedDirectMemory); gauges.put(name(namespace, "usedHeapMemory"), (Gauge<Long>) metric::usedHeapMemory); return copyOf(gauges); }
NettyAllocatorMetricSet implements MetricSet { @Override public Map<String, Metric> getMetrics() { Map<String, Metric> gauges = new HashMap<>(); gauges.put(name(namespace, "usedDirectMemory"), (Gauge<Long>) metric::usedDirectMemory); gauges.put(name(namespace, "usedHeapMemory"), (Gauge<Long>) metric::usedHeapMemory); r...
NettyAllocatorMetricSet implements MetricSet { @Override public Map<String, Metric> getMetrics() { Map<String, Metric> gauges = new HashMap<>(); gauges.put(name(namespace, "usedDirectMemory"), (Gauge<Long>) metric::usedDirectMemory); gauges.put(name(namespace, "usedHeapMemory"), (Gauge<Long>) metric::usedHeapMemory); r...
NettyAllocatorMetricSet implements MetricSet { @Override public Map<String, Metric> getMetrics() { Map<String, Metric> gauges = new HashMap<>(); gauges.put(name(namespace, "usedDirectMemory"), (Gauge<Long>) metric::usedDirectMemory); gauges.put(name(namespace, "usedHeapMemory"), (Gauge<Long>) metric::usedHeapMemory); r...
NettyAllocatorMetricSet implements MetricSet { @Override public Map<String, Metric> getMetrics() { Map<String, Metric> gauges = new HashMap<>(); gauges.put(name(namespace, "usedDirectMemory"), (Gauge<Long>) metric::usedDirectMemory); gauges.put(name(namespace, "usedHeapMemory"), (Gauge<Long>) metric::usedHeapMemory); r...
@Test public void attemptsToLoadAllPluginsEvenIfSomePluginFactoriesCannotBeLoaded() { LoggingTestSupport log = new LoggingTestSupport(FailureHandling.class); String yaml = "" + "plugins:\n" + " active: myPlugin1,myPlugin2,myPlugin3\n" + " all:\n" + " myPlugin1:\n" + " factory:\n" + " class: BadClassName\n" + " classPat...
public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
@Test public void attemptsToLoadAllPluginsEvenIfSomePluginFactoriesFailDuringExecution() { LoggingTestSupport log = new LoggingTestSupport(FailureHandling.class); String yaml = "" + "plugins:\n" + " active: myPlugin1,myPlugin2,myPlugin3\n" + " all:\n" + " myPlugin1:\n" + " factory:\n" + " class: com.hotels.styx.startup...
public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
@Test public void appliesDefaultMetricsScopeForPlugins() { String yaml = "" + "plugins:\n" + " active: myPlugin, myAnotherPlugin\n" + " all:\n" + " myPlugin:\n" + " factory:\n" + " class: com.hotels.styx.startup.extensions.PluginLoadingForStartupTest$MyPluginFactory\n" + " classPath: " + FIXTURES_CLASS_PATH + "\n" + " ...
public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); }
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
PluginLoadingForStartup { public static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFactory> factories) { return loadPluginsFromFactories(environment, factories); } private PluginLoadingForStartup(); static List<NamedPlugin> loadPlugins(Environment environment, List<ConfiguredPluginFact...
@Test public void configurationLoadingFailsIfStyxHomeIsNotSpecified() { Exception e = assertThrows(IllegalArgumentException.class, () -> StartupConfig.load()); assertEquals("No system property STYX_HOME has been defined.", e.getMessage()); }
public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME, styxHome); Stri...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
@Test public void configurationLoadingFailsIfStyxHomeDoesNotPointToReadableLocation() { setProperty(STYX_HOME_VAR_NAME, "/undefined"); Exception e = assertThrows(IllegalArgumentException.class, () -> StartupConfig.load()); assertEquals("STYX_HOME=/undefined is not a readable configuration path.", e.getMessage()); }
public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME, styxHome); Stri...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
StartupConfig { public static StartupConfig load() { String styxHome = System.getProperty(STYX_HOME_VAR_NAME); checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME); checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME,...
@Test public void canTraverseValueNodesInOrder() throws IOException { String yaml = "" + "object:\n" + " field1: 234\n" + " field2: value2\n" + " arrayField:\n" + " - arrayValue1\n" + " - 757\n" + " - arrayObjectValue: 1234\n"; JsonNode rootNode = new ObjectMapper(new YAMLFactory()).readTree(yaml); List<Call> calls = n...
public static <T extends JsonTreeVisitor> T traverseJsonTree(JsonNode node, T visitor) { traverseJsonTree(node, null, new ArrayList<>(), visitor); return visitor; }
JsonTreeTraversal { public static <T extends JsonTreeVisitor> T traverseJsonTree(JsonNode node, T visitor) { traverseJsonTree(node, null, new ArrayList<>(), visitor); return visitor; } }
JsonTreeTraversal { public static <T extends JsonTreeVisitor> T traverseJsonTree(JsonNode node, T visitor) { traverseJsonTree(node, null, new ArrayList<>(), visitor); return visitor; } }
JsonTreeTraversal { public static <T extends JsonTreeVisitor> T traverseJsonTree(JsonNode node, T visitor) { traverseJsonTree(node, null, new ArrayList<>(), visitor); return visitor; } static T traverseJsonTree(JsonNode node, T visitor); }
JsonTreeTraversal { public static <T extends JsonTreeVisitor> T traverseJsonTree(JsonNode node, T visitor) { traverseJsonTree(node, null, new ArrayList<>(), visitor); return visitor; } static T traverseJsonTree(JsonNode node, T visitor); }
@Test public void canResolvePlaceholdersInInclude() throws IOException { Map<String, String> overrides = ImmutableMap.of("CONFIG_LOCATION", "some_location"); String yaml = "${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml"; String resolved = YamlConfigurationFormat.YAML.resolvePlaceholdersInText(yaml, overri...
@Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedT...
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder pla...
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder pla...
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder pla...
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder pla...
@Test public void resolvesPropertyFromExternalProperties() throws IOException { Map<String, String> externalProperties = singletonMap("CONFIG_LOCATION", "foo"); JsonNode root = parseYaml("{ \"include\" : \"${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml\" }"); PlaceholderResolver.resolvePlaceholders(root, e...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void resolvesPropertyFromOtherField() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml\"," + "\"CONFIG_LOCATION\" : \"foo\"" + " }"); PlaceholderResolver.resolvePlaceholders(root, NO_EXTERNAL_PROPERTIES); assertThat(root.get(...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void resolvesPropertyFromOtherFieldsWhichAreDependentOnPlaceholdersThemselves() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml\"," + "\"CONFIG_LOCATION\" : \"${FOO}\"," + "\"FOO\" : \"foo\"" + " }"); PlaceholderResolver.res...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void sendsHistogram() throws InterruptedException { registry.histogram("histogram").update(1234); service.report(); assertThat(sender.data, hasItem(matchesRegex("test.histogram.count=1"))); assertThat(sender.data, hasItem(matchesRegex("test.histogram.max=1234"))); assertThat(sender.data, hasItem(matchesReg...
@VisibleForTesting void report() { this.reporter.report(); }
GraphiteReporterService extends AbstractStyxService { @VisibleForTesting void report() { this.reporter.report(); } }
GraphiteReporterService extends AbstractStyxService { @VisibleForTesting void report() { this.reporter.report(); } private GraphiteReporterService(Builder builder); }
GraphiteReporterService extends AbstractStyxService { @VisibleForTesting void report() { this.reporter.report(); } private GraphiteReporterService(Builder builder); }
GraphiteReporterService extends AbstractStyxService { @VisibleForTesting void report() { this.reporter.report(); } private GraphiteReporterService(Builder builder); }
@Test public void resolvesPropertyWithNesting() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${parent.CONFIG_LOCATION:classpath:}/conf/environment/default.yaml\"," + "\"parent\" : {" + "\"CONFIG_LOCATION\" : \"foo\"" + " }" + " }"); PlaceholderResolver.resolvePlaceholders(root, NO_EXTERNAL_PRO...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void usesDefaultWhenPropertyCannotBeResolved() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml\"," + "\"FOO\" : \"foo\"" + " }"); PlaceholderResolver.resolvePlaceholders(root, NO_EXTERNAL_PROPERTIES); assertThat(root.get("in...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void throwExceptionWhenPropertyCannotBeResolvedAndNoDefaultIsProvided() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${CONFIG_LOCATION}/conf/environment/default.yaml\"," + "\"FOO\" : \"foo\"" + " }"); Collection<UnresolvedPlaceholder> unresolvedPlaceholders = PlaceholderResolver.r...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void resolvesMultiplePropertiesInOneField() throws IOException { JsonNode root = parseYaml("{ " + "\"include\" : \"${CONFIG_LOCATION:classpath:}/conf/environment/${NAME}.yaml\"," + "\"CONFIG_LOCATION\" : \"foo\"," + "\"NAME\" : \"bar\"" + " }"); PlaceholderResolver.resolvePlaceholders(root, NO_EXTERNAL_PRO...
public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } }
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
PlaceholderResolver { public static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties) { if (rootNode.isObject()) { return new PlaceholderResolver((ObjectNode) rootNode, externalProperties).resolve(); } return Collections.emptyList(); } PlaceholderResolver(O...
@Test public void extractsPlaceholders() { String valueWithPlaceholders = "foo ${with.default:defaultValue} bar ${without.default} ${configLocation:classpath:}foo"; List<String> placeholders = PlaceholderResolver.extractPlaceholderStrings(valueWithPlaceholders); assertThat(placeholders, contains("${with.default:default...
@VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...
@Test public void extractsPlaceholdersWithEmptyDefaults() { String valueWithPlaceholders = "foo: \"${FOO:}\""; List<String> placeholders = PlaceholderResolver.extractPlaceholderStrings(valueWithPlaceholders); assertThat(placeholders, contains("${FOO:}")); }
@VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(O...