use of com.adobe.acs.commons.httpcache.store.jcr.impl.visitor.mock.RootNodeMockFactory in project acs-aem-commons by Adobe-Consulting-Services.
the class EntryNodeByStringKeyVisitorTest method testPresent.
@Test
public void testPresent() throws Exception {
final RootNodeMockFactory.Settings settings = new RootNodeMockFactory.Settings();
settings.setEntryNodeCount(10);
final Node rootNode = new RootNodeMockFactory(settings).build();
final EntryNodeByStringKeyVisitor visitor = getMockedEntryNodeByStringKeyVisitor("[resourcePath: /content/some/path]", true);
visitor.visit(rootNode);
assertNotNull(visitor.getCacheContentIfPresent());
}
use of com.adobe.acs.commons.httpcache.store.jcr.impl.visitor.mock.RootNodeMockFactory in project acs-aem-commons by Adobe-Consulting-Services.
the class ExpiredNodesVisitorTest method test.
@Test
public void test() throws Exception {
final RootNodeMockFactory.Settings settings = new RootNodeMockFactory.Settings();
settings.setEntryNodeCount(10);
settings.setExpiredEntryNodeCount(20);
final Node rootNode = new RootNodeMockFactory(settings).build();
final ExpiredNodesVisitor visitor = getMockedExpiredNodesVisitor(8);
visitor.visit(rootNode);
visitor.close();
assertEquals(20, visitor.getEvictionCount());
Mockito.verify(rootNode.getSession(), Mockito.times(3)).save();
}
use of com.adobe.acs.commons.httpcache.store.jcr.impl.visitor.mock.RootNodeMockFactory in project acs-aem-commons by Adobe-Consulting-Services.
the class InvalidateByCacheConfigVisitorTest method test.
@Test
public void test() throws Exception {
final InvalidateByCacheConfigVisitor visitor = getInvalidateByCacheConfigVisitor(5, true);
final RootNodeMockFactory.Settings settings = new RootNodeMockFactory.Settings();
settings.setEntryNodeCount(10);
final Node rootNode = new RootNodeMockFactory(settings).build();
visitor.visit(rootNode);
visitor.close();
Mockito.verify(rootNode.getSession(), Mockito.times(2)).save();
}
use of com.adobe.acs.commons.httpcache.store.jcr.impl.visitor.mock.RootNodeMockFactory in project acs-aem-commons by Adobe-Consulting-Services.
the class AllEntryNodesCountVisitorTest method testEmpty.
@Test
public void testEmpty() throws IOException, RepositoryException {
final AllEntryNodesCountVisitor visitor = new AllEntryNodesCountVisitor(11);
final RootNodeMockFactory.Settings settings = new RootNodeMockFactory.Settings();
settings.setEntryNodeCount(0);
settings.setExpiredEntryNodeCount(0);
final Node rootNode = new RootNodeMockFactory(settings).build();
visitor.visit(rootNode);
assertEquals(0, visitor.getTotalEntryNodeCount());
}
use of com.adobe.acs.commons.httpcache.store.jcr.impl.visitor.mock.RootNodeMockFactory in project acs-aem-commons by Adobe-Consulting-Services.
the class AllEntryNodesCountVisitorTest method testWithExpiredEntries.
@Test
public void testWithExpiredEntries() throws IOException, RepositoryException {
final AllEntryNodesCountVisitor visitor = new AllEntryNodesCountVisitor(11);
final RootNodeMockFactory.Settings settings = new RootNodeMockFactory.Settings();
settings.setEntryNodeCount(20);
settings.setExpiredEntryNodeCount(10);
final Node rootNode = new RootNodeMockFactory(settings).build();
visitor.visit(rootNode);
assertEquals(30, visitor.getTotalEntryNodeCount());
}
Aggregations