Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2012-04-02 16:11:28 -0400
committerAlexander Kurtakov2012-04-02 16:11:28 -0400
commita1511453cd84e12260a03e07aa8dc21a78795a47 (patch)
treed52ddf39db5cb9c7de54644e7daf6485bafd29ca /changelog
parent73da04c3b47154e184e5889fc5ec07183c016377 (diff)
downloadorg.eclipse.linuxtools-a1511453cd84e12260a03e07aa8dc21a78795a47.tar.gz
org.eclipse.linuxtools-a1511453cd84e12260a03e07aa8dc21a78795a47.tar.xz
org.eclipse.linuxtools-a1511453cd84e12260a03e07aa8dc21a78795a47.zip
Make Changelog's tests fragment.
This allows to not export Changelog internal API because of the tests. Few small modifications in the tests were needed in order to not use parsers fragments directly but through the exension point.
Diffstat (limited to 'changelog')
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/META-INF/MANIFEST.MF7
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.cparser/META-INF/MANIFEST.MF1
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.javaparser/META-INF/MANIFEST.MF2
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/META-INF/MANIFEST.MF27
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/pom.xml12
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/CParserTest.java19
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/JavaParserTest.java23
7 files changed, 40 insertions, 51 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/META-INF/MANIFEST.MF b/changelog/org.eclipse.linuxtools.changelog.core/META-INF/MANIFEST.MF
index adad078a6f..aeda8c4571 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/META-INF/MANIFEST.MF
+++ b/changelog/org.eclipse.linuxtools.changelog.core/META-INF/MANIFEST.MF
@@ -18,12 +18,7 @@ Require-Bundle: org.eclipse.team.ui,
org.eclipse.compare,
org.eclipse.core.resources,
org.eclipse.core.filesystem
-Export-Package: org.eclipse.linuxtools.changelog.core,
- org.eclipse.linuxtools.internal.changelog.core;x-internal:=true,
- org.eclipse.linuxtools.internal.changelog.core.actions;x-internal:=true,
- org.eclipse.linuxtools.internal.changelog.core.editors;x-internal:=true,
- org.eclipse.linuxtools.internal.changelog.core.formatters;x-internal:=true,
- org.eclipse.linuxtools.internal.changelog.core.ui;x-internal:=true
+Export-Package: org.eclipse.linuxtools.changelog.core
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Eclipse-ExtensibleAPI: true
diff --git a/changelog/org.eclipse.linuxtools.changelog.cparser/META-INF/MANIFEST.MF b/changelog/org.eclipse.linuxtools.changelog.cparser/META-INF/MANIFEST.MF
index adca0a98d0..f0b1221ef1 100644
--- a/changelog/org.eclipse.linuxtools.changelog.cparser/META-INF/MANIFEST.MF
+++ b/changelog/org.eclipse.linuxtools.changelog.cparser/META-INF/MANIFEST.MF
@@ -9,4 +9,3 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="5.2.0",
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Fragment-Host: org.eclipse.linuxtools.changelog.core;bundle-version="2.6.3"
Import-Package: org.eclipse.core.resources
-Export-Package: org.eclipse.linuxtools.internal.changelog.parsers;x-friends:="org.eclipse.linuxtools.changelog.tests"
diff --git a/changelog/org.eclipse.linuxtools.changelog.javaparser/META-INF/MANIFEST.MF b/changelog/org.eclipse.linuxtools.changelog.javaparser/META-INF/MANIFEST.MF
index 048ea69e72..8f7514d5d1 100644
--- a/changelog/org.eclipse.linuxtools.changelog.javaparser/META-INF/MANIFEST.MF
+++ b/changelog/org.eclipse.linuxtools.changelog.javaparser/META-INF/MANIFEST.MF
@@ -8,4 +8,4 @@ Require-Bundle: org.eclipse.jdt.core;bundle-version="3.3.0",
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Fragment-Host: org.eclipse.linuxtools.changelog.core;bundle-version="2.6.3"
-Export-Package: org.eclipse.linuxtools.internal.changelog.parsers.java;x-friends:="org.eclipse.linuxtools.changelog.tests"
+
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/META-INF/MANIFEST.MF b/changelog/org.eclipse.linuxtools.changelog.tests/META-INF/MANIFEST.MF
index d0cb1ae59c..7e661c7388 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/META-INF/MANIFEST.MF
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/META-INF/MANIFEST.MF
@@ -4,36 +4,17 @@ Bundle-Name: Eclipse Linuxtools Changelog Tests
Bundle-SymbolicName: org.eclipse.linuxtools.changelog.tests
Bundle-Version: 2.7.0.qualifier
Bundle-Vendor: Eclipse.org
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
+Require-Bundle:
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
org.junit4;bundle-version="4.8.1"
+Fragment-Host: org.eclipse.linuxtools.changelog.core
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.cdt.core,
org.eclipse.cdt.core.model,
- org.eclipse.cdt.core.settings.model,
- org.eclipse.cdt.core.templateengine,
- org.eclipse.cdt.core.templateengine.process,
- org.eclipse.cdt.managedbuilder.core,
- org.eclipse.cdt.managedbuilder.templateengine,
- org.eclipse.compare,
- org.eclipse.compare.structuremergeviewer,
- org.eclipse.core.resources,
org.eclipse.jdt.core,
- org.eclipse.jdt.launching,
- org.eclipse.jface.text,
org.eclipse.linuxtools.changelog.core,
- org.eclipse.linuxtools.internal.changelog.core,
- org.eclipse.linuxtools.internal.changelog.core.actions,
- org.eclipse.linuxtools.internal.changelog.core.editors,
- org.eclipse.linuxtools.internal.changelog.core.formatters,
- org.eclipse.linuxtools.internal.changelog.core.ui,
- org.eclipse.linuxtools.internal.changelog.parsers,
- org.eclipse.linuxtools.internal.changelog.parsers.java,
- org.eclipse.team.ui.synchronize,
- org.eclipse.ui,
- org.eclipse.ui.editors.text,
org.eclipse.ui.ide,
- org.eclipse.ui.part,
org.eclipse.ui.texteditor
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/pom.xml b/changelog/org.eclipse.linuxtools.changelog.tests/pom.xml
index e5b049c833..6d03e02310 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/pom.xml
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/pom.xml
@@ -39,6 +39,18 @@
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<product>org.eclipse.sdk.ide</product>
+ <dependencies>
+ <dependency>
+ <artifactId>org.eclipse.linuxtools.changelog.parsers.java</artifactId>
+ <version>0.0.0</version>
+ <type>p2-installable-unit</type>
+ </dependency>
+ <dependency>
+ <artifactId>org.eclipse.linuxtools.changelog.cparser</artifactId>
+ <version>0.0.0</version>
+ <type>p2-installable-unit</type>
+ </dependency>
+ </dependencies>
</configuration>
</plugin>
</plugins>
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/CParserTest.java b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/CParserTest.java
index b25db583a6..a94897c82f 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/CParserTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/CParserTest.java
@@ -7,33 +7,34 @@
*******************************************************************************/
package org.eclipse.linuxtools.changelog.parsers.tests;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.closeEditor;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.getContent;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.openEditor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.openEditor;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.closeEditor;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.getContent;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
+import org.eclipse.linuxtools.changelog.core.IParserChangeLogContrib;
import org.eclipse.linuxtools.changelog.tests.fixtures.CStringStorage;
import org.eclipse.linuxtools.changelog.tests.fixtures.CStringStorageInput;
import org.eclipse.linuxtools.changelog.tests.fixtures.ChangeLogTestProject;
-import org.eclipse.linuxtools.internal.changelog.parsers.CParser;
+import org.eclipse.linuxtools.internal.changelog.core.ChangeLogExtensionManager;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
/**
* CParser test suite.
@@ -44,7 +45,7 @@ public class CParserTest {
// A unique string to mark the place of current selection in source code
private static final String OFFSET_MARKER = "<# selection #>";
// The parser under test
- private CParser cParser;
+ private IParserChangeLogContrib cParser;
// A faked project
private ChangeLogTestProject project;
// The IEditorPart corresponding to the ChangeLog file
@@ -52,7 +53,7 @@ public class CParserTest {
@Before
public void setUp() throws Exception {
- cParser = new CParser();
+ cParser = ChangeLogExtensionManager.getExtensionManager().getParserContributor("CEditor");
project = new ChangeLogTestProject("c-parser-test-project");
}
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/JavaParserTest.java b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/JavaParserTest.java
index ef9a1510a8..f2666aaf0f 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/JavaParserTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/parsers/tests/JavaParserTest.java
@@ -7,30 +7,31 @@
*******************************************************************************/
package org.eclipse.linuxtools.changelog.parsers.tests;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.closeEditor;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.getContent;
+import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.openEditor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.openEditor;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.closeEditor;
-import static org.eclipse.linuxtools.changelog.tests.helpers.EditorHelper.getContent;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
+import org.eclipse.linuxtools.changelog.core.IParserChangeLogContrib;
import org.eclipse.linuxtools.changelog.tests.fixtures.ChangeLogTestProject;
-import org.eclipse.linuxtools.internal.changelog.parsers.java.JavaParser;
+import org.eclipse.linuxtools.internal.changelog.core.ChangeLogExtensionManager;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
/**
* JavaParser test suite.
@@ -41,7 +42,7 @@ public class JavaParserTest {
// A unique string to mark the place of current selection in source code
private static final String OFFSET_MARKER = "<# selection #>";
// The parser under test
- private JavaParser javaParser;
+ private IParserChangeLogContrib javaParser;
// A faked project
private ChangeLogTestProject project;
// The IEditorPart corresponding to the ChangeLog file
@@ -49,7 +50,7 @@ public class JavaParserTest {
@Before
public void setUp() throws Exception {
- javaParser = new JavaParser();
+ javaParser = ChangeLogExtensionManager.getExtensionManager().getParserContributor("CompilationUnitEditor");;
project = new ChangeLogTestProject("java-parser-test-project");
// make it a Java project
project.addJavaNature();
@@ -223,7 +224,7 @@ public class JavaParserTest {
final String actualFunctionName = javaParser.parseCurrentFunction(javaSourceEditorPart);
- assertEquals(JavaParser.STATIC_INITIALIZER_NAME, actualFunctionName);
+ assertEquals("static initializer", actualFunctionName);
}
/**
@@ -277,7 +278,7 @@ public class JavaParserTest {
final String actualFunctionName = javaParser.parseCurrentFunction(javaSourceEditorPart);
- assertEquals(JavaParser.STATIC_INITIALIZER_NAME, actualFunctionName);
+ assertEquals("static initializer", actualFunctionName);
}
/**

Back to the top