Fixes the cross-site linker template to account for the change, probably in revision
3901, that the strongName variable passed to the linker templates no longer
includes .cache.js on the end.
This also adds test cases that the standard three linkers of GWT are basically
working.
Review by: fabbot (pair prog)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@4101 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/linker/XSTemplate.js b/dev/core/src/com/google/gwt/core/linker/XSTemplate.js
index a88be2a..8cbdbe9 100644
--- a/dev/core/src/com/google/gwt/core/linker/XSTemplate.js
+++ b/dev/core/src/com/google/gwt/core/linker/XSTemplate.js
@@ -368,7 +368,7 @@
// some apps. The final solution was simply to inject the compiled script
// from *within* the stats script, guaranteeing order at the expense of near
// total inscrutability :(
- var compiledScriptTag = '"<script src=\\"' + base + strongName + '\\"></scr" + "ipt>"';
+ var compiledScriptTag = '"<script src=\\"' + base + strongName + '.cache.js\\"></scr" + "ipt>"';
$doc.write('<script><!--\n'
+ 'window.__gwtStatsEvent && window.__gwtStatsEvent({'
+ 'moduleName:"__MODULE_NAME__", subSystem:"startup",'
diff --git a/user/test/com/google/gwt/core/ext/IFrameLinkerTest.gwt.xml b/user/test/com/google/gwt/core/ext/IFrameLinkerTest.gwt.xml
new file mode 100644
index 0000000..5aa3448
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/IFrameLinkerTest.gwt.xml
@@ -0,0 +1,18 @@
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<module>
+ <inherits name='com.google.gwt.core.ext.LinkerTest' />
+ <add-linker name='std' />
+</module>
diff --git a/user/test/com/google/gwt/core/ext/LinkerSuite.java b/user/test/com/google/gwt/core/ext/LinkerSuite.java
new file mode 100644
index 0000000..290a2f6
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/LinkerSuite.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.core.ext;
+
+import com.google.gwt.core.ext.test.IFrameLinkerTest;
+import com.google.gwt.core.ext.test.LinkerTest;
+import com.google.gwt.core.ext.test.SingleScriptLinkerTest;
+import com.google.gwt.core.ext.test.XSLinkerTest;
+import com.google.gwt.junit.tools.GWTTestSuite;
+
+import junit.framework.Test;
+
+/**
+ * Runs the linker tests. See the subclasses of {@link LinkerTest}.
+ */
+public class LinkerSuite {
+
+ public static Test suite() {
+ GWTTestSuite suite = new GWTTestSuite("Smoke test for linkers");
+
+ // $JUnit-BEGIN$
+ suite.addTestSuite(IFrameLinkerTest.class);
+ suite.addTestSuite(XSLinkerTest.class);
+ suite.addTestSuite(SingleScriptLinkerTest.class);
+ // $JUnit-END$
+
+ return suite;
+ }
+}
diff --git a/user/test/com/google/gwt/core/ext/LinkerTest.gwt.xml b/user/test/com/google/gwt/core/ext/LinkerTest.gwt.xml
new file mode 100644
index 0000000..c015e0c
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/LinkerTest.gwt.xml
@@ -0,0 +1,21 @@
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<!-- This is an abstract module. Specific linker tests should inherit -->
+<!-- from this module and specify a linker. -->
+
+<module>
+ <inherits name='com.google.gwt.junit.JUnit' />
+ <source path='test' />
+</module>
diff --git a/user/test/com/google/gwt/core/ext/SingleScriptLinkerTest.gwt.xml b/user/test/com/google/gwt/core/ext/SingleScriptLinkerTest.gwt.xml
new file mode 100644
index 0000000..6216202
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/SingleScriptLinkerTest.gwt.xml
@@ -0,0 +1,18 @@
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<module>
+ <inherits name='com.google.gwt.core.ext.LinkerTest' />
+ <add-linker name='sso' />
+</module>
diff --git a/user/test/com/google/gwt/core/ext/XSLinkerTest.gwt.xml b/user/test/com/google/gwt/core/ext/XSLinkerTest.gwt.xml
new file mode 100644
index 0000000..5490500
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/XSLinkerTest.gwt.xml
@@ -0,0 +1,18 @@
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<module>
+ <inherits name='com.google.gwt.core.ext.LinkerTest' />
+ <add-linker name='xs' />
+</module>
diff --git a/user/test/com/google/gwt/core/ext/test/IFrameLinkerTest.java b/user/test/com/google/gwt/core/ext/test/IFrameLinkerTest.java
new file mode 100644
index 0000000..d4b8f88
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/test/IFrameLinkerTest.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.core.ext.test;
+
+
+/**
+ * Tests the iframe-based linker.
+ */
+public class IFrameLinkerTest extends LinkerTest {
+ @Override
+ public String getModuleName() {
+ return "com.google.gwt.core.ext.IFrameLinkerTest";
+ }
+}
diff --git a/user/test/com/google/gwt/core/ext/test/LinkerTest.java b/user/test/com/google/gwt/core/ext/test/LinkerTest.java
new file mode 100644
index 0000000..0f08376
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/test/LinkerTest.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.core.ext.test;
+
+import com.google.gwt.junit.client.GWTTestCase;
+
+/**
+ * Tests that all the linkers work well enough to run the
+ * JUnit testing infrastructure.
+ */
+public abstract class LinkerTest extends GWTTestCase {
+ public void testSomethingTrivial() {
+ assertTrue(true);
+ }
+}
diff --git a/user/test/com/google/gwt/core/ext/test/SingleScriptLinkerTest.java b/user/test/com/google/gwt/core/ext/test/SingleScriptLinkerTest.java
new file mode 100644
index 0000000..4f9a3ac
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/test/SingleScriptLinkerTest.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.core.ext.test;
+
+
+/**
+ * Tests the single-script linker.
+ */
+public class SingleScriptLinkerTest extends LinkerTest {
+ @Override
+ public String getModuleName() {
+ return "com.google.gwt.core.ext.SingleScriptLinkerTest";
+ }
+}
diff --git a/user/test/com/google/gwt/core/ext/test/XSLinkerTest.java b/user/test/com/google/gwt/core/ext/test/XSLinkerTest.java
new file mode 100644
index 0000000..d9bf3ac
--- /dev/null
+++ b/user/test/com/google/gwt/core/ext/test/XSLinkerTest.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.core.ext.test;
+
+
+/**
+ * Tests the cross-site linker.
+ */
+public class XSLinkerTest extends LinkerTest {
+ @Override
+ public String getModuleName() {
+ return "com.google.gwt.core.ext.XSLinkerTest";
+ }
+}