use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class TCredentialsUpdatingInvocationHandlerTest method setup.
@Before
public void setup() {
cc = new ConfigurationCopy();
conf = new AccumuloConfiguration() {
@Override
public String get(Property property) {
String value = cc.get(property);
if (null == value) {
return DEFAULT_CONFIG.get(property);
}
return value;
}
@Override
public void getProperties(Map<String, String> props, Predicate<String> filter) {
cc.getProperties(props, filter);
}
@Override
public long getUpdateCount() {
return cc.getUpdateCount();
}
};
proxy = new TCredentialsUpdatingInvocationHandler<>(new Object(), conf);
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class NamespaceConfigurationTest method testGet_SkipParentIfAccumuloNS.
@Test
public void testGet_SkipParentIfAccumuloNS() {
c = new NamespaceConfiguration(Namespace.ID.ACCUMULO, instance, parent);
c.setZooCacheFactory(zcf);
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZNAMESPACES + "/" + Namespace.ID.ACCUMULO + Constants.ZNAMESPACE_CONF + "/" + p.getKey())).andReturn(null);
replay(zc);
assertNull(c.get(Property.INSTANCE_SECRET));
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class NamespaceConfigurationTest method testInvalidateCache.
@Test
public void testInvalidateCache() {
// need to do a get so the accessor is created
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZNAMESPACES + "/" + NSID + Constants.ZNAMESPACE_CONF + "/" + p.getKey())).andReturn("sekrit".getBytes(UTF_8));
zc.clear();
replay(zc);
c.get(Property.INSTANCE_SECRET);
c.invalidateCache();
verify(zc);
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class TableConfigurationTest method testInvalidateCache.
@Test
public void testInvalidateCache() {
// need to do a get so the accessor is created
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey())).andReturn("sekrit".getBytes(UTF_8));
zc.clear();
replay(zc);
c.get(Property.INSTANCE_SECRET);
c.invalidateCache();
verify(zc);
}
use of org.apache.accumulo.core.conf.Property in project accumulo by apache.
the class TableConfigurationTest method testGet_InZK.
@Test
public void testGet_InZK() {
Property p = Property.INSTANCE_SECRET;
expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey())).andReturn("sekrit".getBytes(UTF_8));
replay(zc);
assertEquals("sekrit", c.get(Property.INSTANCE_SECRET));
}
Aggregations