@@ -0,0 +1,1379 @@
+package com.xaadin.elementfactory;%0A%0Aimport com.vaadin.ui.Button;%0Aimport com.xaadin.VisualTreeNode;%0Aimport com.xaadin.VisualTreeNodeImpl;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.fest.assertions.api.Assertions.assertThat;%0A%0A/**%0A * Created by hej on 27.01.14.%0A */%0Apublic class ButtonElementFactoryTest %7B%0A%0A    private ButtonElementFactory factory;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        factory = new ButtonElementFactory();%0A    %7D%0A%0A    private class TestButtonHandler %7B%0A%0A        int callCount = 0;%0A%0A        @SuppressWarnings(%22UnusedDeclaration%22)%0A        public void onTestButtonClick(VisualTreeNode node, Button.ClickEvent event) %7B%0A            callCount++;%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testProcessEvents() throws Exception %7B%0A        Button button = new Button();%0A        VisualTreeNode node = new VisualTreeNodeImpl(button);%0A        node.setAdditionalParameter(%22onClick%22, %22onTestButtonClick%22);%0A%0A        TestButtonHandler handler = new TestButtonHandler();%0A        factory.processEvents(node, handler);%0A%0A        assertThat(handler.callCount).isEqualTo(0);%0A        button.click();%0A        assertThat(handler.callCount).isEqualTo(1);%0A    %7D%0A%0A    @Test%0A    public void testIsClassSupportedForElementFactory() throws Exception %7B%0A        assertThat(factory.isClassSupportedForElementFactory(Button.class.getName()));%0A    %7D%0A%7D%0A

Add ButtonElementFactoryTest