Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg2010-05-02 08:46:47 +0000
committerRobin Rosenberg2010-05-02 08:46:47 +0000
commit55a334b3018ed0db1335c8857e13153cb2f46361 (patch)
treef59dfff9de1712737c0395650fd39541e0bb11da /org.eclipse.egit.core.test
parentdc9549b6d29825839d1e94da612a414e1423aaa7 (diff)
downloadegit-55a334b3018ed0db1335c8857e13153cb2f46361.tar.gz
egit-55a334b3018ed0db1335c8857e13153cb2f46361.tar.xz
egit-55a334b3018ed0db1335c8857e13153cb2f46361.zip
Make the org.eclipse.core.test bundle a fragment bundle
A fragment bundle allows us direct access to internal packages of the host bundle that we are testing without the hazzle with export/import. Since we cannot have an activator for a fragment we now set up the MockSystemReader in the GitTestCase that our tests derive from anyway. Change-Id: I6a1ded23d0a3063ae03ef6b8683c04b8dbe0d84e Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.egit.core.test')
-rw-r--r--org.eclipse.egit.core.test/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java62
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java7
3 files changed, 5 insertions, 66 deletions
diff --git a/org.eclipse.egit.core.test/META-INF/MANIFEST.MF b/org.eclipse.egit.core.test/META-INF/MANIFEST.MF
index 270e9c9e2..66af0dce1 100644
--- a/org.eclipse.egit.core.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.core.test/META-INF/MANIFEST.MF
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: Git Team Provider Core Test Plug-in (Incubation)
Bundle-Vendor: Eclipse.org
Bundle-SymbolicName: org.eclipse.egit.core.test
+Fragment-Host: org.eclipse.egit.core
Bundle-Version: 0.8.0.qualifier
-Bundle-Activator: org.eclipse.egit.core.test.Activator
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java
deleted file mode 100644
index 99e6b52b4..000000000
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/Activator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.egit.core.test;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jgit.junit.MockSystemReader;
-import org.eclipse.jgit.util.SystemReader;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.egit.core.test";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- // Empty
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- SystemReader.setInstance(new MockSystemReader());
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
index d53b35fcd..58faa4756 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
@@ -26,9 +26,10 @@ public abstract class GitTestCase {
@Before
public void setUp() throws Exception {
- ((MockSystemReader) SystemReader.getInstance()).setProperty(
- Constants.GIT_CEILING_DIRECTORIES_KEY, ResourcesPlugin
- .getWorkspace().getRoot().getLocation().toFile()
+ MockSystemReader mockSystemReader = new MockSystemReader();
+ SystemReader.setInstance(mockSystemReader);
+ mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,
+ ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile()
.getAbsoluteFile().toString());
project = new TestProject(true);
gitDir = new File(project.getProject().getWorkspace().getRoot()

Back to the top