use of net.n2oapp.framework.api.metadata.global.view.page.N2oPage in project n2o-framework by i-novus-llc.
the class LocalizedSourceCacheOperationTest method test.
@Test
public void test() {
LocaleContextHolder.setLocale(new Locale("ru"));
CacheTemplate cacheTemplate = mock(CacheTemplate.class);
MetadataRegister metadataRegister = mock(MetadataRegister.class);
when(cacheTemplate.execute(eq("n2o.source"), eq("test.N2oPage.ru"), any())).thenReturn(getPage());
when(metadataRegister.get("test", N2oPage.class)).thenReturn(new XmlInfo("test", N2oPage.class, "", ""));
LocalizedSourceCacheOperation operation = new LocalizedSourceCacheOperation(cacheTemplate, metadataRegister);
Object testPage = operation.execute(new PageContext("test"), null, this::getPage, null, null, null);
assertThat(testPage instanceof N2oPage, is(true));
}
use of net.n2oapp.framework.api.metadata.global.view.page.N2oPage in project n2o-framework by i-novus-llc.
the class TestDynamicMetadataProvider method read.
@Override
public List<? extends N2oMetadata> read(String context) {
if (autogen) {
N2oPage page = new N2oStandardPage();
page.setId(code + '$' + context);
return Arrays.asList(page);
}
return metadataList;
}
use of net.n2oapp.framework.api.metadata.global.view.page.N2oPage in project n2o-framework by i-novus-llc.
the class SimpleMenuCompiler method initDefaultName.
private String initDefaultName(N2oAction action, CompileProcessor p) {
String pageId = initPageId(action);
if (pageId == null)
return null;
N2oPage page = p.getSource(pageId, N2oPage.class);
return page.getName();
}
Aggregations