Skip to content

Commit

Permalink
Address code/style comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjudd committed Jan 21, 2015
1 parent 1e5ebf1 commit d6eb14d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE, emulateSdk = 18)
public class ManifestParserTest {
private static final String MODULE_PREFIX = ManifestParser.GLIDE_MODULE_KEY + ManifestParser.GLIDE_MODULE_SEPARATOR;
private static final String MODULE_PREFIX = "glidemodule:";

@Mock Context context;
private ManifestParser parser;
Expand Down Expand Up @@ -75,14 +75,14 @@ public void testParse_withMultipleValidModuleNames_returnsListContainingModules(

@Test(expected = RuntimeException.class)
public void testThrows_withInvalidModuleNameFormat() {
addToManfiest(ManifestParser.GLIDE_MODULE_KEY + TestModule1.class.getName());
addToManifest("glidemodule" + TestModule1.class.getName());

parser.parse();
}

@Test(expected = RuntimeException.class)
public void testThrows_whenModuleNameNotFound() {
addToManfiest(ManifestParser.GLIDE_MODULE_KEY + ManifestParser.GLIDE_MODULE_SEPARATOR + "fakeClassName");
addToManifest("glidemodule:" + "fakeClassName");

parser.parse();
}
Expand All @@ -102,10 +102,10 @@ public void testThrows_whenPackageNameNotFound() {
}

private void addModuleToManifest(Class<?> moduleClass) {
addToManfiest(MODULE_PREFIX + moduleClass.getName());
addToManifest(MODULE_PREFIX + moduleClass.getName());
}

private void addToManfiest(String key) {
private void addToManifest(String key) {
applicationInfo.metaData.putString(key, "");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* To use this interface:
* <ol>
* <li>
* Implement GlideModule, calling
* Implement the GlideModule interface in a class with public visibility, calling
* {@link com.bumptech.glide.Glide#register(Class, Class, com.bumptech.glide.load.model.ModelLoaderFactory)}
* for each {@link com.bumptech.glide.load.model.ModelLoader} you'd like to register:
* <pre>
Expand All @@ -28,7 +28,7 @@
* <li>Add your implementation to your list of keeps in your proguard.cfg file:
* <pre>
* {@code
* -keepnames com.bumptech.glide.samples.flickr.FlickrGlideModule
* -keepnames class * com.bumptech.glide.samples.flickr.FlickrGlideModule
* }
* </pre>
* </li>
Expand All @@ -46,8 +46,8 @@
* </p>
*
* <p>
* All implementations must contain only an empty constructor so they can be instantiated via reflection when
* Glide is lazily initialized.
* All implementations must be publicly visible and contain only an empty constructor so they can be instantiated
* via reflection when Glide is lazily initialized.
* </p>
*/
public interface GlideModule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
* Parses {@link com.bumptech.glide.module.GlideModule} references out of the AndroidManifest file.
*/
public final class ManifestParser {
// Visible for testing
static final String GLIDE_MODULE_KEY = "glidemodule";
// Visible for testing
static final String GLIDE_MODULE_SEPARATOR = ":";
private static final String GLIDE_MODULE_KEY = "glidemodule";
private static final String GLIDE_MODULE_SEPARATOR = ":";

private final Context context;

Expand Down

0 comments on commit d6eb14d

Please sign in to comment.