From 326ccadd49971a36bcf4c356f114eba70a4e337f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Dahlstr=C3=B6m?= Date: Mon, 16 Jan 2012 07:01:28 +0000 Subject: [PATCH] Merged #8105 Compile core files and test files to separate folders svn changeset:22636/svn branch:6.8 --- build/build.properties | 2 +- build/build.xml | 207 +++++++++--------- .../com/vaadin/tests/VaadinClasses.java | 9 +- .../vaadin/launcher/util/BrowserLauncher.java | 0 .../com/vaadin/tests/Components.java | 17 +- 5 files changed, 122 insertions(+), 113 deletions(-) rename tests/{testbench => server-side}/com/vaadin/tests/VaadinClasses.java (96%) rename {src => tests/testbench}/com/vaadin/launcher/util/BrowserLauncher.java (100%) diff --git a/build/build.properties b/build/build.properties index 82378c6dac..9e126a4479 100644 --- a/build/build.properties +++ b/build/build.properties @@ -2,7 +2,7 @@ result-path=build/result checkout-path=build/checkout product-file=vaadin product-name=Vaadin -toolkit-package=com/vaadin +vaadin-package=com/vaadin gwt-dir=lib/core/gwt # repository into which Maven snapshots should be published diff --git a/build/build.xml b/build/build.xml index 8c3ee1d04a..1fdcc0ee25 100644 --- a/build/build.xml +++ b/build/build.xml @@ -43,14 +43,32 @@ uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> + - - + + + + + + + + + + + + + + + + + + + @@ -86,7 +104,7 @@ - + @@ -95,9 +113,6 @@ - - - @@ -109,17 +124,16 @@ Full Version: ${version.full} - - Vaadin package is: ${toolkit-package} + Vaadin package is: ${vaadin-package} - - + + We are using gwt version ${gwt-version}. @@ -185,13 +199,17 @@ Adding test class files and resources and launcher configuration. - - - + + + + + + + - + @@ -201,8 +219,8 @@ - - + + @@ -258,11 +276,11 @@ - + - - - - + + + + @@ -316,7 +339,7 @@ Copying src directory and processing copied files. Replacing <version> tag with build version for java/html/css/xml files. - + @@ -324,13 +347,13 @@ - + - + @@ -346,17 +369,17 @@ Copying non java/html/css/xml files such as images. - + - + - + @@ -383,12 +406,11 @@ - Adding VAADIN/themes, demo and hsqldb.jar files. + Adding VAADIN/themes and META-INF - @@ -431,20 +453,37 @@ - + Compiling src (server-side) - - - - - - - + + + + + + + + + Compiling src (Server and client side JUnit tests) + + + + + + + + Compiling src (TestBench tests) + + + + + + + - + @@ -488,7 +527,7 @@ - + @@ -496,8 +535,8 @@ - - + + @@ -551,12 +590,7 @@ - - - - - - + @@ -588,18 +622,14 @@ ${gwt-version} - - - - - @@ -617,24 +647,10 @@ - - - - - - - - - - - - + + - - - - - + @@ -665,7 +681,7 @@ - + @@ -692,9 +708,7 @@ - - - + ${javadoc.doctitle} ${javadoc.bottom} @@ -784,7 +798,7 @@ - + @@ -793,8 +807,6 @@ - - Base version: ${version} Build number: ${build.number} Build tag: ${build.tag} @@ -924,7 +936,7 @@ - + @@ -944,7 +956,7 @@ - + @@ -957,38 +969,35 @@ - + - + merge="false" + > - - - - - + - - + + + - + - + @@ -1040,7 +1049,7 @@ - + diff --git a/tests/testbench/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java similarity index 96% rename from tests/testbench/com/vaadin/tests/VaadinClasses.java rename to tests/server-side/com/vaadin/tests/VaadinClasses.java index 0f4e2ff4da..e02c4f0b6e 100644 --- a/tests/testbench/com/vaadin/tests/VaadinClasses.java +++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java @@ -18,7 +18,6 @@ import java.util.jar.JarEntry; import org.junit.Test; import com.vaadin.Application; -import com.vaadin.tests.components.AbstractComponentTest; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CustomComponent; @@ -103,11 +102,13 @@ public class VaadinClasses { } @SuppressWarnings({ "unchecked", "rawtypes" }) - public static List>> getBasicComponentTests() { + public static List> getBasicComponentTests() { try { - return (List) findClasses(AbstractComponentTest.class, + // Given as name to avoid dependencies on testbench source folder + return (List) findClasses( + Class.forName("com.vaadin.tests.components.AbstractComponentTest"), "com.vaadin.tests.components"); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); return null; } diff --git a/src/com/vaadin/launcher/util/BrowserLauncher.java b/tests/testbench/com/vaadin/launcher/util/BrowserLauncher.java similarity index 100% rename from src/com/vaadin/launcher/util/BrowserLauncher.java rename to tests/testbench/com/vaadin/launcher/util/BrowserLauncher.java diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java index 6987c04a54..d7bc18e2f6 100644 --- a/tests/testbench/com/vaadin/tests/Components.java +++ b/tests/testbench/com/vaadin/tests/Components.java @@ -32,7 +32,7 @@ import com.vaadin.ui.Window; public class Components extends Application { private static final Object CAPTION = "c"; - private Map>, String> tests = new HashMap>, String>(); + private Map, String> tests = new HashMap, String>(); private Tree naviTree; private HorizontalSplitPanel sp; private Window mainWindow; @@ -41,10 +41,9 @@ public class Components extends Application { private List> componentsWithoutTests = new ArrayList>(); { - for (Class> c : VaadinClasses - .getBasicComponentTests()) { + for (Class c : VaadinClasses.getBasicComponentTests()) { String testClass = c.getSimpleName(); - tests.put(c, testClass); + tests.put((Class) c, testClass); } List> componentsWithoutTest = VaadinClasses @@ -171,7 +170,7 @@ public class Components extends Application { hc.setItemSorter(sorter); naviTree.addContainerProperty(CAPTION, String.class, ""); naviTree.setItemCaptionPropertyId(CAPTION); - for (Class> cls : tests.keySet()) { + for (Class cls : tests.keySet()) { addTreeItem(cls); } hc.sort(new Object[] { CAPTION }, new boolean[] { true }); @@ -226,13 +225,13 @@ public class Components extends Application { } @SuppressWarnings("unchecked") - private void addTreeItem(Class> cls) { + private void addTreeItem(Class cls) { String name = tests.get(cls); if (name == null) { name = cls.getSimpleName(); } - Class> superClass = (Class>) cls + Class superClass = (Class) cls .getSuperclass(); // This cast is needed only to make compilation through Ant work .. @@ -249,9 +248,9 @@ public class Components extends Application { } protected Component createTestComponent( - Class> cls) { + Class cls) { try { - AbstractComponentTest t = cls.newInstance(); + AbstractComponentTest t = cls.newInstance(); t.init(); ComponentContainer c = t.getMainWindow().getContent(); t.getMainWindow().setContent(null); -- 2.39.5