private void checkRegisterFromFileFeatureXml(boolean withScheme) throws Exception { String content = "content-" + (withScheme ? "withScheme" : "noScheme"); Uri resUri = makeFile(content); Uri featureFile = makeFile(xml(NODEP_TPL, "gadget", withScheme ? resUri.toString() : resUri.getPath(), null)); registry = new TestFeatureRegistry(withScheme ? featureFile.toString() : featureFile.getPath()); // Verify single resource works all the way through. List<FeatureResource> resources = registry.getAllFeatures(); assertEquals(1, resources.size()); assertEquals(content, resources.get(0).getContent()); }
private void checkRegisterFromFileFeatureXml(boolean withScheme) throws Exception { TestFeatureRegistry.Builder builder = TestFeatureRegistry.newBuilder(); String content = "content-" + (withScheme ? "withScheme" : "noScheme"); Uri resUri = makeFile(content); Uri featureFile = makeFile(xml(NODEP_TPL, "gadget", withScheme ? resUri.toString() : resUri.getPath(), null)); registry = builder.build(withScheme ? featureFile.toString() : featureFile.getPath()); // Verify single resource works all the way through. List<FeatureResource> resources = registry.getAllFeatures().getResources(); assertEquals(1, resources.size()); assertEquals(content, resources.get(0).getContent()); }
private void checkRegisterFromFileFeatureXml(boolean withScheme) throws Exception { TestFeatureRegistry.Builder builder = TestFeatureRegistry.newBuilder(); String content = "content-" + (withScheme ? "withScheme" : "noScheme"); Uri resUri = makeFile(content); Uri featureFile = makeFile(xml(NODEP_TPL, "gadget", withScheme ? resUri.toString() : resUri.getPath(), null)); registry = builder.build(withScheme ? featureFile.toString() : featureFile.getPath()); // Verify single resource works all the way through. List<FeatureResource> resources = registry.getAllFeatures().getResources(); assertEquals(1, resources.size()); assertEquals(content, resources.get(0).getContent()); }