Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/AbstractArtifactGraphFactory.java5
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/BundleDeploymentPropertiesTransformerTests.java6
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/ImportExpandingTransformerTests.java8
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/AtomicInstallArtifactLifecycleListenerTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/PlanMemberCollectorTests.java18
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifactTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/AbstractPipelineStageTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/CompensatingPipelineTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java10
-rw-r--r--org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerCompositeArtifactDependencyDeterminerTests.java2
-rw-r--r--org.eclipse.virgo.kernel.stubs/src/main/java/org/eclipse/virgo/kernel/stubs/StubInstallArtifact.java4
12 files changed, 31 insertions, 32 deletions
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/AbstractArtifactGraphFactory.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/AbstractArtifactGraphFactory.java
index f62e5f1a..55a4c905 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/AbstractArtifactGraphFactory.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/AbstractArtifactGraphFactory.java
@@ -7,6 +7,7 @@
*
* Contributors:
* EclipseSource - Bug 358442 Change InstallArtifact graph from a tree to a DAG
+ * EclipseSource - Bug 369907 Rework DAG interface
*******************************************************************************/
package org.eclipse.virgo.kernel.install.artifact.internal;
@@ -36,9 +37,7 @@ public abstract class AbstractArtifactGraphFactory implements InstallArtifactGra
}
protected GraphNode<InstallArtifact> constructAssociatedGraphNode(GraphAssociableInstallArtifact rootArtifact) throws DeploymentException {
- //TODO: rework the DAG interface to contain just a createNode method and then call that instead of the following close approximation
- GraphNode<InstallArtifact> graphNode = this.dag.createRootNode(rootArtifact);
- this.dag.deleteRootNode(graphNode);
+ GraphNode<InstallArtifact> graphNode = this.dag.createNode(rootArtifact);
rootArtifact.setGraph(graphNode);
return graphNode;
}
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/BundleDeploymentPropertiesTransformerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/BundleDeploymentPropertiesTransformerTests.java
index 3de4440a..e7365924 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/BundleDeploymentPropertiesTransformerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/BundleDeploymentPropertiesTransformerTests.java
@@ -47,7 +47,7 @@ public class BundleDeploymentPropertiesTransformerTests {
replay(artifact);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> tree = dag.createRootNode(artifact);
+ GraphNode<InstallArtifact> tree = dag.createNode(artifact);
BundleDeploymentPropertiesTransformer transformer = new BundleDeploymentPropertiesTransformer();
transformer.transform(tree, null);
@@ -65,7 +65,7 @@ public class BundleDeploymentPropertiesTransformerTests {
replay(artifact);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> tree = dag.createRootNode(artifact);
+ GraphNode<InstallArtifact> tree = dag.createNode(artifact);
BundleDeploymentPropertiesTransformer transformer = new BundleDeploymentPropertiesTransformer();
transformer.transform(tree, null);
@@ -87,7 +87,7 @@ public class BundleDeploymentPropertiesTransformerTests {
replay(artifact);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> tree = dag.createRootNode(artifact);
+ GraphNode<InstallArtifact> tree = dag.createNode(artifact);
BundleDeploymentPropertiesTransformer transformer = new BundleDeploymentPropertiesTransformer();
transformer.transform(tree, null);
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/ImportExpandingTransformerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/ImportExpandingTransformerTests.java
index cb9145f5..0c7cb405 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/ImportExpandingTransformerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/ImportExpandingTransformerTests.java
@@ -101,7 +101,7 @@ public class ImportExpandingTransformerTests {
replayMocks();
ImportExpandingTransformer importExpander = new ImportExpandingTransformer(this.importExpander);
- importExpander.transform(this.dag.createRootNode(bundleIinstallArtifact), installEnvironment);
+ importExpander.transform(this.dag.createNode(bundleIinstallArtifact), installEnvironment);
verifyMocks();
}
@@ -120,7 +120,7 @@ public class ImportExpandingTransformerTests {
ImportExpandingTransformer importExpander = new ImportExpandingTransformer(this.importExpander);
try {
- importExpander.transform(this.dag.createRootNode(bundleIinstallArtifact), installEnvironment);
+ importExpander.transform(this.dag.createNode(bundleIinstallArtifact), installEnvironment);
} catch (DeploymentException e) {
assertTrue(e.getCause() instanceof IOException);
}
@@ -144,7 +144,7 @@ public class ImportExpandingTransformerTests {
ImportExpandingTransformer importExpander = new ImportExpandingTransformer(this.importExpander);
try {
- importExpander.transform(this.dag.createRootNode(bundleIinstallArtifact), installEnvironment);
+ importExpander.transform(this.dag.createNode(bundleIinstallArtifact), installEnvironment);
} catch (DeploymentException e) {
assertTrue(e.getCause() instanceof ImportMergeException);
}
@@ -169,7 +169,7 @@ public class ImportExpandingTransformerTests {
ImportExpandingTransformer importExpander = new ImportExpandingTransformer(this.importExpander);
try {
- importExpander.transform(this.dag.createRootNode(bundleIinstallArtifact), installEnvironment);
+ importExpander.transform(this.dag.createNode(bundleIinstallArtifact), installEnvironment);
} catch (DeploymentException e) {
assertTrue(e.getCause() instanceof UnableToSatisfyLibraryDependenciesException);
}
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/AtomicInstallArtifactLifecycleListenerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/AtomicInstallArtifactLifecycleListenerTests.java
index 617109a7..cc9a917f 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/AtomicInstallArtifactLifecycleListenerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/AtomicInstallArtifactLifecycleListenerTests.java
@@ -250,7 +250,7 @@ public class AtomicInstallArtifactLifecycleListenerTests {
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
GraphNode<InstallArtifact> graph = null;
for (StubInstallArtifact installArtifact : installArtifactArray) {
- GraphNode<InstallArtifact> leaf = dag.createRootNode(installArtifact);
+ GraphNode<InstallArtifact> leaf = dag.createNode(installArtifact);
if (graph == null) {
graph = leaf;
} else {
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/PlanMemberCollectorTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/PlanMemberCollectorTests.java
index 3ebccd4f..bb80fee8 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/PlanMemberCollectorTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/PlanMemberCollectorTests.java
@@ -41,7 +41,7 @@ public class PlanMemberCollectorTests {
PlanInstallArtifact plan = createNiceMock(PlanInstallArtifact.class);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> graph = dag.createRootNode(plan);
+ GraphNode<InstallArtifact> graph = dag.createNode(plan);
expect(plan.getGraph()).andReturn(graph);
@@ -56,13 +56,13 @@ public class PlanMemberCollectorTests {
public void singleLevelPlan() {
PlanInstallArtifact plan = createNiceMock(PlanInstallArtifact.class);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> tree = dag.createRootNode(plan);
+ GraphNode<InstallArtifact> tree = dag.createNode(plan);
BundleInstallArtifact bundle1 = createNiceMock(BundleInstallArtifact.class);
- tree.addChild(dag.createRootNode(bundle1));
+ tree.addChild(dag.createNode(bundle1));
BundleInstallArtifact bundle2 = createNiceMock(BundleInstallArtifact.class);
- tree.addChild(dag.createRootNode(bundle2));
+ tree.addChild(dag.createNode(bundle2));
expect(plan.getGraph()).andReturn(tree);
@@ -79,22 +79,22 @@ public class PlanMemberCollectorTests {
public void nestedPlan() {
PlanInstallArtifact plan = createNiceMock(PlanInstallArtifact.class);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- GraphNode<InstallArtifact> tree = dag.createRootNode(plan);
+ GraphNode<InstallArtifact> tree = dag.createNode(plan);
expect(plan.getGraph()).andReturn(tree);
BundleInstallArtifact bundle1 = createNiceMock(BundleInstallArtifact.class);
- tree.addChild(dag.createRootNode(bundle1));
+ tree.addChild(dag.createNode(bundle1));
BundleInstallArtifact bundle2 = createNiceMock(BundleInstallArtifact.class);
- tree.addChild(dag.createRootNode(bundle2));
+ tree.addChild(dag.createNode(bundle2));
PlanInstallArtifact nestedPlan = createNiceMock(PlanInstallArtifact.class);
- GraphNode<InstallArtifact> nestedTree = dag.createRootNode(nestedPlan);
+ GraphNode<InstallArtifact> nestedTree = dag.createNode(nestedPlan);
expect(nestedPlan.getGraph()).andReturn(nestedTree);
BundleInstallArtifact bundle3 = createNiceMock(BundleInstallArtifact.class);
- nestedTree.addChild(dag.createRootNode(bundle3));
+ nestedTree.addChild(dag.createNode(bundle3));
tree.addChild(nestedTree);
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifactTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifactTests.java
index 08218d9b..0dd60b2c 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifactTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/artifact/internal/bundle/StandardBundleInstallArtifactTests.java
@@ -120,7 +120,7 @@ public class StandardBundleInstallArtifactTests {
artifact.setQuasiBundle(quasiBundle);
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- artifact.setGraph(dag.createRootNode(artifact));
+ artifact.setGraph(dag.createNode(artifact));
expect(this.bundleDriver.update(isA(BundleManifest.class), isA(File.class))).andReturn(true);
this.bundleDriver.refreshBundle();
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/AbstractPipelineStageTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/AbstractPipelineStageTests.java
index da4591d4..b517189e 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/AbstractPipelineStageTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/AbstractPipelineStageTests.java
@@ -63,7 +63,7 @@ public class AbstractPipelineStageTests {
public void setUp() {
this.processed = false;
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- this.installGraph = dag.createRootNode(null);
+ this.installGraph = dag.createNode(null);
this.installEnvironment = createMock(InstallEnvironment.class);
this.installLog = createMock(InstallLog.class);
}
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/CompensatingPipelineTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/CompensatingPipelineTests.java
index 47d21dd0..b5681242 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/CompensatingPipelineTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/CompensatingPipelineTests.java
@@ -124,7 +124,7 @@ public class CompensatingPipelineTests {
@Before
public void setUp() {
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- this.installGraph = dag.createRootNode(null);
+ this.installGraph = dag.createNode(null);
this.installEnvironment = createMock(InstallEnvironment.class);
this.installLog = createMock(InstallLog.class);
this.stageTrace = new ArrayList<PipelineStage>();
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
index af1f2c47..3010100b 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/internal/StandardPipelineTests.java
@@ -85,7 +85,7 @@ public class StandardPipelineTests {
@Before
public void setUp() {
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
- this.installGraph = dag.createRootNode(null);
+ this.installGraph = dag.createNode(null);
this.installEnvironment = createMock(InstallEnvironment.class);
this.installLog = createMock(InstallLog.class);
this.stageTrace = new ArrayList<PipelineStage>();
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
index fb65f339..9384eec2 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/install/pipeline/stage/transform/internal/SyntheticContextBundleCreatingTransformerTests.java
@@ -87,7 +87,7 @@ public final class SyntheticContextBundleCreatingTransformerTests {
expect(
this.installArtifactGraphFactory.constructInstallArtifactGraph(eq(new ArtifactIdentity("bundle", "plan-name-1-synthetic.context",
new Version(1, 0, 0), ScopeNameFactory.createScopeName("plan-name", new Version(1, 0, 0)))), isA(ArtifactStorage.class),
- (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createRootNode(syntheticContextInstallArtifact));
+ (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createNode(syntheticContextInstallArtifact));
replay(this.installEnvironment, this.installArtifactGraphFactory);
@@ -113,7 +113,7 @@ public final class SyntheticContextBundleCreatingTransformerTests {
expect(
this.installArtifactGraphFactory.constructInstallArtifactGraph(eq(new ArtifactIdentity("bundle", "plan-name-1-synthetic.context",
new Version(1, 0, 0), ScopeNameFactory.createScopeName("plan-name", new Version(1, 0, 0)))), isA(ArtifactStorage.class),
- (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createRootNode(syntheticContextInstallArtifact));
+ (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createNode(syntheticContextInstallArtifact));
replay(this.installEnvironment, this.installArtifactGraphFactory);
@@ -140,7 +140,7 @@ public final class SyntheticContextBundleCreatingTransformerTests {
expect(
this.installArtifactGraphFactory.constructInstallArtifactGraph(eq(new ArtifactIdentity("bundle", "nested-plan-1-synthetic.context",
new Version(1, 0, 0), ScopeNameFactory.createScopeName("nested-plan", new Version(1, 0, 0)))), isA(ArtifactStorage.class),
- (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createRootNode(syntheticContextInstallArtifact));
+ (Map<String, String>) isNull(), (String) isNull())).andReturn(this.dag.createNode(syntheticContextInstallArtifact));
replay(this.installEnvironment, this.installArtifactGraphFactory);
@@ -189,11 +189,11 @@ public final class SyntheticContextBundleCreatingTransformerTests {
replay(plan);
- GraphNode<InstallArtifact> installTree = this.dag.createRootNode(plan);
+ GraphNode<InstallArtifact> installTree = this.dag.createNode(plan);
for (String bundleSymbolicName : bundleSymbolicNames) {
InstallArtifact bundle = createMockBundleInstallArtifact(bundleSymbolicName);
- installTree.addChild(this.dag.createRootNode(bundle));
+ installTree.addChild(this.dag.createNode(bundle));
}
return installTree;
}
diff --git a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerCompositeArtifactDependencyDeterminerTests.java b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerCompositeArtifactDependencyDeterminerTests.java
index 87fc4247..004bb59c 100644
--- a/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerCompositeArtifactDependencyDeterminerTests.java
+++ b/org.eclipse.virgo.kernel.model/src/test/java/org/eclipse/virgo/kernel/model/internal/deployer/DeployerCompositeArtifactDependencyDeterminerTests.java
@@ -70,7 +70,7 @@ public class DeployerCompositeArtifactDependencyDeterminerTests {
public void success() {
DirectedAcyclicGraph<InstallArtifact> dag = new ThreadSafeDirectedAcyclicGraph<InstallArtifact>();
StubPlanInstallArtifact installArtifact = new StubPlanInstallArtifact(dag);
- installArtifact.getGraph().addChild(dag.createRootNode(new StubInstallArtifact()));
+ installArtifact.getGraph().addChild(dag.createNode(new StubInstallArtifact()));
DeployerCompositeArtifact artifact = new DeployerCompositeArtifact(bundleContext, installArtifact, region1);
assertEquals(1, this.determiner.getDependents(artifact).size());
}
diff --git a/org.eclipse.virgo.kernel.stubs/src/main/java/org/eclipse/virgo/kernel/stubs/StubInstallArtifact.java b/org.eclipse.virgo.kernel.stubs/src/main/java/org/eclipse/virgo/kernel/stubs/StubInstallArtifact.java
index c138f97a..6ee96fa8 100644
--- a/org.eclipse.virgo.kernel.stubs/src/main/java/org/eclipse/virgo/kernel/stubs/StubInstallArtifact.java
+++ b/org.eclipse.virgo.kernel.stubs/src/main/java/org/eclipse/virgo/kernel/stubs/StubInstallArtifact.java
@@ -82,10 +82,10 @@ public class StubInstallArtifact implements InstallArtifact {
this.artifactFS = artifactFS;
- this.graph = dag.createRootNode(this);
+ this.graph = dag.createNode(this);
for (InstallArtifact child : children) {
- this.graph.addChild(dag.createRootNode(child));
+ this.graph.addChild(dag.createNode(child));
}
}

Back to the top