Skip to content

Commit

Permalink
Merge pull request #98 from DenisKnoepfle/master
Browse files Browse the repository at this point in the history
Add plug-in fragment as test plug-in for the UI (#68)
  • Loading branch information
DenisKnoepfle committed Aug 11, 2014
2 parents 1000cac + fd2a3ca commit a1ab6ac
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public static void cleanUp() throws IOException {
if (tempDir.exists()) {
LpeFileUtils.removeDir(tempDir.getAbsolutePath());
}

shutdownServer();
}

@Before
Expand All @@ -92,16 +90,6 @@ private static void startServer() {
ServerLauncher.main(argsStartCustomized);
}

private static void shutdownServer() {
String[] argsShutdownCustomized = {"shutdown", "port=" + port };
ServerLauncher.main(argsShutdownCustomized);
try {
Thread.sleep(SHUTDOWN_WAIT_DELAY);
} catch (InterruptedException e) {
LOGGER.warn("interrupted sleep delay after shutdown!");
}
}

@Test
public void testSpotterServiceClient() {
ssc.updateUrl(host, "");
Expand Down Expand Up @@ -183,9 +171,10 @@ private static void createTempDir() throws IOException {

private static void initGlobalConfigs(String baseDir) {
Properties properties = new Properties();
properties.setProperty("org.lpe.common.extension.appRootDir", tempDir.getAbsolutePath());
properties.setProperty(ExtensionRegistry.APP_ROOT_DIR_PROPERTY_KEY, tempDir.getAbsolutePath());
properties.setProperty(ExtensionRegistry.PLUGINS_FOLDER_PROPERTY_KEY, "plugins");
properties.setProperty("org.spotter.conf.pluginDirNames", "plugins");
properties.setProperty(ConfigKeys.RESULT_DIR, baseDir + System.getProperty("file.separator"));
properties.setProperty(ConfigKeys.RESULT_DIR, baseDir + System.getProperty("file.separator") + "results");
properties.setProperty(ConfigKeys.EXPERIMENT_DURATION, "1");
properties.setProperty(ConfigKeys.EXPERIMENT_COOL_DOWN_INTERVAL_LENGTH, "1");
properties.setProperty(ConfigKeys.EXPERIMENT_COOL_DOWN_NUM_USERS_PER_INTERVAL, "1");
Expand Down
9 changes: 9 additions & 0 deletions org.spotter.eclipse.ui.test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/bin
/target
/.classpath
/.settings
/.project
.DS_Store
/.prefs
/src/META-INF/MANIFEST.MF
/lib
10 changes: 10 additions & 0 deletions org.spotter.eclipse.ui.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DynamicSpotter Eclipse UI Test
Bundle-SymbolicName: org.spotter.eclipse.ui.test
Bundle-Version: 0.0.1.qualifier
Bundle-Vendor: SAP AG
Fragment-Host: org.spotter.eclipse.ui;bundle-version="0.0.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .,
../org.spotter.eclipse.ui
19 changes: 19 additions & 0 deletions org.spotter.eclipse.ui.test/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright 2014 SAP AG
#
# 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.
#

source.. = src/
bin.includes = META-INF/,\
.
106 changes: 106 additions & 0 deletions org.spotter.eclipse.ui.test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.spotter</groupId>
<artifactId>org.spotter.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../org.spotter.parent</relativePath>
</parent>

<artifactId>org.spotter.eclipse.ui.test</artifactId>
<name>DynamicSpotter Eclipse UI Test</name>

<packaging>eclipse-test-plugin</packaging>

<properties>
<tycho-version>0.20.0</tycho-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>kepler</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/kepler</url>
</repository>
</repositories>


<build>
<plugins>
<plugin>
<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>
<configuration>
<pomDependencies>consider</pomDependencies>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</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>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<providerHint>junit4</providerHint>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>

</build>

<dependencies>
<dependency>
<groupId>org.spotter</groupId>
<artifactId>org.spotter.eclipse.ui</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package org.spotter.eclipse.ui;

import junit.framework.Assert;

import org.junit.Test;

public class ActivatorTest {

@Test
public void testActivator() {
Assert.assertEquals("org.spotter.eclipse.ui", Activator.PLUGIN_ID);
}

/*@Test
public void testStartBundleContext() {
fail("Not yet implemented");
}
@Test
public void testStopBundleContext() {
fail("Not yet implemented");
}*/

@Test
public void testGetDefault() {
Activator activator = Activator.getDefault();
Assert.assertNotNull(activator);
}

/*@Test
public void testGetClient() {
fail("Not yet implemented");
}
@Test
public void testTestServiceStatus() {
fail("Not yet implemented");
}
@Test
public void testGetNavigatorViewer() {
fail("Not yet implemented");
}
@Test
public void testSetNavigatorViewer() {
fail("Not yet implemented");
}
@Test
public void testGetProjectHistoryElements() {
fail("Not yet implemented");
}
@Test
public void testSetProjectHistoryElements() {
fail("Not yet implemented");
}
@Test
public void testGetSelectedProjects() {
fail("Not yet implemented");
}
@Test
public void testSetSelectedProjects() {
fail("Not yet implemented");
}
@Test
public void testGetImage() {
fail("Not yet implemented");
}*/

}
3 changes: 2 additions & 1 deletion org.spotter.eclipse.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.105.0",
org.eclipse.ui.ide;bundle-version="3.9.1",
org.eclipse.core.runtime;bundle-version="3.9.0",
org.eclipse.ui.navigator;bundle-version="3.5.300",
org.eclipse.ui.navigator.resources;bundle-version="3.4.500"
org.eclipse.ui.navigator.resources;bundle-version="3.4.500",
org.eclipse.equinox.ds;bundle-version="1.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class ExtensionMetaobject {
* The project the extension is associated with
* @param extensionName
* The name of the extension
* @param configParams
* The parameters of the extension
*/
public ExtensionMetaobject(String projectName, String extensionName) {
this.projectName = projectName;
Expand Down
1 change: 1 addition & 0 deletions org.spotter.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<module>../org.spotter.service</module>
<module>../org.spotter.client</module>
<module>../org.spotter.eclipse.ui</module>
<!-- <module>../org.spotter.eclipse.ui.test</module> -->


</modules>
Expand Down

0 comments on commit a1ab6ac

Please sign in to comment.