Skip to content

Commit

Permalink
Create test case for EE baseline warnings due to missing Manifest header
Browse files Browse the repository at this point in the history
This checks whether no error is produced when both the
Require-Capability and the Bundle-RequiredExecutionEvironment headers
are missing from the manifest.

See eclipse-pde#1386
  • Loading branch information
ptziegler committed Sep 4, 2024
1 parent 6506ee6 commit 768e47f
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ public void testExecutionEnvironment() throws CoreException {
new String[] { "JavaSE-17" }, bundleB.getApiComponent().getExecutionEnvironments()); //$NON-NLS-1$
}

/**
* Tests whether missing execution environments in the manifest are detected
* correctly.
*/
public void testNoExecutionEnvironment() throws CoreException {
IApiTypeContainer bundleC = getTypeContainer("bundle.c"); //$NON-NLS-1$
assertArrayEquals("Expected no EE because none is specified in the Manifest", //$NON-NLS-1$
new String[] {}, bundleC.getApiComponent().getExecutionEnvironments());
}

/**
* Tests all packages are returned.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>bundle.b</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: API Tools Tests Plug-in C
Bundle-SymbolicName: bundle.c
Bundle-Version: 1.0.0
Export-Package: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package test;
public class Stub {}

0 comments on commit 768e47f

Please sign in to comment.