Skip to content

FileBufferFunctions.testGetFileStoreAnnotationModel fails when ran from Eclipse #3828

@trancexpress

Description

@trancexpress

Run e.g. org.eclipse.core.filebuffers.tests.FileBuffersForFilesInLinkedFolders, observe:

org.opentest4j.AssertionFailedError: expected: not <null>
	at org.eclipse.core.filebuffers.tests.FileBufferFunctions.testGetFileStoreAnnotationModel(FileBufferFunctions.java:1297)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
	at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:108)
	at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

There is this code:

	@Override
	protected Class<IAnnotationModel> getAnnotationModelClass() throws Exception {
		Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
		return bundle != null ? IAnnotationModel.class : null;
	}

In several of the extending test cases:

tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java:                Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java:         Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java:              Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java:             Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");

But the bundle org.eclipse.ui.editor is not in the MANIFEST.MF. Adding it there does make the test pass.

Considering the following, no idea how to fix such problems:

Likely related to: eclipse-pde/eclipse.pde#1999, eclipse-pde/eclipse.pde#2082

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions