You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/06/22 05:36:31 UTC
[GitHub] [netbeans] JaroslavTulach opened a new pull request #3010: Improving usability of New from Template in VSNetBeans.
JaroslavTulach opened a new pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010
One complain <!--GR-31888 --> was that it is not possible to cancel the creation of a template. Addressed by 270ec4e.
Another complain suggested to avoid display _"Unrecognized file"_ obtained from a node short description <!-- GR-32181 --> - addressed by ignoring it in 125b650.
Then there were complains about some templates producing empty files <!-- GR-31337 and GR-31339 --> - as such I wrote a test in c7de9d7 to go through all available templates and verify they lead to non-empty result. Few didn't and those are branded out in 3b3aec0. Moreover some DuĊĦan's templates couldn't be instantiated without providing some variables - fixed in 6bd46cd.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach merged pull request #3010: Improving usability of New from Template in VSNetBeans.
Posted by GitBox <gi...@apache.org>.
JaroslavTulach merged pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3010: Improving usability of New from Template in VSNetBeans.
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010#discussion_r655937255
##########
File path: java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifySimpleTemplatesTest.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.netbeans.modules.nbcode.integration;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import junit.framework.Test;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.fail;
+import org.netbeans.api.actions.Editable;
+import org.netbeans.api.actions.Openable;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.loaders.DataFolder;
+import org.openide.loaders.DataObject;
+
+public class VerifySimpleTemplatesTest extends NbTestCase {
+ private static Logger LOG = Logger.getLogger(VerifySimpleTemplatesTest.class.getName());
+
+ public VerifySimpleTemplatesTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ String v = System.getProperty("java.version");
+ if (v == null || !v.startsWith("1.8")) {
+ return NbModuleSuite.emptyConfiguration().suite();
+ }
+
+ return NbModuleSuite.emptyConfiguration().
+ clusters("(extide|java).*").
+ enableModules(".*", ".*").
+ honorAutoloadEager(true).
+ failOnException(Level.INFO).
+ addTest(VerifySimpleTemplatesTest.class).
+ suite();
+ }
+
+ public void testAllTemplates() throws IOException {
+ clearWorkDir();
+
+ DataFolder scratch = DataFolder.findFolder(FileUtil.toFileObject(getWorkDir()));
+
+ DataFolder templates = DataFolder.findFolder(FileUtil.getConfigFile("Templates"));
+ List<DataObject> groups = new ArrayList<>();
+ quickPickTemplates(templates, groups);
+
+ List<DataObject> errorneus = new ArrayList<>();
+ int cnt = 0;
+ for (DataObject g : groups) {
+ assertTrue("It is a folder: " + g, g instanceof DataFolder);
+ DataFolder f = (DataFolder) g;
+
+ List<DataObject> simpleTemplates = new ArrayList<>();
+ quickPickTemplates(f, simpleTemplates);
+
+ for (DataObject t : simpleTemplates) {
+ LOG.log(Level.WARNING, "Processing {0}", t.getPrimaryFile().getPath());
+ final DataObject generated = t.createFromTemplate(scratch, "Test" + ++cnt);
+ final FileObject pf = generated.getPrimaryFile();
+ final Editable edit = generated.getLookup().lookup(Editable.class);
+ if (edit != null) {
+ LOG.log(Level.WARNING, "Editing {0}", pf.getPath());
+ edit.edit();
+ } else {
+ Openable open = generated.getLookup().lookup(Openable.class);
+ if (open != null) {
+ LOG.log(Level.WARNING, "Opening {0}", pf.getPath());
Review comment:
This kind of integration IDE tests is better to be verbose, I think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] sdedic commented on a change in pull request #3010: Improving usability of New from Template in VSNetBeans.
Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010#discussion_r655919563
##########
File path: java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifySimpleTemplatesTest.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.netbeans.modules.nbcode.integration;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import junit.framework.Test;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.fail;
+import org.netbeans.api.actions.Editable;
+import org.netbeans.api.actions.Openable;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.loaders.DataFolder;
+import org.openide.loaders.DataObject;
+
+public class VerifySimpleTemplatesTest extends NbTestCase {
+ private static Logger LOG = Logger.getLogger(VerifySimpleTemplatesTest.class.getName());
+
+ public VerifySimpleTemplatesTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ String v = System.getProperty("java.version");
+ if (v == null || !v.startsWith("1.8")) {
+ return NbModuleSuite.emptyConfiguration().suite();
+ }
+
+ return NbModuleSuite.emptyConfiguration().
+ clusters("(extide|java).*").
+ enableModules(".*", ".*").
+ honorAutoloadEager(true).
+ failOnException(Level.INFO).
+ addTest(VerifySimpleTemplatesTest.class).
+ suite();
+ }
+
+ public void testAllTemplates() throws IOException {
+ clearWorkDir();
+
+ DataFolder scratch = DataFolder.findFolder(FileUtil.toFileObject(getWorkDir()));
+
+ DataFolder templates = DataFolder.findFolder(FileUtil.getConfigFile("Templates"));
+ List<DataObject> groups = new ArrayList<>();
+ quickPickTemplates(templates, groups);
+
+ List<DataObject> errorneus = new ArrayList<>();
+ int cnt = 0;
+ for (DataObject g : groups) {
+ assertTrue("It is a folder: " + g, g instanceof DataFolder);
+ DataFolder f = (DataFolder) g;
+
+ List<DataObject> simpleTemplates = new ArrayList<>();
+ quickPickTemplates(f, simpleTemplates);
+
+ for (DataObject t : simpleTemplates) {
+ LOG.log(Level.WARNING, "Processing {0}", t.getPrimaryFile().getPath());
+ final DataObject generated = t.createFromTemplate(scratch, "Test" + ++cnt);
+ final FileObject pf = generated.getPrimaryFile();
+ final Editable edit = generated.getLookup().lookup(Editable.class);
+ if (edit != null) {
+ LOG.log(Level.WARNING, "Editing {0}", pf.getPath());
+ edit.edit();
+ } else {
+ Openable open = generated.getLookup().lookup(Openable.class);
+ if (open != null) {
+ LOG.log(Level.WARNING, "Opening {0}", pf.getPath());
Review comment:
Is this `WARNING` level message necessary in this 'successful' path - or is it meant to trace the progress in the test job logs ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] sdedic commented on a change in pull request #3010: Improving usability of New from Template in VSNetBeans.
Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010#discussion_r655919563
##########
File path: java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifySimpleTemplatesTest.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.netbeans.modules.nbcode.integration;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import junit.framework.Test;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.fail;
+import org.netbeans.api.actions.Editable;
+import org.netbeans.api.actions.Openable;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.loaders.DataFolder;
+import org.openide.loaders.DataObject;
+
+public class VerifySimpleTemplatesTest extends NbTestCase {
+ private static Logger LOG = Logger.getLogger(VerifySimpleTemplatesTest.class.getName());
+
+ public VerifySimpleTemplatesTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ String v = System.getProperty("java.version");
+ if (v == null || !v.startsWith("1.8")) {
+ return NbModuleSuite.emptyConfiguration().suite();
+ }
+
+ return NbModuleSuite.emptyConfiguration().
+ clusters("(extide|java).*").
+ enableModules(".*", ".*").
+ honorAutoloadEager(true).
+ failOnException(Level.INFO).
+ addTest(VerifySimpleTemplatesTest.class).
+ suite();
+ }
+
+ public void testAllTemplates() throws IOException {
+ clearWorkDir();
+
+ DataFolder scratch = DataFolder.findFolder(FileUtil.toFileObject(getWorkDir()));
+
+ DataFolder templates = DataFolder.findFolder(FileUtil.getConfigFile("Templates"));
+ List<DataObject> groups = new ArrayList<>();
+ quickPickTemplates(templates, groups);
+
+ List<DataObject> errorneus = new ArrayList<>();
+ int cnt = 0;
+ for (DataObject g : groups) {
+ assertTrue("It is a folder: " + g, g instanceof DataFolder);
+ DataFolder f = (DataFolder) g;
+
+ List<DataObject> simpleTemplates = new ArrayList<>();
+ quickPickTemplates(f, simpleTemplates);
+
+ for (DataObject t : simpleTemplates) {
+ LOG.log(Level.WARNING, "Processing {0}", t.getPrimaryFile().getPath());
+ final DataObject generated = t.createFromTemplate(scratch, "Test" + ++cnt);
+ final FileObject pf = generated.getPrimaryFile();
+ final Editable edit = generated.getLookup().lookup(Editable.class);
+ if (edit != null) {
+ LOG.log(Level.WARNING, "Editing {0}", pf.getPath());
+ edit.edit();
+ } else {
+ Openable open = generated.getLookup().lookup(Openable.class);
+ if (open != null) {
+ LOG.log(Level.WARNING, "Opening {0}", pf.getPath());
Review comment:
Is this `WARNING` level message necessary in this 'successful' path - or is it meant to trace the progress in the test job logs ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3010: Improving usability of New from Template in VSNetBeans.
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3010:
URL: https://github.com/apache/netbeans/pull/3010#discussion_r655937255
##########
File path: java/java.lsp.server/nbcode/integration/test/unit/src/org/netbeans/modules/nbcode/integration/VerifySimpleTemplatesTest.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.netbeans.modules.nbcode.integration;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import junit.framework.Test;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.fail;
+import org.netbeans.api.actions.Editable;
+import org.netbeans.api.actions.Openable;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.loaders.DataFolder;
+import org.openide.loaders.DataObject;
+
+public class VerifySimpleTemplatesTest extends NbTestCase {
+ private static Logger LOG = Logger.getLogger(VerifySimpleTemplatesTest.class.getName());
+
+ public VerifySimpleTemplatesTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ String v = System.getProperty("java.version");
+ if (v == null || !v.startsWith("1.8")) {
+ return NbModuleSuite.emptyConfiguration().suite();
+ }
+
+ return NbModuleSuite.emptyConfiguration().
+ clusters("(extide|java).*").
+ enableModules(".*", ".*").
+ honorAutoloadEager(true).
+ failOnException(Level.INFO).
+ addTest(VerifySimpleTemplatesTest.class).
+ suite();
+ }
+
+ public void testAllTemplates() throws IOException {
+ clearWorkDir();
+
+ DataFolder scratch = DataFolder.findFolder(FileUtil.toFileObject(getWorkDir()));
+
+ DataFolder templates = DataFolder.findFolder(FileUtil.getConfigFile("Templates"));
+ List<DataObject> groups = new ArrayList<>();
+ quickPickTemplates(templates, groups);
+
+ List<DataObject> errorneus = new ArrayList<>();
+ int cnt = 0;
+ for (DataObject g : groups) {
+ assertTrue("It is a folder: " + g, g instanceof DataFolder);
+ DataFolder f = (DataFolder) g;
+
+ List<DataObject> simpleTemplates = new ArrayList<>();
+ quickPickTemplates(f, simpleTemplates);
+
+ for (DataObject t : simpleTemplates) {
+ LOG.log(Level.WARNING, "Processing {0}", t.getPrimaryFile().getPath());
+ final DataObject generated = t.createFromTemplate(scratch, "Test" + ++cnt);
+ final FileObject pf = generated.getPrimaryFile();
+ final Editable edit = generated.getLookup().lookup(Editable.class);
+ if (edit != null) {
+ LOG.log(Level.WARNING, "Editing {0}", pf.getPath());
+ edit.edit();
+ } else {
+ Openable open = generated.getLookup().lookup(Openable.class);
+ if (open != null) {
+ LOG.log(Level.WARNING, "Opening {0}", pf.getPath());
Review comment:
This kind of integration IDE tests is better to be verbose, I think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists