avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oberh...@apache.org
Subject svn commit: rev 37279 - in avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse: core/templateengine/test ui
Date Wed, 01 Sep 2004 03:08:09 GMT
Author: oberhack
Date: Tue Aug 31 20:08:08 2004
New Revision: 37279

Added:
   avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/BlockProjectManagerBasicTest.java
      - copied, changed from rev 36389, avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ProjectManagerBasicTest.java
Removed:
   avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/ui/
Modified:
   avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/AllCoreTests.java
   avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/DirectoryTemplateManagerTest.java
   avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ResourceTemplateManagerTest.java
Log:


Modified: avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/AllCoreTests.java
==============================================================================
--- avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/AllCoreTests.java
(original)
+++ avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/AllCoreTests.java
Tue Aug 31 20:08:08 2004
@@ -34,7 +34,7 @@
         TestSuite suite = new TestSuite(
                 "Test for org.apache.metro.studio.eclipse.core.templateengine");
         //$JUnit-BEGIN$
-        suite.addTestSuite(ProjectManagerBasicTest.class);
+        suite.addTestSuite(BlockProjectManagerBasicTest.class);
         suite.addTestSuite(DirectoryTemplateManagerTest.class);
         suite.addTestSuite(ResourceTemplateManagerTest.class);
         //$JUnit-END$

Copied: avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/BlockProjectManagerBasicTest.java
(from rev 36389, avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ProjectManagerBasicTest.java)
==============================================================================
--- avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ProjectManagerBasicTest.java
(original)
+++ avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/BlockProjectManagerBasicTest.java
Tue Aug 31 20:08:08 2004
@@ -19,7 +19,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.metro.studio.eclipse.core.templateengine.ProjectManager;
+import org.apache.metro.studio.eclipse.core.templateengine.BlockProjectManager;
 import org.apache.metro.studio.eclipse.core.templateengine.ResourceTemplate;
 import org.eclipse.core.resources.IProject;
 
@@ -37,7 +37,7 @@
  * last change: 
  * 
  */
-public class ProjectManagerBasicTest extends TestCase
+public class BlockProjectManagerBasicTest extends TestCase
 {
 
     private static IProject project;
@@ -50,12 +50,13 @@
     {
         ResourceTemplate template;
         
-        project = ProjectManager.createBlockProject("EmptyBlock");
+        project = BlockProjectManager.testCreateProject("EmptyBlock");
+        
     }
 
     public final void testDelete()
     {
-        ProjectManager.delete(project);
+        BlockProjectManager.delete(project);
     }
 
 }

Modified: avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/DirectoryTemplateManagerTest.java
==============================================================================
--- avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/DirectoryTemplateManagerTest.java
(original)
+++ avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/DirectoryTemplateManagerTest.java
Tue Aug 31 20:08:08 2004
@@ -27,10 +27,10 @@
 import junit.framework.TestCase;
 
 import org.apache.metro.studio.eclipse.core.MetroStudioCore;
+import org.apache.metro.studio.eclipse.core.templateengine.BlockProjectManager;
 import org.apache.metro.studio.eclipse.core.templateengine.Directory;
 import org.apache.metro.studio.eclipse.core.templateengine.DirectoryTemplate;
 import org.apache.metro.studio.eclipse.core.templateengine.DirectoryTemplateManager;
-import org.apache.metro.studio.eclipse.core.templateengine.ProjectManager;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jdt.core.IJavaProject;
@@ -91,7 +91,7 @@
      */
     public final void testCreateStandardBlockProject()
     {
-        project = ProjectManager.createBlockProject("StandardBlockTest");
+        project = BlockProjectManager.testCreateProject("StandardBlockTest");
         DirectoryTemplateManager m = DirectoryTemplateManager.load(configFileLocation);
         m.create("StandardBlock", project.getProject());
         
@@ -114,8 +114,8 @@
         
         DirectoryTemplateManager m = DirectoryTemplateManager.load(configFileLocation);
         DirectoryTemplate template = m.getTemplate("StandardBlock");
-        Vector libNames = m.collectLibraries(template, m.getRepositoryPath());
-        Vector sourceNames = m.collectSourceFolders(template, project);
+
+        Vector sourceFolders = template.getSourceFolderNames();
         
         try
         {
@@ -137,10 +137,9 @@
             fail("can't retrieve project libraries");
         }
         
-        assertEquals("not all required libs are created", libNames.size(), libCount);
-        assertEquals("not all required sourcedirectories are created", sourceNames.size(),
sourceCount);
+        assertEquals("not all required sourcedirectories are created", sourceFolders.size(),
sourceCount);
         
-        ProjectManager.delete(project);
+        BlockProjectManager.delete(project);
     }
 
     /**
@@ -150,7 +149,7 @@
      */
     public final void testCreateImplApiBlockProject()
     {
-        project = ProjectManager.createBlockProject("ImplApiTest");
+        project = BlockProjectManager.create("ImplApiTest", null);
         DirectoryTemplateManager m = DirectoryTemplateManager.load(configFileLocation);
         m.create("ImplApiBlock", project.getProject());
         
@@ -174,9 +173,9 @@
         
         DirectoryTemplateManager m = DirectoryTemplateManager.load(configFileLocation);
         DirectoryTemplate template = m.getTemplate("ImplApiBlock");
-        Vector libNames = m.collectLibraries(template, m.getRepositoryPath());
-        Vector sourceNames = m.collectSourceFolders(template, project);
         
+        Vector sourceFolders = template.getSourceFolderNames();
+
         try
         {
             IJavaProject javaProject = JavaCore.create(project);
@@ -197,8 +196,7 @@
             fail("can't retrieve project libraries");
         }
         
-        assertEquals("not all required libs are created", libNames.size(), libCount);
-        assertEquals("not all required sourcedirectories are created", sourceNames.size(),
sourceCount);
+        assertEquals("not all required sourcedirectories are created", sourceFolders.size(),
sourceCount);
     }
 
     /**

Modified: avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ResourceTemplateManagerTest.java
==============================================================================
--- avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ResourceTemplateManagerTest.java
(original)
+++ avalon/trunk/central/laboratory/studio/eclipse/core/test/org/apache/metro/studio/eclipse/core/templateengine/test/ResourceTemplateManagerTest.java
Tue Aug 31 20:08:08 2004
@@ -25,12 +25,12 @@
 import junit.framework.TestCase;
 
 import org.apache.metro.studio.eclipse.core.MetroStudioCore;
+import org.apache.metro.studio.eclipse.core.templateengine.BlockProjectManager;
 import org.apache.metro.studio.eclipse.core.templateengine.DirectoryTemplateManager;
-import org.apache.metro.studio.eclipse.core.templateengine.ProjectManager;
+import org.apache.metro.studio.eclipse.core.templateengine.Library;
 import org.apache.metro.studio.eclipse.core.templateengine.Resource;
 import org.apache.metro.studio.eclipse.core.templateengine.ResourceTemplate;
 import org.apache.metro.studio.eclipse.core.templateengine.ResourceTemplateManager;
-import org.apache.metro.studio.eclipse.core.tools.DynProjectParam;
 import org.eclipse.core.resources.IProject;
 
 import com.thoughtworks.xstream.XStream;
@@ -88,12 +88,20 @@
 
     }
 
+    public final void testListTemplateNames()
+    {
+        String[] names = BlockProjectManager.listTemplateNames();
+        
+        ResourceTemplateManager rtm = ResourceTemplateManager.load(null);
+        int number = rtm.getResourceTemplates().size();
+        
+        assertEquals("didnt get all template names ", number, names.length);
+        
+    }
+
     public final void testCreateHelloWorldProject()
     {
-        project = ProjectManager.createBlockProject("HelloWorld Tutorial");
-        ResourceTemplateManager rm = ResourceTemplateManager
-                .load(resourcesLocation);
-        rm.create(project, "HelloWorld Tutorial", new DynProjectParam());
+        project = BlockProjectManager.create("HelloWorld Tutorial", "HelloWorld Tutorial");
         
         String testpath;
         assertEquals("Project was not created", true, (new File(project.getLocation().toString()).exists()));
@@ -107,15 +115,12 @@
 
     public final void testCreateCompositionApplicationProject()
     {
-        project = ProjectManager.createBlockProject("Composition (Application) Tutorial");
-        ResourceTemplateManager rm = ResourceTemplateManager
-                .load(resourcesLocation);
-        rm.create(project, "Composition (Application) Tutorial", new DynProjectParam());
+        project = BlockProjectManager.create("Composition (Application) Tutorial", "Composition
(Application) Tutorial");
         
         String testpath;
         assertEquals("Project was not created", true, (new File(project.getLocation().toString()).exists()));
         testpath = "/impl/tutorial/Application/Application.java";
-        assertEquals("HelloComponent not created", true, (new File(project.getLocation().toString()+testpath).exists()));
+        assertEquals("Composition (Application) Tutorial", true, (new File(project.getLocation().toString()+testpath).exists()));
         testpath = "/impl/BLOCK-INF/block.xml";
         assertEquals("block.xml not created", true, (new File(project.getLocation().toString()+testpath).exists()));
         testpath = "/impl/BLOCK-INF/debug.xml";
@@ -131,7 +136,12 @@
     {
         ResourceTemplate rt = new ResourceTemplate();
         rt.setTemplateId("HelloWorld Tutorial");
+        rt.setDescription("this is the hello world help");
         rt.setDirectoryType("StandardBlock");
+        Library library = new Library();
+        library.setName("avalon-framework-api");
+        library.setVersion("4.1.5");
+        rt.addLibrary(library);
 
         Resource r = new Resource();
         r.setRootSegment("src");

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message