public void testRegister() {
ClientLibraryResolverRegistry reg = ClientLibraryResolverRegistryImpl.INSTANCE;
reg.register(null);
ClientLibraryResolver nullValues = new ClientLibraryResolver() {
@Override
public String getName() {
return null;
}
@Override
public Type getType() {
return null;
}
@Override
public String getLocation() {
return null;
}
@Override
public String getUrl() {
return null;
}
@Override
public boolean canCombine() {
return false;
}
};
reg.register(nullValues);
assertNull(reg.get(null, null));
ClientLibraryResolver customResolver = new ClientLibraryResolver() {
@Override
public String getName() {
return "Kangaroo";
}
@Override
public Type getType() {
return Type.JS;
}
@Override
public String getLocation() {
return null;
}
@Override
public String getUrl() {
return null;
}
@Override
public boolean canCombine() {
return false;
}
};
assertNull(reg.get("Kangaroo", Type.JS));
reg.register(customResolver);
assertEquals("Could not register and look up custom resolver.", customResolver, reg.get("Kangaroo", Type.JS));
ClientLibraryResolver overrideCustomResolver = new ClientLibraryResolver() {
@Override
public String getName() {
return "Kangaroo";
}