Stops eclipse from complaining.
Change-Id: I153b651068cceb8263f2f4a8ea65b8de45a1ba50
Signed-off-by: Robert Varga <rovarga@cisco.com>
@Test
public void testLookupRuntimeBeans() throws Exception {
Set<ObjectName> jmxLookup = lookupRuntimeBeans(jmxRegistryClient);
- assertEquals(Sets.newHashSet(testingRegistry.run2, testingRegistry.run1, testingRegistry.run3), jmxLookup);
+ assertEquals(Sets.newHashSet(TestingConfigRegistry.run2, TestingConfigRegistry.run1, TestingConfigRegistry.run3), jmxLookup);
}
private Set<ObjectName> lookupRuntimeBeans(ConfigRegistryClient client)
jmxRegistryClient, TestingConfigRegistry.moduleName1,
TestingConfigRegistry.instName1);
assertEquals(1, jmxLookup.size());
- assertEquals(Sets.newHashSet(testingRegistry.run2), jmxLookup);
+ assertEquals(Sets.newHashSet(TestingConfigRegistry.run2), jmxLookup);
jmxLookup = clientLookupRuntimeBeansWithModuleAndInstance(
jmxRegistryClient, TestingConfigRegistry.moduleName2,
TestingConfigRegistry.instName2);
assertEquals(1, jmxLookup.size());
- assertEquals(Sets.newHashSet(testingRegistry.run3), jmxLookup);
+ assertEquals(Sets.newHashSet(TestingConfigRegistry.run3), jmxLookup);
jmxLookup = clientLookupRuntimeBeansWithModuleAndInstance(
jmxRegistryClient, TestingConfigRegistry.moduleName1,
public AuthProvider(IUserManager ium,InputStream privateKeyFileInputStream) throws Exception {
- this.um = ium;
- if (this.um == null){
+ AuthProvider.um = ium;
+ if (AuthProvider.um == null){
throw new Exception("No usermanager service available.");
}
List<String> roles = new ArrayList<String>(1);
roles.add(UserLevel.SYSTEMADMIN.toString());
- this.um.addLocalUser(new UserConfig(DEFAULT_USER, DEFAULT_PASSWORD, roles));
+ AuthProvider.um.addLocalUser(new UserConfig(DEFAULT_USER, DEFAULT_PASSWORD, roles));
try {
PEM = IOUtils.toString(privateKeyFileInputStream);
}
@Override
public boolean authenticated(String username, String password) throws Exception {
- if (this.um == null){
+ if (AuthProvider.um == null){
throw new Exception("No usermanager service available.");
}
- AuthResultEnum authResult = this.um.authenticate(username,password);
+ AuthResultEnum authResult = AuthProvider.um.authenticate(username,password);
if (authResult.equals(AuthResultEnum.AUTH_ACCEPT) || authResult.equals(AuthResultEnum.AUTH_ACCEPT_LOC)){
return true;
}
@Override
public void removeUserManagerService() {
- this.um = null;
+ AuthProvider.um = null;
}
@Override
public void addUserManagerService(IUserManager userManagerService) {
- this.um = userManagerService;
+ AuthProvider.um = userManagerService;
}
private static String password;
public StubUserManager(String user, String password){
- this.user = user;
- this.password = password;
+ StubUserManager.user = user;
+ StubUserManager.password = password;
}
@Override
public List<String> getUserRoles(String userName) {
@Override
public AuthResultEnum authenticate(String username, String password) {
- if (this.user.equals(username) && this.password.equals(password)){
+ if (StubUserManager.user.equals(username) && StubUserManager.password.equals(password)){
return AuthResultEnum.AUTH_ACCEPT_LOC;
}
return AuthResultEnum.AUTH_REJECT_LOC;
try {
boolean retStatus;
if(oldLatch != null) {
- retStatus = oldLatch.await(this.latchTimeout, TimeUnit.SECONDS);
+ retStatus = oldLatch.await(StatisticsManager.latchTimeout, TimeUnit.SECONDS);
} else {
- retStatus = newLatch.await(this.latchTimeout, TimeUnit.SECONDS);
+ retStatus = newLatch.await(StatisticsManager.latchTimeout, TimeUnit.SECONDS);
}
// log the return code as it will give us, if
// the latch timed out.