continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r822534 - /continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Date Tue, 06 Oct 2009 23:16:29 GMT
Author: ctan
Date: Tue Oct  6 23:16:28 2009
New Revision: 822534

URL: http://svn.apache.org/viewvc?rev=822534&view=rev
Log:
added unit test for removing a project with build result

Modified:
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=822534&r1=822533&r2=822534&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Tue Oct  6 23:16:28 2009
@@ -165,6 +165,47 @@
         project = continuum.getProject( project.getId() );
     }
 
+    public void testRemoveMavenTwoProject()
+        throws Exception
+    {
+        Continuum continuum = (Continuum) lookup( Continuum.ROLE );
+
+        String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
+
+        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url );
+
+        assertNotNull( result );
+
+        List<Project> projects = result.getProjects();
+
+        assertEquals( 1, projects.size() );
+
+        assertEquals( Project.class, projects.get( 0 ).getClass() );
+
+        Project project = projects.get( 0 );
+
+        continuum.buildProject( project.getId() );
+
+        // wait for build to finish
+        Thread.sleep( 5000 );
+
+        // delete project
+        continuum.removeProject( project.getId() );
+
+        try
+        {
+            project = continuum.getProject( project.getId() );
+            
+            assertNull( project );
+
+            fail( "Project was not removed" );
+        }
+        catch ( Exception e )
+        {
+            // successfully removed project
+        }
+    }
+
     public void testBuildDefinitions()
         throws Exception
     {



Mime
View raw message