Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2009, 2026 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
Expand Down Expand Up @@ -32,6 +32,7 @@
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import org.eclipse.xtext.testing.Flaky;

/**
* @author Sebastian Zarnekow - Initial contribution and API
Expand Down Expand Up @@ -75,6 +76,7 @@ public boolean apply(IEObjectDescription input) {
}));
}

@Flaky
@Test public void testGetContents_03() {
assumeTrue(JavaCore.getPlugin().getBundle().getVersion().compareTo(new Version(3,31,0)) >= 0);
Iterable<IEObjectDescription> contents = constructorScope.getAllElements();
Expand All @@ -86,6 +88,7 @@ public boolean apply(IEObjectDescription input) {
}));
}

@Flaky
@Test public void testGetContents_04() {
assumeTrue(JavaCore.getPlugin().getBundle().getVersion().compareTo(new Version(3,31,0)) >= 0);
Iterable<IEObjectDescription> contents = constructorScope.getAllElements();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2009, 2026 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
Expand All @@ -25,6 +25,7 @@
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import org.eclipse.xtext.testing.Flaky;

/**
* @author Sebastian Zarnekow - Initial contribution and API
Expand All @@ -44,6 +45,7 @@ public void setUp() throws Exception {
typeScope = new JdtBasedSimpleTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(),Predicates.<IEObjectDescription>alwaysTrue());
}

@Flaky
@Test public void testGetContents_01() {
Iterable<IEObjectDescription> contents = typeScope.getAllElements();
assertTrue(Iterables.any(contents, new Predicate<IEObjectDescription>() {
Expand All @@ -64,6 +66,7 @@ public boolean apply(IEObjectDescription input) {
}));
}

@Flaky
@Test public void testGetContents_03() {
Iterable<IEObjectDescription> contents = typeScope.getAllElements();
assertTrue(Iterables.any(contents, new Predicate<IEObjectDescription>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2022 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2010, 2026 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
Expand All @@ -21,6 +21,7 @@
import org.eclipse.xtext.util.Modules2;
import org.junit.BeforeClass;
import org.junit.Test;
import org.eclipse.xtext.testing.Flaky;

import com.google.inject.Guice;
import com.google.inject.Injector;
Expand Down Expand Up @@ -62,6 +63,7 @@ public Class<? extends IJavaProjectProvider> bindIJavaProjectProvider() {
};
}

@Flaky
@Test
public void testDefaultArrayList_01() throws Exception {
//FIXME this does not consider JDT type filter, i.e. TypeFilter#isFiltered(char[],char[]) is not called.
Expand All @@ -70,6 +72,7 @@ public void testDefaultArrayList_01() throws Exception {
builder.assertText("java.lang.Appendable", "com.google.common.io.AppendableWriter");
}

@Flaky
@Test
public void testDefaultArrayList_02() throws Exception {
//FIXME this does not consider JDT type filter, i.e. TypeFilter#isFiltered(char[],char[]) is not called.
Expand All @@ -78,6 +81,7 @@ public void testDefaultArrayList_02() throws Exception {
builder.assertText("Appendable", "com.google.common.io.AppendableWriter");
}

@Flaky
@Test public void testCustomArrayList_01() throws Exception {
try {
newBuilder().append("custom ArrayLis").assertText(
Expand Down Expand Up @@ -105,6 +109,7 @@ public void testDefaultArrayList_02() throws Exception {
}
}

@Flaky
@Test public void testCustomArrayList_02() throws Exception {
try {
newBuilder().append("import java.util.* custom ArrayLis").assertText(
Expand Down Expand Up @@ -134,54 +139,67 @@ public void testDefaultArrayList_02() throws Exception {
}
}

@Flaky
@Test public void testDefaultBlockingQueue_01() throws Exception {
newBuilder().append("import java.util.* default BlockingQ").assertText("concurrent.BlockingQueue");
}

@Flaky
@Test public void testDefaultBlockingQueue_02() throws Exception {
newBuilder().append("import java.* default BlockingQ").assertText("util.concurrent.BlockingQueue");
}

@Flaky
@Test public void testCustomArrayList_03() throws Exception {
newBuilder().append("import java.util.* custom java.util.ArrayLis").assertText("ArrayList","ArrayList.ArrayListSpliterator");
}

@Flaky
@Test public void testCustomBlockingQueue_01() throws Exception {
newBuilder().append("import java.util.* custom BlockingQ").assertText("concurrent.BlockingQueue");
}

@Flaky
@Test public void testCustomBlockingQueue_02() throws Exception {
newBuilder().append("import java.* custom BlockingQ").assertText("util.concurrent.BlockingQueue");
}

@Flaky
@Test public void testCustomBlockingQueue_03() throws Exception {
newBuilder().append("import java.* custom concurrent.BlockingQ").assertText("util.concurrent.BlockingQueue");
}

@Flaky
@Test public void testSubtypeArrayList_01() throws Exception {
newBuilder().append("subtype ArrayLis").assertText("java.util.ArrayList", "java.util.Arrays.ArrayList");
}

@Flaky
@Test public void testSubtypeArrayList_02() throws Exception {
newBuilder().append("import java.util.* subtype ArrayLis").assertText("ArrayList", "Arrays.ArrayList");
}

@Flaky
@Test public void testSubtypeHashSet_01() throws Exception {
newBuilder().append("subtype HashSe").assertText("java.util.HashSet");
}

@Flaky
@Test public void testSubtypeHashSet_02() throws Exception {
newBuilder().append("import java.util.* subtype HashSe").assertText("HashSet");
}

@Flaky
@Test public void testSubtypeBlockingQueue_01() throws Exception {
newBuilder().append("import java.util.* subtype BlockingQ").assertText("concurrent.BlockingQueue");
}

@Flaky
@Test public void testSubtypeBlockingQueue_02() throws Exception {
newBuilder().append("import java.* subtype BlockingQ").assertText("util.concurrent.BlockingQueue");
}

@Flaky
@Test public void testSubtypeBlockingQueue_03() throws Exception {
newBuilder().append("import java.* subtype concurrent.BlockingQ").assertText("util.concurrent.BlockingQueue");
}
Expand All @@ -197,18 +215,21 @@ public void testDefaultArrayList_02() throws Exception {
}
}

@Flaky
@Test public void testMap_01() throws Exception {
newBuilder().append("import java.util.* import javax.swing.text.html.* custom java.util.Map").assertText(
"java.util.Map");
}

@Flaky
@Test public void testMap_02() throws Exception {
newBuilder().append("import javax.swing.text.html.* import java.util.* custom java.util.Map").assertText(
"java.util.Map");
}

@Flaky
@Test public void testMap_03() throws Exception {
newBuilder().append("import java.util.* custom java.util.Map").assertText("Map");
}

}
}
Loading