]> source.dussan.org Git - vaadin-framework.git/commitdiff
added getVersion to Application and giving version info to TT
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 15 Jan 2008 15:05:57 +0000 (15:05 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 15 Jan 2008 15:05:57 +0000 (15:05 +0000)
svn changeset:3524/svn branch:trunk

src/com/itmill/toolkit/Application.java
src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java

index 28355b98474767b20e57468a0dd9f00abd5670aa..2164cda9dcd03f09afbb37a19978101c41ca04b3 100644 (file)
@@ -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
index a94b17e8cfa38128759dde99f76df5fa671ba09a..d6a7c3a36ff1ec8282224b4e67a99b725a985960 100755 (executable)
@@ -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() {
index b148231a18eae053086092b52c5c3ed8c421dd9c..a3d398bc4364d6b7551d7f2b1530e11ac1eb12ca 100644 (file)
@@ -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</script>\n");