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/12/20 09:27:17 UTC

[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3375: NETBEANS-6307: check global artifact cache, ignore per-project cached structure if not consistent.

JaroslavTulach commented on a change in pull request #3375:
URL: https://github.com/apache/netbeans/pull/3375#discussion_r772203247



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/loaders/GradleArtifactStore.java
##########
@@ -159,7 +171,54 @@ void verify() {
             store();
         }
     }
-
+    
+    /**
+     * Checks that all dependencies the project thinks should be in the global cache
+     * are actually in the global cache. If the global artifact cache does not contain
+     * an entry from a resolved depency in the project cache then many random failures can

Review comment:
       typo: dependency

##########
File path: extide/gradle/test/unit/src/org/netbeans/modules/gradle/loaders/DiskCacheProjectLoaderTest.java
##########
@@ -0,0 +1,169 @@
+/*
+ * 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.gradle.loaders;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectManager;
+import org.netbeans.junit.NbModuleSuite;
+import org.netbeans.modules.gradle.AbstractGradleProjectTestCase;
+import org.netbeans.modules.gradle.api.GradleBaseProject;
+import org.netbeans.modules.gradle.api.GradleConfiguration;
+import org.netbeans.modules.gradle.api.GradleDependency.ModuleDependency;
+import org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation;
+import org.netbeans.modules.projectapi.nb.NbProjectManager;
+import org.netbeans.spi.project.ActionProgress;
+import org.netbeans.spi.project.ActionProvider;
+import org.netbeans.spi.project.ProjectFactory;
+import org.netbeans.spi.project.ProjectManagerImplementation;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.Lookups;
+
+/**
+ *
+ * @author sdedic
+ */
+public class DiskCacheProjectLoaderTest extends AbstractGradleProjectTestCase{
+    private FileObject projectDir;
+    
+    public DiskCacheProjectLoaderTest(String name) {
+        super(name);
+    }
+    
+    public static TestSuite suite() {
+        TestSuite ts = new TestSuite();
+        NbModuleSuite.Configuration conf = NbModuleSuite.emptyConfiguration().
+                addTest(DiskCacheProjectLoaderTest.class).
+                addTest("testInitialLoadProject").
+                reuseUserDir(false).
+                gui(false).
+                enableModules(".*gradle.*").
+                reuseUserDir(false);
+        
+        Test run1 = NbModuleSuite.create(conf);
+
+        conf = NbModuleSuite.emptyConfiguration().
+                        addTest(DiskCacheProjectLoaderTest.class).
+                        addTest("testLoadCachedProject").
+                        reuseUserDir(false).
+                        gui(false).
+                        enableModules(".*gradle.*").
+                        reuseUserDir(false);
+        
+        Test run2 = NbModuleSuite.create(conf);
+        ts.addTest(run1);
+        ts.addTest(run2);

Review comment:
       A test with a restart of the IDE! Amazing.




-- 
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: notifications-unsubscribe@netbeans.apache.org

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