From: Matti Tahvonen Date: Tue, 15 Jan 2008 15:05:57 +0000 (+0000) Subject: added getVersion to Application and giving version info to TT X-Git-Tag: 6.7.0.beta1~5165 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=140ee7956be749a108f5ecebae33324e644632fb;p=vaadin-framework.git added getVersion to Application and giving version info to TT svn changeset:3524/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/Application.java b/src/com/itmill/toolkit/Application.java index 28355b9847..2164cda9dc 100644 --- a/src/com/itmill/toolkit/Application.java +++ b/src/com/itmill/toolkit/Application.java @@ -1080,4 +1080,15 @@ public abstract class Application implements URIHandler, Terminal.ErrorListener return f; } + /** + * Override this method to return correct version number of your + * Application. Version information is delivered for example to Testing + * Tools test results. + * + * @return version string + */ + public String getVersion() { + return "NONVERSIONED"; + } + } \ No newline at end of file diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index a94b17e8cf..d6a7c3a36f 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -126,11 +126,14 @@ public class ApplicationConnection { private native static void initializeTestingTools(String testServerUri, ApplicationConnection ap) /*-{ - $wnd.itmill.gwtClient = {}; - $wnd.itmill.gwtClient.hasActiveRequest = function() { - return ap.@com.itmill.toolkit.terminal.gwt.client.ApplicationConnection::hasActiveRequest()(); - } - $wnd.itmill.startTT(testServerUri); + var client = {}; + client.hasActiveRequest = function() { + return ap.@com.itmill.toolkit.terminal.gwt.client.ApplicationConnection::hasActiveRequest()(); + } + client.getVersionInfo = function() { + return $wnd.itmill.versionInfo; + } + $wnd.itmill.startTT(testServerUri, client); }-*/; public static Console getConsole() { diff --git a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java index b148231a18..a3d398bc43 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java @@ -455,7 +455,7 @@ public class ApplicationServlet extends HttpServlet { window.handleParameters(parameters); } - writeAjaxPage(request, response, window, themeName); + writeAjaxPage(request, response, window, themeName, application); } // For normal requests, transform the window @@ -633,8 +633,8 @@ public class ApplicationServlet extends HttpServlet { * store represented by the given URL. */ private void writeAjaxPage(HttpServletRequest request, - HttpServletResponse response, Window window, String themeName) - throws IOException, MalformedURLException { + HttpServletResponse response, Window window, String themeName, + Application application) throws IOException, MalformedURLException { response.setContentType("text/html"); final BufferedWriter page = new BufferedWriter(new OutputStreamWriter( response.getOutputStream())); @@ -682,6 +682,13 @@ public class ApplicationServlet extends HttpServlet { page.write(", testingToolsUri : '" + getTestingToolsUri(request) + "'"); } + if (testingToolsActive) { + page.write(", versionInfo : {toolkitVersion:\""); + page.write(VERSION); + page.write("\",applicationVersion:\""); + page.write(application.getVersion()); + page.write("\"}"); + } page.write("\n};\n\n");