Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

5 changes: 2 additions & 3 deletions ds/org.eclipse.pde.ds.annotations.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ Require-Bundle: org.eclipse.pde.ds.annotations;bundle-version="[1.1.0,1.5.0)",
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.text;bundle-version="[3.6.0,4.0.0)"
Export-Package: org.eclipse.pde.ds.internal.annotations.tests;x-internal:=true
Import-Package: org.junit,
org.junit.runner,
org.junit.runners
Import-Package: org.junit.jupiter.api;version="[5.14.0,6.0.0)",
org.junit.platform.suite.api;version="[1.14.0,2.0.0)"
Eclipse-BundleShape: dir
Bundle-ClassPath: tests.jar
Automatic-Module-Name: org.eclipse.pde.ds.annotations.tests
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
import org.osgi.framework.Bundle;

@RunWith(Suite.class)
@SuiteClasses({
@Suite
@SelectClasses({
ManagedProjectTest.class,
UnmanagedProjectTest.class,
ErrorProjectTest.class,
Expand All @@ -48,7 +47,7 @@ public class AllDSAnnotationsTests {

static Job wsJob;

@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
final IWorkspace ws = ResourcesPlugin.getWorkspace();
final Bundle bundle = Activator.getContext().getBundle();
Expand Down Expand Up @@ -84,7 +83,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
wsJob.schedule();
}

@AfterClass
@AfterAll
public static void tearDownAfterClass() throws Exception {
wsJob.cancel();
final IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Expand Down Expand Up @@ -34,7 +34,7 @@ public void setUp() throws Exception {
assumeTrue("Test project does not exist!", testProject.exists());

IFile dsFile = testProject.getFile(IPath.fromOSString(getComponentDescriptorPath()));
assertTrue("Missing component descriptor!", dsFile.exists());
assertTrue(dsFile.exists(),"Missing component descriptor!");

ByteArrayOutputStream buf = new ByteArrayOutputStream();
try (InputStream src = dsFile.getContents()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.concurrent.Executor;

Expand All @@ -12,7 +12,7 @@
import org.eclipse.pde.internal.ds.core.IDSProvide;
import org.eclipse.pde.internal.ds.core.IDSReference;
import org.eclipse.pde.internal.ds.core.IDSService;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class DefaultComponentTest extends AnnotationProcessorTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ErrorProjectTest extends CompilationParticipantTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class ExtendedLifeCycleMethodComponentTest extends AnnotationProcessorTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.util.concurrent.Executor;

import org.eclipse.pde.internal.ds.core.IDSReference;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class ExtendedReferenceMethodComponentTest extends AnnotationProcessorTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;

Expand All @@ -17,7 +17,7 @@
import org.eclipse.pde.internal.ds.core.IDSProvide;
import org.eclipse.pde.internal.ds.core.IDSReference;
import org.eclipse.pde.internal.ds.core.IDSService;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class FullComponentTest extends AnnotationProcessorTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;

Expand All @@ -17,7 +17,7 @@
import org.eclipse.pde.internal.ds.core.IDSProvide;
import org.eclipse.pde.internal.ds.core.IDSReference;
import org.eclipse.pde.internal.ds.core.IDSService;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class FullComponentTestV1_2 extends AnnotationProcessorTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Arrays;
import java.util.List;
Expand All @@ -17,7 +17,7 @@
import org.eclipse.pde.ds.internal.annotations.DSAnnotationCompilationParticipant;
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class ManagedProjectTest extends CompilationParticipantTest {
Expand All @@ -36,12 +36,12 @@ public void managedProject() throws Exception {
public void dsBuilderConfigured() throws Exception {
ICommand[] commands = testProject.getDescription().getBuildSpec();
boolean hasDSBuilder = Arrays.stream(commands).anyMatch(command -> "org.eclipse.pde.ds.core.builder".equals(command.getBuilderName()));
assertTrue("DS builder not configured!", hasDSBuilder);
assertTrue(hasDSBuilder, "DS builder not configured!");
}

@Test
public void folderOSGIInfCreated() throws Exception {
assertTrue("Folder OSGI-INF does not exist!", testProject.getFolder("OSGI-INF").exists());
assertTrue(testProject.getFolder("OSGI-INF").exists(), "Folder OSGI-INF does not exist!");
}

@Test
Expand All @@ -55,9 +55,12 @@ public void manifestHeaderServiceComponentAdded() throws Exception {
String[] entries = serviceComponentHeader.split("\\s*,\\s*");
List<String> entryList = Arrays.asList(entries);
assertEquals(5, entryList.size());
assertTrue("Missing Service-Component entry for DefaultComponent!", entryList.contains("OSGI-INF/ds.annotations.test1.DefaultComponent.xml"));
assertTrue("Missing Service-Component entry for FullComponentV1_2!", entryList.contains("OSGI-INF/test.fullComponent-v1_2.xml"));
assertTrue("Missing Service-Component entry for FullComponent!", entryList.contains("OSGI-INF/test.fullComponent.xml"));
assertTrue(entryList.contains("OSGI-INF/ds.annotations.test1.DefaultComponent.xml"),
"Missing Service-Component entry for DefaultComponent!");
assertTrue(entryList.contains("OSGI-INF/test.fullComponent-v1_2.xml"),
"Missing Service-Component entry for FullComponentV1_2!");
assertTrue(entryList.contains("OSGI-INF/test.fullComponent.xml"),
"Missing Service-Component entry for FullComponent!");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.eclipse.pde.ds.internal.annotations.tests;

import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assume.assumeTrue;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.pde.ds.internal.annotations.DSAnnotationCompilationParticipant;
import org.junit.Test;
import org.junit.jupiter.api.Test;

@SuppressWarnings("restriction")
public class UnmanagedProjectTest extends CompilationParticipantTest {
Expand Down
Loading