From: Leif Åstrand Date: Tue, 26 Jun 2012 12:25:28 +0000 (+0300) Subject: Move test extension out of main source folder X-Git-Tag: 7.0.0.alpha3~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=399b4cb789f4d898e84dfb386b8ad45af5cee7d5;p=vaadin-framework.git Move test extension out of main source folder --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java deleted file mode 100644 index 0bfb8f3c32..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java +++ /dev/null @@ -1,12 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.ClientRpc; - -public interface GreetAgainRpc extends ClientRpc { - - public void greetAgain(); - -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java deleted file mode 100644 index 7185397f94..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.google.gwt.user.client.Window; -import com.vaadin.terminal.gwt.client.ServerConnector; -import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.communication.RpcProxy; -import com.vaadin.terminal.gwt.client.ui.AbstractConnector; -import com.vaadin.terminal.gwt.client.ui.Connect; -import com.vaadin.tests.extensions.HelloWorldExtension; - -@Connect(HelloWorldExtension.class) -public class HelloWorldExtensionConnector extends AbstractConnector { - HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this); - - @Override - public HelloWorldState getState() { - return (HelloWorldState) super.getState(); - } - - @Override - protected void init() { - registerRpc(GreetAgainRpc.class, new GreetAgainRpc() { - public void greetAgain() { - greet(); - } - }); - } - - @Override - public void setParent(ServerConnector parent) { - super.setParent(parent); - greet(); - } - - private void greet() { - String msg = getState().getGreeting() + " from " - + Util.getConnectorString(this) + " attached to " - + Util.getConnectorString(getParent()); - VConsole.log(msg); - - String response = Window.prompt(msg, ""); - rpc.onMessageSent(response); - } -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java deleted file mode 100644 index 0289713390..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java +++ /dev/null @@ -1,10 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.ServerRpc; - -public interface HelloWorldRpc extends ServerRpc { - public void onMessageSent(String message); -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java deleted file mode 100644 index 9524a5e9aa..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.SharedState; - -public class HelloWorldState extends SharedState { - private String greeting = "Hello world"; - - public String getGreeting() { - return greeting; - } - - public void setGreeting(String greeting) { - this.greeting = greeting; - } -} diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java index d0f0994af3..23b892be66 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -4,9 +4,9 @@ package com.vaadin.tests.extensions; import com.vaadin.terminal.AbstractExtension; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.GreetAgainRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldState; +import com.vaadin.tests.widgetset.client.helloworldfeature.GreetAgainRpc; +import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldRpc; +import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldState; import com.vaadin.ui.Notification; public class HelloWorldExtension extends AbstractExtension { diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index 1671673198..8625ffd955 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -3,11 +3,13 @@ */ package com.vaadin.tests.extensions; +import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") public class HelloWorldExtensionTest extends AbstractTestRoot { @Override diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java new file mode 100644 index 0000000000..cbfb1260e4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java @@ -0,0 +1,12 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.ClientRpc; + +public interface GreetAgainRpc extends ClientRpc { + + public void greetAgain(); + +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java new file mode 100644 index 0000000000..d2066c53c8 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java @@ -0,0 +1,48 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.google.gwt.user.client.Window; +import com.vaadin.terminal.gwt.client.ServerConnector; +import com.vaadin.terminal.gwt.client.Util; +import com.vaadin.terminal.gwt.client.VConsole; +import com.vaadin.terminal.gwt.client.communication.RpcProxy; +import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector; +import com.vaadin.terminal.gwt.client.ui.Connect; +import com.vaadin.tests.extensions.HelloWorldExtension; + +@Connect(HelloWorldExtension.class) +public class HelloWorldExtensionConnector extends AbstractExtensionConnector { + HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this); + + @Override + public HelloWorldState getState() { + return (HelloWorldState) super.getState(); + } + + @Override + protected void init() { + registerRpc(GreetAgainRpc.class, new GreetAgainRpc() { + public void greetAgain() { + greet(); + } + }); + } + + @Override + public void setParent(ServerConnector parent) { + super.setParent(parent); + greet(); + } + + private void greet() { + String msg = getState().getGreeting() + " from " + + Util.getConnectorString(this) + " attached to " + + Util.getConnectorString(getParent()); + VConsole.log(msg); + + String response = Window.prompt(msg, ""); + rpc.onMessageSent(response); + } +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java new file mode 100644 index 0000000000..a7a3b091bf --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java @@ -0,0 +1,10 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.ServerRpc; + +public interface HelloWorldRpc extends ServerRpc { + public void onMessageSent(String message); +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java new file mode 100644 index 0000000000..f26824c781 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java @@ -0,0 +1,18 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.SharedState; + +public class HelloWorldState extends SharedState { + private String greeting = "Hello world"; + + public String getGreeting() { + return greeting; + } + + public void setGreeting(String greeting) { + this.greeting = greeting; + } +}