Search in sources :

Example 6 with EmptyModelTemplate

use of com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModelTemplate in project flow by vaadin.

the class TemplateModelProxyHandlerTest method nonStaticNestedClass_throwsException.

@Test(expected = IllegalArgumentException.class)
public void nonStaticNestedClass_throwsException() {
    EmptyModelTemplate template = new EmptyModelTemplate();
    TemplateModelProxyHandler.createModelProxy(template.getElement().getNode(), new BeanModelType<>(NotStaticModel.class, PropertyFilter.ACCEPT_ALL));
}
Also used : EmptyModelTemplate(com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModelTemplate) Test(org.junit.Test)

Example 7 with EmptyModelTemplate

use of com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModelTemplate in project flow by vaadin.

the class TemplateModelProxyHandlerTest method testToString.

@Test
public void testToString() {
    EmptyModelTemplate emptyModelTemplate1 = new EmptyModelTemplate();
    EmptyModelTemplate emptyModelTemplate2 = new EmptyModelTemplate();
    TemplateModel m1 = emptyModelTemplate1.getModel();
    TemplateModel m2 = emptyModelTemplate2.getModel();
    // add templates to UI so that their state nodes get an id which is used
    // in toString()
    new UI().add(emptyModelTemplate1, emptyModelTemplate2);
    Assert.assertEquals(m1.toString(), m1.toString());
    Assert.assertNotEquals(m1.toString(), m2.toString());
}
Also used : UI(com.vaadin.flow.component.UI) TemplateModel(com.vaadin.flow.template.angular.model.TemplateModel) EmptyModelTemplate(com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModelTemplate) Test(org.junit.Test)

Aggregations

EmptyModelTemplate (com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModelTemplate)7 Test (org.junit.Test)7 TemplateModel (com.vaadin.flow.template.angular.model.TemplateModel)5 EmptyModel (com.vaadin.flow.template.angular.model.TemplateModelTest.EmptyModel)3 UI (com.vaadin.flow.component.UI)1 BeanModelType (com.vaadin.flow.template.angular.model.BeanModelType)1