use of org.craftercms.core.processors.ItemProcessor in project core by craftercms.
the class UrlPatternProcessorResolverTest method testGetProcessor.
@Test
public void testGetProcessor() throws Exception {
Item item = new Item();
item.setUrl(DESCRIPTOR_URL);
ItemProcessor processor = resolver.getProcessor(item);
assertSame(processor, pagesProcessor);
item = new Item();
item.setUrl(IMAGE_URL);
processor = resolver.getProcessor(item);
assertSame(processor, staticAssetsProcessor);
}
use of org.craftercms.core.processors.ItemProcessor in project core by craftercms.
the class ItemProcessorResolverChainTest method testResolverChain.
@Test
public void testResolverChain() throws Exception {
ItemProcessor processor = resolverChain.getProcessor(item1);
assertSame(processor1, processor);
processor = resolverChain.getProcessor(item2);
assertSame(processor2, processor);
processor = resolverChain.getProcessor(item3);
assertSame(defaultProcessor, processor);
}
use of org.craftercms.core.processors.ItemProcessor in project core by craftercms.
the class SingleProcessorResolverTest method testResolver.
@Test
public void testResolver() throws Exception {
ItemProcessor processor = resolver.getProcessor(null);
assertSame(this.processor, processor);
}
use of org.craftercms.core.processors.ItemProcessor in project core by craftercms.
the class MetaDataProcessorResolverTest method setUpTestResolver.
private void setUpTestResolver() {
Map<String, ItemProcessor> processors = new HashMap<String, ItemProcessor>();
processors.put(PROCESSOR1_ELEMENT_VALUE, processor1);
processors.put(PROCESSOR2_ELEMENT_VALUE, processor2);
resolver = new MetaDataProcessorResolver();
resolver.setProcessorElementXPathQuery(PROCESSOR_ELEMENT_XPATH_QUERY);
resolver.setElementValueToProcessorMappings(processors);
}
use of org.craftercms.core.processors.ItemProcessor in project core by craftercms.
the class MetaDataProcessorResolverTest method testGetProcessor.
@Test
public void testGetProcessor() throws Exception {
Item item = new Item();
item.setDescriptorDom(descriptorDomProcessor1);
ItemProcessor processor = resolver.getProcessor(item);
assertSame(processor1, processor);
item = new Item();
item.setDescriptorDom(descriptorDomProcessor2);
processor = resolver.getProcessor(item);
assertSame(processor2, processor);
}
Aggregations