Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit of changes.

  • Loading branch information...
commit 6d7bc7274b2f6616957e71ac0b89308eb25fc29f 1 parent 424985c
@aeisenberg aeisenberg authored
View
7 com.springsource.sts.jointgrailstests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
2  com.springsource.sts.jointgrailstests/.gitignore
@@ -0,0 +1,2 @@
+target
+bin
View
28 com.springsource.sts.jointgrailstests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.springsource.sts.jointgrailstests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
7 com.springsource.sts.jointgrailstests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
View
19 com.springsource.sts.jointgrailstests/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: STS Grails Joint tests
+Bundle-SymbolicName: com.springsource.sts.jointgrailstests
+Bundle-Version: 3.0.0.qualifier
+Bundle-Activator: com.springsource.sts.jointgrailstests.JointTestsActivator
+Bundle-Vendor: SpringSoyrce
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit4;bundle-version="4.8.1",
+ com.springsource.sts.grails.test;bundle-version="2.9.0",
+ com.springsource.sts.grails.core;bundle-version="2.9.0",
+ com.springsource.sts.grails.test.util;bundle-version="2.9.0",
+ org.eclipse.swt;bundle-version="3.7.2",
+ javax.servlet,
+ javax.servlet.jsp,
+ com.springsource.sts.tests.util;bundle-version="3.0.0",
+ org.eclipse.jdt.groovy.core.tests.builder;bundle-version="3.3.100"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
View
4 com.springsource.sts.jointgrailstests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
146 com.springsource.sts.jointgrailstests/pom.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.springsource.sts</groupId>
+ <artifactId>com.springsource.sts.jointgrailstests</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+ <properties>
+ <tycho-version>0.14.1</tycho-version>
+ </properties>
+ <repositories>
+ <repository>
+ <id>groovy</id>
+ <layout>p2</layout>
+ <url>http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/</url>
+ </repository>
+ <repository>
+ <id>sts</id>
+ <layout>p2</layout>
+ <url>http://dist.springsource.com/snapshot/TOOLS/nightly/e3.7</url>
+ </repository>
+ <repository>
+ <id>sts-test</id>
+ <layout>p2</layout>
+ <url>http://dist.springsource.com/snapshot/STS-TEST/nightly/e3.7</url>
+ </repository>
+ <repository>
+ <id>ajdt</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/tools/ajdt/37/dev/update/</url>
+ </repository>
+ <repository>
+ <id>spring-ide</id>
+ <layout>p2</layout>
+ <url>http://dist.springframework.org/snapshot/IDE/nightly/</url>
+ </repository>
+ <repository>
+ <id>indigo</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/releases/indigo</url>
+ </repository>
+ <repository>
+ <id>mylyn</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/mylyn/snapshots/3.6/</url>
+ </repository>
+ <repository>
+ <id>swt-bot</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site</url>
+ </repository>
+ </repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- enable tycho build extension -->
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <!-- configure the p2 target environments for multi-platform build -->
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ <!-- enable source bundle generation -->
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>plugin-source</id>
+ <goals>
+ <goal>plugin-source</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <application>org.eclipse.ui.ide.workbench</application>
+ <!-- <product>com.springsource.sts.ide</product> -->
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ <failIfNoTests>true</failIfNoTests>
+ <showEclipseLog>true</showEclipseLog>
+ <!-- The XstartOnFirstThread may not be applicable for builds that are not macosx
+ see http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00467.html
+ -->
+ <argLine>
+ -Xmx1024m -XX:MaxPermSize=256m -XstartOnFirstThread
+ </argLine>
+ <skip>false</skip>
+ <skipTests>false</skipTests>
+ <testSuite>com.springsource.sts.jointgrailstests</testSuite>
+ <testClass>com.springsource.sts.jointgrailstests.JointGrailsTests</testClass>
+ <explodedBundles>
+ <explodedBundle>org.junit</explodedBundle>
+ <explodedBundle>com.springsource.sts.grails.test</explodedBundle>
+ <explodedBundle>com.springsource.sts.bestpractices.tests</explodedBundle>
+ <explodedBundle>com.springsource.sts.grails.test.util</explodedBundle>
+ <explodedBundle>com.springsource.sts.grails.resources</explodedBundle>
+ <explodedBundle>com.springsource.sts.server.quickfix.tests</explodedBundle>
+ <explodedBundle>com.springsource.sts.server.tc.tests</explodedBundle>
+ <explodedBundle>com.cloudfoundry.sts.server.tests</explodedBundle>
+ <explodedBundle>org.codehaus.groovy</explodedBundle>
+ <explodedBundle>org.codehaus.groovy.eclipse.tests</explodedBundle>
+ <explodedBundle>org.codehaus.groovy.eclipse.core.test</explodedBundle>
+ <explodedBundle>org.eclipse.jdt.groovy.core.tests.builder</explodedBundle>
+ </explodedBundles>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
52 ...urce.sts.jointgrailstests/src/com/springsource/sts/jointgrailstests/JointGrailsTests.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2011 SpringSource, a division of VMware, Inc
+ *
+ * andrew - Initial API and implementation
+ *
+ * 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.springsource.sts.jointgrailstests;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import com.springsource.sts.grails.commands.test.GrailsCommandTest;
+import com.springsource.sts.grails.commands.test.JointGrailsCommandTest;
+import com.springsource.sts.grails.test.inferencing.DSLDGrailsInferencingTests;
+import com.springsource.sts.grails.test.inferencing.GrailsInferencingTests;
+import com.springsource.sts.grails.test.util.GrailsTestUtilActivator;
+
+
+/**
+ * A test suite for testing the lastest snapshot of STS with the latest grails snapshot
+ * @author Andrew Eisenberg
+ * @since 3.0.0
+ */
+public class JointGrailsTests {
+ public static Test suite() {
+ // ensure the plugin is started and configured
+ GrailsTestUtilActivator.configureGrailsVersions();
+ // create the new test suite
+ TestSuite suite = new TestSuite("Grails-STS joint tests");
+ suite.addTestSuite(PreHearbeatSanityTests.class);
+// suite.addTest(AllGrailsTests.suite(true));
+ suite.addTestSuite(GrailsCommandTest.class);
+ suite.addTestSuite(JointGrailsCommandTest.class);
+ suite.addTestSuite(GrailsInferencingTests.class);
+ suite.addTestSuite(DSLDGrailsInferencingTests.class);
+ suite.addTestSuite(PostHearbeatSanityTests.class);
+ // now run the tests
+ return suite;
+ }
+}
View
30 ...e.sts.jointgrailstests/src/com/springsource/sts/jointgrailstests/JointTestsActivator.java
@@ -0,0 +1,30 @@
+package com.springsource.sts.jointgrailstests;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class JointTestsActivator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ JointTestsActivator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ JointTestsActivator.context = null;
+ }
+
+}
View
33 ...s.jointgrailstests/src/com/springsource/sts/jointgrailstests/PostHearbeatSanityTests.java
@@ -0,0 +1,33 @@
+/******************************************************************************************
+ * Copyright (c) 2012 SpringSource, a division of VMware, Inc. All rights reserved.
+ ******************************************************************************************/
+package com.springsource.sts.jointgrailstests;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * All the prehearbeat tests as well as another test to
+ * ensure that the grails version has been installed
+ * @author Andrew Eisenberg
+ * @since 2.9.1
+ */
+public class PostHearbeatSanityTests extends PreHearbeatSanityTests {
+ public void testIsValidInstall() throws Exception {
+ File file = new File(BUILDSNAPHOT_VERSION.getInstall().getHome());
+ checkExists(file, true);
+ checkExists(new File(file, "lib"), true);
+ checkExists(new File(file, "dist"), true);
+ checkExists(new File(file, "bin"), true);
+ checkExists(new File(file, "bin/grails"), false);
+ }
+ private void checkExists(File file, boolean isDirectory) throws IOException {
+ assertTrue(file.getCanonicalPath() + " should exist", file.exists());
+ if (isDirectory) {
+ assertTrue(file.getCanonicalPath() + " should be a directory", file.isDirectory());
+ } else {
+ assertFalse(file.getCanonicalPath() + " should not be a directory", file.isDirectory());
+ }
+ }
+
+}
View
60 ...ts.jointgrailstests/src/com/springsource/sts/jointgrailstests/PreHearbeatSanityTests.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011 SpringSource, a division of VMware, Inc
+ *
+ * andrew - Initial API and implementation
+ *
+ * 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.springsource.sts.jointgrailstests;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import com.springsource.sts.grails.core.model.GrailsVersion;
+import com.springsource.tests.util.DownloadManager;
+
+/**
+ * Run a test that ensures the most recent grails version is the build snapshot
+ *
+ * @author Andrew Eisenberg
+ * @since 2.9.1
+ */
+public class PreHearbeatSanityTests extends TestCase {
+ private static final String BUILD_VERSION_STRING = "2.0.3";
+ private static final String BUILD_VERSION_ZIP_NAME = "grails-" + BUILD_VERSION_STRING + ".zip";
+ private static final String GRAILS_URL = "http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/" + BUILD_VERSION_ZIP_NAME;
+ public static final GrailsVersion BUILDSNAPHOT_VERSION = new GrailsVersion(BUILD_VERSION_STRING, GRAILS_URL);
+ private static boolean DOWNLOADED = false;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ if (!DOWNLOADED) {
+ DOWNLOADED = true;
+ // delete the old
+ File cacheDir = DownloadManager.getDefault().getCacheDir();
+ File oldZip = new File(cacheDir, BUILD_VERSION_ZIP_NAME);
+ System.out.println("Deleting old grails snapshot at " + oldZip);
+ oldZip.delete();
+ // get new snapshot and force it to be the most recent
+ System.out.println("Setting new grails version to be from " + GRAILS_URL);
+ // GrailsTest.ensureDefaultGrailsVersion(BUILDSNAPHOT_VERSION);
+ GrailsVersion.MOST_RECENT = BUILDSNAPHOT_VERSION;
+ }
+ }
+
+ public void testIsLatestGrails() {
+ assertEquals(BUILDSNAPHOT_VERSION, GrailsVersion.MOST_RECENT);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.