use of org.apache.aries.blueprint.services.ParserService in project aries by apache.
the class ParserServiceImportAndIncludeXSDsTest method testXSDImports.
@Test
public void testXSDImports() throws Exception {
assertTrue(TEST_BUNDLE + " should correctly register blueprint container", waitForConfig());
ParserService parserService = context().getService(ParserService.class);
URL blueprintXML = context().getBundleByName(TEST_BUNDLE).getEntry("OSGI-INF/blueprint/ImportNamespacesWithXSDIncludeTest.xml");
ComponentDefinitionRegistry cdr = parserService.parse(blueprintXML, context().getBundleByName(TEST_BUNDLE));
assertNotNull(cdr.getComponentDefinition("aries-1682"));
}
use of org.apache.aries.blueprint.services.ParserService in project aries by apache.
the class ParserServiceImportCmAndIncorrectNamespaceHandlersTest method testXSDImports.
@Test
public void testXSDImports() throws Exception {
waitForConfig();
ParserService parserService = context().getService(ParserService.class);
URL blueprintXML = context().getBundleByName(TEST_BUNDLE).getEntry("OSGI-INF/blueprint/ImportIncorrectAndCmNamespacesTest.xml");
ComponentDefinitionRegistry cdr = parserService.parse(blueprintXML, context().getBundleByName(TEST_BUNDLE));
assertNotNull(cdr.getComponentDefinition("aries-1503"));
}
use of org.apache.aries.blueprint.services.ParserService in project aries by apache.
the class ParserServiceImportXSDsBetweenNamespaceHandlersTest method testXSDImports.
@Test
public void testXSDImports() throws Exception {
waitForConfig();
ParserService parserService = context().getService(ParserService.class);
URL blueprintXML = context().getBundleByName(TEST_BUNDLE).getEntry("OSGI-INF/blueprint/ImportNamespacesTest.xml");
ComponentDefinitionRegistry cdr = parserService.parse(blueprintXML, context().getBundleByName(TEST_BUNDLE));
assertNotNull(cdr.getComponentDefinition("aries-1503"));
}
use of org.apache.aries.blueprint.services.ParserService in project aries by apache.
the class ParserServiceIgnoreUnknownNamespaceHandlerTest method testIgnoreTrue.
@Test
public void testIgnoreTrue() throws Exception {
ParserService parserService = context().getService(ParserService.class);
URL blueprintXML = context().getBundleByName(TEST_BUNDLE).getEntry("OSGI-INF/blueprint/context.xml");
// ensure there is no error parsing while CM is stopped
parserService.parse(blueprintXML, context().getBundleByName(TEST_BUNDLE));
}
use of org.apache.aries.blueprint.services.ParserService in project aries by apache.
the class ParserProxyTest method getMockParserServiceProxy.
public static ParserProxy getMockParserServiceProxy() {
BundleContext mockCtx = Skeleton.newMock(new BundleContextMock(), BundleContext.class);
NamespaceHandlerRegistry nhri = new NamespaceHandlerRegistryImpl(mockCtx);
ParserService parserService = new ParserServiceImpl(nhri);
mockCtx.registerService(ParserService.class.getName(), parserService, new Hashtable<String, String>());
ParserProxyImpl parserProxyService = new ParserProxyImpl();
parserProxyService.setParserService(parserService);
parserProxyService.setBundleContext(mockCtx);
parserProxyService.setModellingManager(new ModellingManagerImpl());
return parserProxyService;
}
Aggregations