Skip to content

Commit 1d31bec

Browse files
BeckerFrankruspl-afed
authored andcommitted
more cleanupsee Cleanup Bugzilla junit5 unintended convertion changes
1 parent d5fd118 commit 1d31bec

17 files changed

+81
-33
lines changed

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaFixtureTest.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,34 @@
2929
import org.junit.jupiter.params.Parameter;
3030
import org.junit.jupiter.params.ParameterizedClass;
3131
import org.junit.jupiter.params.provider.Arguments;
32-
import org.junit.jupiter.params.provider.MethodSource;
3332

3433
@ParameterizedClass(name = "{1}")
35-
@MethodSource("fixtureProvider")
3634
@EnabledIfCI
3735
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // so that the dummy "done" test is always last
3836
@MylynTestSetup
3937
@Timeout(value = 5, unit = TimeUnit.MINUTES) // overall timeout for each test
4038
@SuppressWarnings("nls")
4139
public abstract class AbstractBugzillaFixtureTest {
4240

43-
private static List<BugzillaFixture> discoveredFixtures;
41+
private static List<BugzillaFixture>[] discoveredFixtures = new List[2];
4442

4543
@Parameter(0)
4644
protected static BugzillaFixture fixture;
4745

4846
@Parameter(1)
4947
protected String info;
5048

51-
static Stream<Arguments> fixtureProvider() {
52-
if (discoveredFixtures == null) {
49+
static Stream<Arguments> fixtureProvider(boolean defaultOnly) {
50+
if (discoveredFixtures[defaultOnly ? 1 : 0] == null) {
5351
TestConfiguration defFixture = TestConfiguration.getDefault();
54-
discoveredFixtures = (List<BugzillaFixture>) defFixture.discover(BugzillaFixture.class,
55-
"bugzilla", false);
56-
assertTrue(discoveredFixtures.size() > 0, "No fixtures discovered");
57-
for (BugzillaFixture fixture : discoveredFixtures) {
52+
discoveredFixtures[defaultOnly ? 1 : 0] = (List<BugzillaFixture>) defFixture.discover(BugzillaFixture.class,
53+
"bugzilla", defaultOnly);
54+
assertTrue(discoveredFixtures[defaultOnly ? 1 : 0].size() > 0, "No fixtures discovered");
55+
for (BugzillaFixture fixture : discoveredFixtures[defaultOnly ? 1 : 0]) {
5856
System.out.println("Discovered fixture: " + fixture.getInfo());
5957
}
6058
}
61-
return discoveredFixtures.stream()
59+
return discoveredFixtures[defaultOnly ? 1 : 0].stream()
6260
.map(fixture -> Arguments.of(fixture, fixture.getInfo()));
6361
}
6462

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* @author Rob Elves
4646
* @author Nathan Hapke
4747
*/
48-
public abstract class AbstractBugzillaTest extends AbstractBugzillaFixtureTest {
48+
public abstract class AbstractBugzillaTest extends AllBugzillaFixtureTest {
4949

5050
static final String DEFAULT_KIND = BugzillaCorePlugin.CONNECTOR_KIND;
5151

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 frank
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-v20.html.
7+
*
8+
* Contributors:
9+
* See git history
10+
*******************************************************************************/
11+
12+
package org.eclipse.mylyn.bugzilla.tests;
13+
14+
import java.util.stream.Stream;
15+
16+
import org.junit.jupiter.params.provider.Arguments;
17+
import org.junit.jupiter.params.provider.MethodSource;
18+
19+
@MethodSource("allFixtureProvider")
20+
public class AllBugzillaFixtureTest extends AbstractBugzillaFixtureTest {
21+
22+
static Stream<Arguments> allFixtureProvider() {
23+
return fixtureProvider(false);
24+
}
25+
}

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @author Rob Elves
3838
*/
3939
@SuppressWarnings("nls")
40-
public class BugzillaSearchTest extends AbstractBugzillaFixtureTest {
40+
public class BugzillaSearchTest extends AllBugzillaFixtureTest {
4141

4242
private static final String QUERY_NAME = "Query Page Name";
4343

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @author Rob Elves
4141
*/
4242
@SuppressWarnings("nls")
43-
public class BugzillaTaskDataHandlerTest extends AbstractBugzillaFixtureTest {
43+
public class BugzillaTaskDataHandlerTest extends AllBugzillaFixtureTest {
4444

4545
@BeforeEach
4646
public void checkExcluded() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 frank
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-v20.html.
7+
*
8+
* Contributors:
9+
* See git history
10+
*******************************************************************************/
11+
12+
package org.eclipse.mylyn.bugzilla.tests;
13+
14+
import java.util.stream.Stream;
15+
16+
import org.junit.jupiter.params.provider.Arguments;
17+
import org.junit.jupiter.params.provider.MethodSource;
18+
19+
@MethodSource("defaultFixtureProvider")
20+
public class DefaultBugzillaFixtureTest extends AbstractBugzillaFixtureTest {
21+
22+
static Stream<Arguments> defaultFixtureProvider() {
23+
return fixtureProvider(true);
24+
}
25+
26+
}

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* @author Mik Kersten
4343
*/
4444
@SuppressWarnings("nls")
45-
public class RepositoryReportFactoryTest extends AbstractBugzillaFixtureTest {
45+
public class RepositoryReportFactoryTest extends AllBugzillaFixtureTest {
4646

4747
TaskRepository repository;
4848

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.eclipse.core.runtime.IStatus;
3535
import org.eclipse.core.runtime.NullProgressMonitor;
3636
import org.eclipse.core.runtime.Status;
37-
import org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaFixtureTest;
37+
import org.eclipse.mylyn.bugzilla.tests.AllBugzillaFixtureTest;
3838
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
3939
import org.eclipse.mylyn.commons.net.AuthenticationType;
4040
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
@@ -64,7 +64,7 @@
6464
* @author Robert Elves
6565
*/
6666
@SuppressWarnings("nls")
67-
public class BugzillaCustomFieldsTest extends AbstractBugzillaFixtureTest {
67+
public class BugzillaCustomFieldsTest extends AllBugzillaFixtureTest {
6868

6969
@BeforeEach
7070
void excludeCheck() {

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaFlagsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.Set;
2626

2727
import org.eclipse.core.runtime.CoreException;
28-
import org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaFixtureTest;
28+
import org.eclipse.mylyn.bugzilla.tests.AllBugzillaFixtureTest;
2929
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
3030
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
3131
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
@@ -41,7 +41,7 @@
4141
* @author Robert Elves
4242
*/
4343
@SuppressWarnings("nls")
44-
public class BugzillaFlagsTest extends AbstractBugzillaFixtureTest {
44+
public class BugzillaFlagsTest extends AllBugzillaFixtureTest {
4545

4646
@BeforeEach
4747
void excludeCheck() {

mylyn.tasks/connectors/bugzilla/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorConfigurationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static org.junit.jupiter.api.Assertions.assertNull;
2020
import static org.junit.jupiter.api.Assumptions.assumeFalse;
2121

22-
import org.eclipse.mylyn.bugzilla.tests.AbstractBugzillaFixtureTest;
22+
import org.eclipse.mylyn.bugzilla.tests.AllBugzillaFixtureTest;
2323
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
2424
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
2525
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
@@ -33,7 +33,7 @@
3333
*/
3434
// TODO 3.5 merge into BugzillaRepositoryConnectorStandaloneTest when Bugzilla 3.6 is released
3535
@SuppressWarnings("nls")
36-
public class BugzillaRepositoryConnectorConfigurationTest extends AbstractBugzillaFixtureTest {
36+
public class BugzillaRepositoryConnectorConfigurationTest extends AllBugzillaFixtureTest {
3737

3838
@BeforeEach
3939
public void checkExcluded() {

0 commit comments

Comments
 (0)