Skip to content

Commit

Permalink
Merge branch 'eclipse-platform:master' into team-alex-shawn-chelsy
Browse files Browse the repository at this point in the history
  • Loading branch information
axmanalad authored Nov 12, 2024
2 parents 2f5c7e0 + 0abe5a5 commit 3fe39fe
Show file tree
Hide file tree
Showing 12 changed files with 603 additions and 707 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ For a complete guide, see the [CONTRIBUTING](https://github.com/eclipse-platform
https://www.eclipse.org/setups/installer/?url=https://raw.githubusercontent.com/eclipse-platform/eclipse.platform/master/releng/org.eclipse.platform.setup/PlatformConfiguration.setup&show=true
"Click to open Eclipse-Installer Auto Launch or drag into your running installer")

## Documentation

For additional documentation, please refer to the [docs directory](./docs) and [The Official Eclipse FAQs](./docs/FAQ/The_Official_Eclipse_FAQs.md).


## Issue Tracking

This project uses Github to track ongoing development and issues. In case you have an issue, please read the information about Eclipse being a [community project](https://github.com/eclipse-platform#community) and bear in mind that this project is almost entirely developed by volunteers. So the contributors may not be able to look into every reported issue. You will also find the information about [how to find and report issues](https://github.com/eclipse-platform#reporting-issues) in repositories of the `eclipse-platform` organization there. Be sure to search for existing issues before you create another one.
Expand Down
12 changes: 5 additions & 7 deletions docs/FAQ/The_Official_Eclipse_FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Contents
* [2 Part II -- The Rich Client Platform](#Part-II----The-Rich-Client-Platform)
* [2.1 All about Plug-ins](#All-about-Plug-ins)
* [2.2 Runtime Facilities](#Runtime-Facilities)
* [2.3 Standard Widget Toolkit (SWT)](#Standard-Widget-Toolkit-.28SWT.29)
* [2.3 Standard Widget Toolkit (SWT)](#standard-widget-toolkit-swt)
* [2.4 JFace](#JFace)
* [2.5 Generic Workbench](#Generic-Workbench)
* [2.6 Perspectives and Views](#Perspectives-and-Views)
Expand All @@ -34,7 +34,7 @@ Contents
* [3.5.2 This is a DSL of your own](#This-is-a-DSL-of-your-own)
* [3.5.3 Legacy](#Legacy)
* [3.6 Java Development Tool API](#Java-Development-Tool-API)
* [4 Where to buy the original book](#Where-to-buy-the-original-book)
* [4 This content is based on](#This-content-is-based-on)

Part I -- The Eclipse Ecosystem
-------------------------------
Expand Down Expand Up @@ -602,12 +602,10 @@ Finally, the JDT is a useful set of plug-ins in its own right, but it has also b
* [FAQ How do I participate in a refactoring?](./FAQ_How_do_I_participate_in_a_refactoring.md "FAQ How do I participate in a refactoring?")
* [FAQ What is LTK?](./FAQ_What_is_LTK.md "FAQ What is LTK?")

Where to buy the original book
------------------------------

The initial contents for these FAQ pages has come from The Offical Eclipse 3.0 FAQs written by John Arthorne and Chris Laffra.
### Acknowledgement

Permission to publish the FAQ book contents here has been graciously offered by Addison-Wesley, publishers of the official Eclipse Series which wouldn't be possible without the great help from Greg Doench.
The initial contents for these FAQ pages has come from [The Offical Eclipse 3.0 FAQs](https://www.amazon.com/exec/obidos/ASIN/0321268385) written by John Arthorne and Chris Laffra.

The book can be purchased from [Amazon.com](http://www.amazon.com/exec/obidos/ASIN/0321268385)
Permission to publish the FAQ book contents here has been graciously offered by Addison-Wesley, publishers of the official Eclipse Series which wouldn't be possible without the great help from Greg Doench.

Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
package org.eclipse.core.tests.resources.content;

import static org.eclipse.core.tests.resources.ResourceTestPluginConstants.PI_RESOURCES_TESTS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.eclipse.core.internal.content.ContentDescription;
import org.eclipse.core.internal.content.ContentType;
import org.eclipse.core.internal.content.ContentTypeHandler;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.content.IContentDescription;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ContentDescriptionTest extends ContentTypeTest {
public class ContentDescriptionTest {
private static final String CT_VOID = PI_RESOURCES_TESTS + '.' + "void";
private static final QualifiedName ZOO_PROPERTY = new QualifiedName(PI_RESOURCES_TESTS, "zoo");
private static final QualifiedName BAR_PROPERTY = new QualifiedName(PI_RESOURCES_TESTS, "bar");
Expand All @@ -42,89 +42,69 @@ private ContentType getContentType() {
@Test
public void testAllProperties() {
ContentDescription description = new ContentDescription(IContentDescription.ALL, getContentType());
assertTrue("1.0", description.isRequested(FOO_PROPERTY));
assertNull("1.1", description.getProperty(FOO_PROPERTY));
assertTrue(description.isRequested(FOO_PROPERTY));
assertNull(description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1");
assertEquals("1.2", "value1", description.getProperty(FOO_PROPERTY));
assertEquals("value1", description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1b");
assertEquals("1.3", "value1b", description.getProperty(FOO_PROPERTY));
assertTrue("2.0", description.isRequested(BAR_PROPERTY));
assertEquals("value1b", description.getProperty(FOO_PROPERTY));
assertTrue(description.isRequested(BAR_PROPERTY));
description.setProperty(BAR_PROPERTY, "value2");
assertEquals("2.1", "value2", description.getProperty(BAR_PROPERTY));
assertEquals("value2", description.getProperty(BAR_PROPERTY));
description.setProperty(ZOO_PROPERTY, "value3");
assertEquals("2.2", "value3", description.getProperty(ZOO_PROPERTY));
assertEquals("value3", description.getProperty(ZOO_PROPERTY));
description.markImmutable();
try {
description.setProperty(FOO_PROPERTY, "value1c");
fail("3.0 - should have failed");
} catch (IllegalStateException e) {
// success - the object was marked as immutable
}
assertThrows(IllegalStateException.class, () -> description.setProperty(FOO_PROPERTY, "value1c"));
}

@Test
public void testOneProperty() {
ContentDescription description = new ContentDescription(new QualifiedName[] {FOO_PROPERTY}, getContentType());
assertTrue("1.0", description.isRequested(FOO_PROPERTY));
assertNull("1.1", description.getProperty(FOO_PROPERTY));
assertTrue(description.isRequested(FOO_PROPERTY));
assertNull(description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1");
assertEquals("1.2", "value1", description.getProperty(FOO_PROPERTY));
assertEquals("value1", description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1b");
assertEquals("1.3", "value1b", description.getProperty(FOO_PROPERTY));
assertEquals("value1b", description.getProperty(FOO_PROPERTY));
description.setProperty(BAR_PROPERTY, "value2");
assertFalse("2.0", description.isRequested(BAR_PROPERTY));
assertFalse(description.isRequested(BAR_PROPERTY));
description.setProperty(BAR_PROPERTY, "value2");
assertNull("2.1", description.getProperty(BAR_PROPERTY));
assertNull(description.getProperty(BAR_PROPERTY));
description.markImmutable();
try {
description.setProperty(FOO_PROPERTY, "value1c");
fail("3.0 - should have failed");
} catch (IllegalStateException e) {
// success - the object was marked as immutable
}
assertThrows(IllegalStateException.class, () -> description.setProperty(FOO_PROPERTY, "value1c"));
}

@Test
public void testZeroProperties() {
ContentDescription description = new ContentDescription(new QualifiedName[0], getContentType());
assertFalse("1.0", description.isRequested(FOO_PROPERTY));
assertNull("1.1", description.getProperty(FOO_PROPERTY));
assertFalse(description.isRequested(FOO_PROPERTY));
assertNull(description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1");
assertNull("1.2", description.getProperty(FOO_PROPERTY));
assertNull(description.getProperty(FOO_PROPERTY));
description.markImmutable();
try {
description.setProperty(FOO_PROPERTY, "value1b");
fail("2.0 - should have failed");
} catch (IllegalStateException e) {
// success - the object was marked as immutable
}
assertThrows(IllegalStateException.class, () -> description.setProperty(FOO_PROPERTY, "value1b"));
}

@Test
public void testMultipleProperties() {
ContentDescription description = new ContentDescription(new QualifiedName[] {FOO_PROPERTY, BAR_PROPERTY, ZOO_PROPERTY}, getContentType());
assertTrue("1.0", description.isRequested(FOO_PROPERTY));
assertNull("1.1", description.getProperty(FOO_PROPERTY));
assertTrue(description.isRequested(FOO_PROPERTY));
assertNull(description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1");
assertEquals("1.2", "value1", description.getProperty(FOO_PROPERTY));
assertEquals("value1", description.getProperty(FOO_PROPERTY));
description.setProperty(FOO_PROPERTY, "value1b");
assertEquals("1.3", "value1b", description.getProperty(FOO_PROPERTY));
assertEquals("value1b", description.getProperty(FOO_PROPERTY));
description.setProperty(BAR_PROPERTY, "value2");
assertTrue("2.0", description.isRequested(BAR_PROPERTY));
assertTrue(description.isRequested(BAR_PROPERTY));
description.setProperty(BAR_PROPERTY, "value2");
assertEquals("2.1", "value2", description.getProperty(BAR_PROPERTY));
assertTrue("2.2", description.isRequested(ZOO_PROPERTY));
assertEquals("value2", description.getProperty(BAR_PROPERTY));
assertTrue(description.isRequested(ZOO_PROPERTY));
description.setProperty(ZOO_PROPERTY, "value3");
assertEquals("2.3", "value3", description.getProperty(ZOO_PROPERTY));
assertFalse("3.0", description.isRequested(FRED_PROPERTY));
assertEquals("value3", description.getProperty(ZOO_PROPERTY));
assertFalse(description.isRequested(FRED_PROPERTY));
description.setProperty(FRED_PROPERTY, "value3");
assertNull("3.1", description.getProperty(FRED_PROPERTY));
assertNull(description.getProperty(FRED_PROPERTY));
description.markImmutable();
try {
description.setProperty(FOO_PROPERTY, "value1c");
fail("4.0 - should have failed");
} catch (IllegalStateException e) {
// success - the object was marked as immutable
}
assertThrows(IllegalStateException.class, () -> description.setProperty(FOO_PROPERTY, "value1c"));
}
}

This file was deleted.

Loading

0 comments on commit 3fe39fe

Please sign in to comment.