knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1289 - Deletion of generated topology deletes associated descriptor file
Date Thu, 03 May 2018 16:40:57 GMT
Repository: knox
Updated Branches:
  refs/heads/master 8a1f03b1c -> dcd25a056


KNOX-1289 - Deletion of generated topology deletes associated descriptor file


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/dcd25a05
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/dcd25a05
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/dcd25a05

Branch: refs/heads/master
Commit: dcd25a0569c8d004ccd7247f9a308fd91d3ef43e
Parents: 8a1f03b
Author: Phil Zampino <pzampino@apache.org>
Authored: Thu May 3 12:09:36 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Thu May 3 12:09:36 2018 -0400

----------------------------------------------------------------------
 .../services/topology/impl/DefaultTopologyService.java   | 11 -----------
 .../services/topology/DefaultTopologyServiceTest.java    |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/dcd25a05/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
index 4a9713a..ab5cedf 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
@@ -577,17 +577,6 @@ public class DefaultTopologyService
 
   @Override
   public void onFileDelete(java.io.File file) {
-    // For full topology descriptors, we need to make sure to delete any corresponding simple
descriptors to prevent
-    // unintended subsequent generation of the topology descriptor
-    for (String ext : DescriptorsMonitor.SUPPORTED_EXTENSIONS) {
-      File simpleDesc =
-              new File(descriptorsDirectory, FilenameUtils.getBaseName(file.getName()) +
"." + ext);
-      if (simpleDesc.exists()) {
-        log.deletingDescriptorForTopologyDeletion(simpleDesc.getName(), file.getName());
-        simpleDesc.delete();
-      }
-    }
-
     onFileChange(file);
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/dcd25a05/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
index 91a017b..23ca848 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
@@ -299,7 +299,7 @@ public class DefaultTopologyServiceTest {
         assertTrue(topologyFile.exists());
         topologyFile.delete();
         provider.reloadTopologies();
-        assertFalse("Simple descriptor should have been deleted because the associated topology
was.",
+        assertTrue("Simple descriptor should NOT have been deleted because the associated
topology was.",
                     simpleDesc.exists());
 
       } finally {


Mime
View raw message