use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class IndexConfigFactoryTest method path_index_configs.
@Test
public void path_index_configs() throws Exception {
final PatternIndexConfigDocument fullConfig = createFullConfig();
final ImmutableSortedSet<PathIndexConfig> pathIndexConfigs = fullConfig.getPathIndexConfigs();
assertEquals(3, pathIndexConfigs.size());
assertEquals(IndexConfig.FULLTEXT, fullConfig.getConfigForPath(PropertyPath.from("displayName")));
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class NodeEditTest method edit_index_config.
@Test
public void edit_index_config() throws Exception {
final Node node = createNode();
final PatternIndexConfigDocument newIndexConfig = PatternIndexConfigDocument.create().defaultConfig(IndexConfig.FULLTEXT).build();
final Node editedNode = Node.create(node).indexConfigDocument(newIndexConfig).build();
assertEquals(newIndexConfig, editedNode.getIndexConfigDocument());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class PageRegionsConfigProcessorTest method test_fragment_component.
@Test
public void test_fragment_component() throws Exception {
final Page page = Page.create().regions(PageRegions.create().add(Region.create().name("region1").add(FragmentComponent.create().fragment(ContentId.from("content-id")).build()).build()).build()).build();
final PatternIndexConfigDocument result = processPage(page, singletonList(configFormWithHtmlArea).listIterator(), null);
assertTrue(result.getPathIndexConfigs().contains(PathIndexConfig.create().path(PropertyPath.from(COMPONENTS, FragmentComponentType.INSTANCE.toString(), ID)).indexConfig(IndexConfig.MINIMAL).build()));
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class PageRegionsConfigProcessorTest method test_part_component.
@Test
public void test_part_component() throws Exception {
final DescriptorKey partDescriptorKey = DescriptorKey.from("part1AppKey:name");
final String htmlarea = "htmlarea";
final Page page = Page.create().regions(PageRegions.create().add(Region.create().name("region1").add(PartComponent.create().descriptor(partDescriptorKey).build()).build()).build()).build();
final PatternIndexConfigDocument result = processPage(page, Arrays.asList(configFormWithHtmlArea).listIterator(), null);
assertEquals("htmlStripper", result.getConfigForPath(PropertyPath.from(COMPONENTS, PartComponentType.INSTANCE.toString(), CONFIG, partDescriptorKey.getApplicationKey().toString(), partDescriptorKey.getName(), htmlarea)).getIndexValueProcessors().get(0).getName());
}
use of com.enonic.xp.index.PatternIndexConfigDocument in project xp by enonic.
the class PageRegionsConfigProcessorTest method test_size.
@Test
public void test_size() throws Exception {
final PatternIndexConfigDocument result = processPage(Page.create().regions(PageRegions.create().build()).build(), null, null);
assertEquals(5, result.getPathIndexConfigs().size());
}
Aggregations