Skip to content

Commit 91f9ed8

Browse files
Merge pull request #6685 from apache/delivery
Sync delivery to release200 for 20-rc4
2 parents cbc39f8 + ff57190 commit 91f9ed8

24 files changed

Lines changed: 317 additions & 107 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ jobs:
598598
- name: ide/libs.freemarker
599599
run: ant $OPTS -f ide/libs.freemarker test
600600

601-
# - name: ide/libs.git
602-
# run: ant $OPTS -f ide/libs.git test
601+
- name: ide/libs.git
602+
run: ant $OPTS -f ide/libs.git test
603603

604604
- name: ide/libs.graalsdk
605605
run: ant $OPTS -f ide/libs.graalsdk test

enterprise/micronaut/test/unit/data/gradle/artifacts/multi/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ group = "com.example"
88

99
repositories {
1010
mavenCentral()
11-
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
1211
}
1312

1413
dependencies {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
micronautVersion=3.10.1
1+
micronautVersion=3.10.2

enterprise/micronaut/test/unit/data/gradle/artifacts/multi/oci/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ group = "com.example"
88

99
repositories {
1010
mavenCentral()
11-
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
1211
}
1312

1413
dependencies {

enterprise/micronaut/test/unit/src/org/netbeans/modules/micronaut/gradle/MicronautGradleArtifactsImplTest.java

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
package org.netbeans.modules.micronaut.gradle;
2020

2121
import java.io.File;
22+
import java.util.Set;
23+
import java.util.stream.Collectors;
2224
import static junit.framework.TestCase.assertEquals;
2325
import static junit.framework.TestCase.assertNotNull;
2426
import org.netbeans.api.project.Project;
2527
import org.netbeans.api.project.ProjectActionContext;
2628
import org.netbeans.api.project.ProjectManager;
2729
import org.netbeans.junit.NbTestCase;
30+
import org.netbeans.modules.gradle.NbGradleProjectImpl;
2831
import org.netbeans.modules.gradle.ProjectTrust;
32+
import org.netbeans.modules.gradle.api.GradleReport;
2933
import org.netbeans.modules.gradle.api.NbGradleProject;
3034
import org.netbeans.modules.project.dependency.ArtifactSpec;
3135
import org.netbeans.modules.project.dependency.ProjectArtifactsQuery;
@@ -40,6 +44,14 @@
4044
*/
4145
public class MicronautGradleArtifactsImplTest extends NbTestCase {
4246

47+
static {
48+
// TODO remove ASAP from MicronautGradleArtifactsImplTest and ProjectViewTest
49+
// investigate "javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure"
50+
// during gradle download "at org.netbeans.modules.gradle.spi.newproject.TemplateOperation$InitStep.execute(TemplateOperation.java:317)"
51+
// this looks like a misconfigured webserver to me
52+
System.setProperty("https.protocols", "TLSv1.2");
53+
}
54+
4355
public MicronautGradleArtifactsImplTest(String name) {
4456
super(name);
4557
}
@@ -51,8 +63,7 @@ private static File getTestNBDestDir() throws Exception {
5163
return new File(destDir);
5264
}
5365

54-
FileObject d;
55-
FileObject dataFO;
66+
private FileObject dataFO;
5667

5768
@org.openide.util.lookup.ServiceProvider(service=org.openide.modules.InstalledFileLocator.class, position = 1000)
5869
public static class InstalledFileLocator extends DummyInstalledFileLocator {
@@ -66,7 +77,6 @@ public static class InstalledFileLocator extends DummyInstalledFileLocator {
6677
// it back to System.err - loop is formed. Initialize IOProvider first, it gets
6778
// the real System.err/out references.
6879
IOProvider p = IOProvider.getDefault();
69-
d = FileUtil.toFileObject(getWorkDir());
7080
System.setProperty("test.reload.sync", "true");
7181
dataFO = FileUtil.toFileObject(getDataDir());
7282

@@ -83,7 +93,9 @@ public void testProjectArtifactWithNormalQuery() throws Exception {
8393

8494
Project p = ProjectManager.getDefault().findProject(prjCopy);
8595
ProjectTrust.getDefault().trustProject(p);
96+
8697
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
98+
assertNoProblems(p);
8799
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p, ProjectArtifactsQuery.newQuery(null));
88100

89101
assertNotNull(ar);
@@ -100,7 +112,9 @@ public void testNativeOutputInRegularBuild() throws Exception {
100112

101113
Project p = ProjectManager.getDefault().findProject(prjCopy);
102114
ProjectTrust.getDefault().trustProject(p);
115+
103116
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
117+
assertNoProblems(p);
104118
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p, ProjectArtifactsQuery.newQuery("exe"));
105119

106120
assertNotNull(ar);
@@ -115,7 +129,9 @@ public void testNativeCompileDefaultOutput() throws Exception {
115129

116130
Project p = ProjectManager.getDefault().findProject(prjCopy);
117131
ProjectTrust.getDefault().trustProject(p);
132+
118133
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
134+
assertNoProblems(p);
119135
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
120136
ProjectArtifactsQuery.newQuery(null, null,
121137
ProjectActionContext.newBuilder(p).forProjectAction("native-build").context()
@@ -136,7 +152,9 @@ public void testDefaultNativeCompilationOutput() throws Exception {
136152

137153
Project p = ProjectManager.getDefault().findProject(prjCopy);
138154
ProjectTrust.getDefault().trustProject(p);
155+
139156
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
157+
assertNoProblems(p);
140158
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
141159
ProjectArtifactsQuery.newQuery(null, null,
142160
ProjectActionContext.newBuilder(p).forProjectAction("native-build").context()
@@ -157,7 +175,9 @@ public void testJarInNativeCompilation() throws Exception {
157175

158176
Project p = ProjectManager.getDefault().findProject(prjCopy);
159177
ProjectTrust.getDefault().trustProject(p);
160-
NbGradleProject.get(p).toQuality("TEst", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
178+
179+
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
180+
assertNoProblems(p);
161181
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
162182
ProjectArtifactsQuery.newQuery("jar", null,
163183
ProjectActionContext.newBuilder(p).forProjectAction("native-build").context()
@@ -178,7 +198,9 @@ public void testNativeOutputInNativeBuild() throws Exception {
178198

179199
Project p = ProjectManager.getDefault().findProject(prjCopy);
180200
ProjectTrust.getDefault().trustProject(p);
201+
181202
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
203+
assertNoProblems(p);
182204
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
183205
ProjectArtifactsQuery.newQuery("exe", null,
184206
ProjectActionContext.newBuilder(p).forProjectAction("native-build").context()
@@ -203,6 +225,7 @@ public void testSubprojectJarOutput() throws Exception {
203225
ProjectTrust.getDefault().trustProject(p);
204226

205227
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
228+
assertNoProblems(p);
206229
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p, ProjectArtifactsQuery.newQuery(null));
207230

208231
assertNotNull(ar);
@@ -223,6 +246,7 @@ public void testSubprojectShadowOutput() throws Exception {
223246
ProjectTrust.getDefault().trustProject(p);
224247

225248
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
249+
assertNoProblems(p);
226250
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
227251
ProjectArtifactsQuery.newQuery(null, null, null, ArtifactSpec.TAG_SHADED)
228252
);
@@ -242,7 +266,9 @@ public void testNativeOutputInSubprojectNativeBuild() throws Exception {
242266

243267
Project p = ProjectManager.getDefault().findProject(prjCopy.getFileObject("oci"));
244268
ProjectTrust.getDefault().trustProject(p);
269+
245270
NbGradleProject.get(p).toQuality("Test", NbGradleProject.Quality.FULL, true).toCompletableFuture().get();
271+
assertNoProblems(p);
246272
ProjectArtifactsQuery.ArtifactsResult ar = ProjectArtifactsQuery.findArtifacts(p,
247273
ProjectArtifactsQuery.newQuery("exe", null,
248274
ProjectActionContext.newBuilder(p).forProjectAction("native-build").context()
@@ -254,5 +280,18 @@ public void testNativeOutputInSubprojectNativeBuild() throws Exception {
254280
ArtifactSpec spec = ar.getArtifacts().get(0);
255281
assertEquals("exe", spec.getType());
256282
}
283+
284+
private static void assertNoProblems(Project project) {
285+
assertNotNull(project);
286+
Set<GradleReport> problems = ((NbGradleProjectImpl)project).getGradleProject().getBaseProject().getProblems();
287+
assertTrue(
288+
problems.size()+" problem(s) found>>>\n"+
289+
problems.stream()
290+
.map(p -> p.toString())
291+
.collect(Collectors.joining("\n"))
292+
+"\n<<<end of problems",
293+
problems.isEmpty()
294+
);
295+
}
257296
}
258297

extide/gradle/src/org/netbeans/modules/gradle/spi/newproject/TemplateOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.netbeans.modules.gradle.api.NbGradleProject.Quality;
6060
import org.openide.loaders.DataFolder;
6161
import org.openide.loaders.DataObject;
62+
import org.openide.util.Exceptions;
6263
import org.openide.util.NbBundle;
6364

6465
/**
@@ -315,8 +316,7 @@ public Set<FileObject> execute() {
315316

316317
pconn.newBuild().withArguments("--offline").forTasks(args.toArray(new String[0])).run(); //NOI18N
317318
} catch (GradleConnectionException | IllegalStateException ex) {
318-
// Well for some reason we were not able to load Gradle.
319-
// Ignoring that for now
319+
Exceptions.printStackTrace(ex);
320320
}
321321
gconn.disconnect();
322322
return Collections.singleton(FileUtil.toFileObject(target));

ide/git/src/org/netbeans/modules/git/ui/branch/CreateBranchAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@
5050
public class CreateBranchAction extends SingleRepositoryAction {
5151

5252
private static final Logger LOG = Logger.getLogger(CreateBranchAction.class.getName());
53+
private static final String ICON_RESOURCE = "org/netbeans/modules/git/resources/icons/branch.png"; //NOI18N
54+
55+
public CreateBranchAction() {
56+
super(ICON_RESOURCE);
57+
}
58+
59+
@Override
60+
protected String iconResource() {
61+
return ICON_RESOURCE;
62+
}
5363

5464
@Override
5565
protected void performAction (File repository, File[] roots, VCSContext context) {

ide/git/src/org/netbeans/modules/git/ui/checkout/SwitchBranchAction.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@
4747
@ActionRegistration(displayName = "#LBL_SwitchBranchAction_Name")
4848
public class SwitchBranchAction extends AbstractCheckoutAction {
4949

50+
private static final String ICON_RESOURCE = "org/netbeans/modules/git/resources/icons/active_branch.png"; //NOI18N
51+
52+
public SwitchBranchAction() {
53+
super(ICON_RESOURCE);
54+
}
55+
56+
@Override
57+
protected String iconResource() {
58+
return ICON_RESOURCE;
59+
}
60+
5061
@Override
5162
protected void performAction (File repository, File[] roots, VCSContext context) {
5263
RepositoryInfo info = RepositoryInfo.getInstance(repository);

ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ private static void setTestMethodsImpl(StyledDocument doc, List<TestMethod> meth
6262
doc.putProperty(TestMethodAnnotation.DOCUMENT_ANNOTATION_LINES_KEY, annotationLines);
6363
}
6464

65-
Map<TestMethod, TestMethodAnnotation> removed = new HashMap<>(annotations);
66-
67-
methods.forEach(tm -> removed.remove(tm));
68-
6965
Set<TestMethod> added = new HashSet<>(methods);
66+
Map<TestMethod, TestMethodAnnotation> removed = new HashMap<>(annotations);
7067

68+
removed.keySet().removeAll(added);
7169
added.removeAll(annotations.keySet());
7270

7371
for (TestMethod method : added) {

ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestsuiteNode.java

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.List;
2525
import java.util.MissingResourceException;
2626
import javax.swing.Action;
27-
import javax.swing.UIManager;
2827
import org.netbeans.modules.gsf.testrunner.api.OutputLine;
2928
import org.netbeans.modules.gsf.testrunner.api.Report;
3029
import org.netbeans.modules.gsf.testrunner.api.Status;
@@ -47,20 +46,22 @@ public class TestsuiteNode extends AbstractNode {
4746
* The max number of output lines to display in the tooltip.
4847
*/
4948
static final int MAX_TOOLTIP_LINES = Integer.getInteger("testrunner.max.tooltip.lines", 4); //NOI18N
49+
5050
/**
5151
* The max line length to display in the tooltip.
5252
*/
5353
private static final int MAX_TOOLTIP_LINE_LENGTH = Integer.getInteger("testrunner.max.tooltip.line.length", 80); //NOI18N
54+
5455
/**
5556
* The system property for enabling/disabling tooltips.
5657
*/
57-
static final boolean DISPLAY_TOOLTIPS = Boolean.valueOf(System.getProperty("testrunner.display.tooltips", "true"));//NOI18N
58+
static final boolean DISPLAY_TOOLTIPS = Boolean.parseBoolean(System.getProperty("testrunner.display.tooltips", "true"));//NOI18N
59+
5860
/**
5961
* The max line length to display in the messages.
6062
*
6163
* By default, the max line length for the messages in the Test Results
62-
* window will be set to 120 for the GTK look and feel or JDK8, and won't be limited
63-
* for other look and feels or JDKs. For any look and feel or JDK a user can change the
64+
* window will be set to 250. A user can change the
6465
* default setting via the system property
6566
* {@code testrunner.max.msg.line.length=MAX_LINE_LENGTH},
6667
* where {@code MAX_LINE_LENGTH} is a desired value.
@@ -69,9 +70,7 @@ public class TestsuiteNode extends AbstractNode {
6970
* See Issue #175430
7071
* See Issue #188632
7172
*/
72-
static final int MAX_MSG_LINE_LENGTH =
73-
Integer.getInteger("testrunner.max.msg.line.length", //NOI18N
74-
isGTK() || isJDK8() ? 120 : Integer.MAX_VALUE);
73+
static final int MAX_MSG_LINE_LENGTH = Integer.getInteger("testrunner.max.msg.line.length", 250);
7574

7675
protected String suiteName;
7776
protected TestSuite suite;
@@ -207,7 +206,7 @@ public Image getIcon(int type) {
207206
public void displayReport(final Report report) {
208207
assert (report != null);
209208
assert report.getSuiteClassName().equals(this.suiteName)
210-
|| (this.suiteName == TestSuite.ANONYMOUS_SUITE);
209+
|| TestSuite.ANONYMOUS_SUITE.equals(this.suiteName);
211210

212211
this.report = report;
213212
suiteName = report.getSuiteClassName();
@@ -274,7 +273,7 @@ public String getHtmlDisplayName() {
274273
assert suiteName != null;
275274

276275
StringBuilder buf = new StringBuilder(60);
277-
if (suiteName != TestSuite.ANONYMOUS_SUITE) {
276+
if (!TestSuite.ANONYMOUS_SUITE.equals(suiteName)) {
278277
buf.append(suiteName);
279278
} else {
280279
buf.append(Bundle.MSG_TestsuiteNoname());
@@ -304,7 +303,7 @@ public String getHtmlDisplayName() {
304303
"MSG_TestsuiteAborted_HTML=Aborted",
305304
"MSG_TestsuiteSkipped_HTML=Skipped"})
306305
static String suiteStatusToMsg(Status status, boolean html) {
307-
String result = null;
306+
String result;
308307
if(Status.ABORTED == status){
309308
result = html ? Bundle.MSG_TestsuiteAborted_HTML() : Bundle.MSG_TestsuiteAborted("");
310309
} else if (Status.ERROR == status || Status.FAILED == status) {
@@ -369,7 +368,7 @@ public Action[] getActions(boolean context) {
369368
}
370369

371370
private List<OutputLine> getOutput() {
372-
List<OutputLine> result = new ArrayList<OutputLine>();
371+
List<OutputLine> result = new ArrayList<>();
373372
for (Testcase testcase : report.getTests()) {
374373
result.addAll(testcase.getOutput());
375374
}
@@ -414,25 +413,4 @@ public static String cutLine(String line, int maxLength, boolean isHTML)
414413
return line;
415414
}
416415

417-
418-
/**
419-
* Checks whether a currently used look and feel is GTK.
420-
*
421-
* @return {@code true} if a currently used look and feel has got the
422-
* identifier "GTK", otherwise {@code true}.
423-
*/
424-
private static boolean isGTK() {
425-
return "GTK".equals(UIManager.getLookAndFeel().getID());
426-
}
427-
428-
/**
429-
* Checks whether the currently used JDK version is 1.8.x_xx
430-
*
431-
* @return {@code true} if the currently used JDK version is 8, otherwise {@code false}.
432-
*/
433-
private static boolean isJDK8() {
434-
final String javaVersion = System.getProperty("java.version"); //NOI18N
435-
return javaVersion != null && javaVersion.startsWith("1.8"); //NOI18N
436-
}
437-
438416
}

0 commit comments

Comments
 (0)