aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-04-18 10:57:11 +0300
committerHenri Sara <henri.sara@gmail.com>2017-04-18 10:57:11 +0300
commit9a0f1c136168fbc7b63570b88da7a9cba9de389c (patch)
tree1f08ad9d488a00fabdb639f7ffe9d7a02978aad3 /server/src/test
parentb480c7166ac56801cda11b73a6ad4694d467b98b (diff)
downloadvaadin-framework-9a0f1c136168fbc7b63570b88da7a9cba9de389c.tar.gz
vaadin-framework-9a0f1c136168fbc7b63570b88da7a9cba9de389c.zip
Composite component (#8952)
A composite is included in the server side hierarchy and in the connector hierarchy on the client side but does not have its own widget or DOM. To ensure that captions etc are renderer correctly for the root contents, the client side connector returns both the widget and state for the content connector. Server side API related to width and height are automatically forwarded to the root component to enable easy use of the composite inside different layout configurations. Other server side API inherited from AbstractComponent is unwanted, should be optional and therefore throw an exception by default. Resolves #2458
Diffstat (limited to 'server/src/test')
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
index 3b4c2413f9..29dd6638fa 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
@@ -17,6 +17,8 @@ import org.mockito.Mockito;
import com.vaadin.server.VaadinSession;
import com.vaadin.tests.VaadinClasses;
import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentRootSetter;
+import com.vaadin.ui.Composite;
import com.vaadin.ui.ConnectorTracker;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
@@ -75,7 +77,16 @@ public class StateGetDoesNotMarkDirtyTest {
}
// just to make sure we can invoke it
method.setAccessible(true);
- method.invoke(newInstance);
+ try {
+ method.invoke(newInstance);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof UnsupportedOperationException) {
+ // Overridden getter which is not supposed to be
+ // called
+ } else {
+ throw e;
+ }
+ }
}
} catch (Exception e) {
System.err.println("problem with method " + clazz.getName()
@@ -116,6 +127,9 @@ public class StateGetDoesNotMarkDirtyTest {
if (component instanceof UI) {
return component;
}
+ if (component instanceof Composite) {
+ ComponentRootSetter.setRoot(component, new Label());
+ }
emulateAttach(component);
return component;
} catch (NoSuchMethodException e) {