use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.
the class ViewConfigPathTest method testNamesWizard8.
@Test
public void testNamesWizard8() {
this.viewConfigExtension.addPageDefinition(Pages.Wizard8.Step1.class);
ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
ViewConfigDescriptor viewConfigDescriptor;
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard8.Step1.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/w8/step1.xhtml", viewConfigDescriptor.getViewId());
}
use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.
the class ViewConfigPathTest method testNamesWizard9.
@Test
public void testNamesWizard9() {
this.viewConfigExtension.addPageDefinition(Pages.Wizard9.Step1.class);
ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
ViewConfigDescriptor viewConfigDescriptor;
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard9.Step1.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/w9/step1.xhtml", viewConfigDescriptor.getViewId());
}
use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.
the class ViewConfigPathTest method testNamesWizard1.
@Test
public void testNamesWizard1() {
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step1.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step2.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step3.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step4.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step5.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step6.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard1.Step7.class);
ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
ViewConfigDescriptor viewConfigDescriptor;
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step1.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard1/step1.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step2.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/step2.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step3.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard1/step3.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step4.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard1/w1/step4.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step5.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/w1/step5.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step6.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard1/w1b/step6.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard1.Step7.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard1/w1b/step7.xhtml", viewConfigDescriptor.getViewId());
}
use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.
the class ViewConfigPathTest method testNamesWizard3.
@Test
public void testNamesWizard3() {
this.viewConfigExtension.addPageDefinition(Pages.Wizard3.Step1.class);
this.viewConfigExtension.addPageDefinition(Pages.Wizard3.Step2.class);
ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
ViewConfigDescriptor viewConfigDescriptor;
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard3.Step1.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/pages/wizard3/step1.xhtml", viewConfigDescriptor.getViewId());
viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard3.Step2.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertEquals("/step2.xhtml", viewConfigDescriptor.getViewId());
}
use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.
the class ViewConfigTest method testSimpleViewConfigWithViewControllerCallback.
@Test
public void testSimpleViewConfigWithViewControllerCallback() {
this.viewConfigExtension.addPageDefinition(SimplePageConfig.class);
this.viewConfigExtension.addIndirectlyInheritedMetaData(PageBean003.class);
ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
ViewConfigDescriptor viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(SimplePageConfig.class);
Assert.assertNotNull(viewConfigDescriptor);
Assert.assertNotNull(viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, InitView.class));
Assert.assertNotNull(viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreViewAction.class));
Assert.assertNotNull(viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreRenderView.class));
Assert.assertNull(viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PostRenderView.class));
Assert.assertEquals(PageBean003.class, viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, InitView.class).getCallbackMethods().keySet().iterator().next());
Assert.assertEquals("callbackMethod1", ((List<Method>) viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, InitView.class).getCallbackMethods().values().iterator().next()).iterator().next().getName());
Assert.assertEquals(PageBean003.class, viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreViewAction.class).getCallbackMethods().keySet().iterator().next());
Assert.assertEquals("callbackMethod1", ((List<Method>) viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreViewAction.class).getCallbackMethods().values().iterator().next()).iterator().next().getName());
Assert.assertEquals(PageBean003.class, viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreRenderView.class).getCallbackMethods().keySet().iterator().next());
Assert.assertEquals("callbackMethod2", ((List<Method>) viewConfigDescriptor.getCallbackDescriptor(ViewControllerRef.class, PreRenderView.class).getCallbackMethods().values().iterator().next()).iterator().next().getName());
}
Aggregations