jtulach commented on code in PR #9603: URL: https://github.com/apache/netbeans/pull/9603#discussion_r3939587287
########## ide/projectui/test/unit/src/org/netbeans/modules/project/ui/ProjectsRootNodeInitializedSoonerTest.java: ########## @@ -1,200 +0,0 @@ -/* - * 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.project.ui; - -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import org.netbeans.api.project.Project; -import org.netbeans.api.project.ProjectManager; -import org.netbeans.api.project.ui.OpenProjects; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.project.ui.actions.TestSupport; -import org.netbeans.spi.project.ui.LogicalViewProvider; -import org.netbeans.spi.project.ui.ProjectOpenedHook; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.filesystems.URLMapper; -import org.openide.nodes.AbstractNode; -import org.openide.nodes.Children; -import org.openide.nodes.Node; -import org.openide.util.Exceptions; -import org.openide.util.Lookup; -import org.openide.util.RequestProcessor; -import org.openide.util.lookup.Lookups; -import org.openide.util.test.MockLookup; - -public class ProjectsRootNodeInitializedSoonerTest extends NbTestCase { - - public ProjectsRootNodeInitializedSoonerTest(String testName) { - super(testName); - } - - @Override - protected Level logLevel() { - return Level.OFF; - } - - public void testWrongOrderOfInitialization() throws Exception { - MockLookup.setInstances(new TestSupport.TestProjectFactory()); - List<URL> list = new ArrayList<URL>(); - List<ExtIcon> icons = new ArrayList<ExtIcon>(); - List<String> names = new ArrayList<String>(); - clearWorkDir(); - FileObject workDir = FileUtil.toFileObject(getWorkDir()); - assertNotNull(workDir); - for (int i = 0; i < 30; i++) { - FileObject prj = TestSupport.createTestProject(workDir, "prj" + i); - URL url = URLMapper.findURL(prj, URLMapper.EXTERNAL); - list.add(url); - names.add(url.toExternalForm()); - icons.add(new ExtIcon()); - TestSupport.TestProject tmp = (TestSupport.TestProject) ProjectManager.getDefault().findProject(prj); - assertNotNull("Project found", tmp); - final TestProjectOpenedHookImpl hook = new TestProjectOpenedHookImpl(); - tmp.setLookup(Lookups.fixed(tmp, hook)); - hook.lkp = tmp.getLookup(); - } - - OpenProjectListSettings.getInstance().setOpenProjectsURLs(list); - OpenProjectListSettings.getInstance().setOpenProjectsDisplayNames(names); - OpenProjectListSettings.getInstance().setOpenProjectsIcons(icons); - - Node logicalView = new ProjectsRootNode(ProjectsRootNode.LOGICAL_VIEW); - - - class H extends Handler { - boolean ok; - - @Override - public void publish(LogRecord record) { Review Comment: - Logging handler to check whether something is happening deep in the code - and it is not happening - I guess we can just delete the test... - it must be some hardcore regression test - when it is using the log `Handler` in such an [advanced way](https://wiki.apidesign.org/wiki/FlowControllingTest#Advanced_usage_of_Logging) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
