continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r822535 - /continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Date Tue, 06 Oct 2009 23:17:35 GMT
Author: ctan
Date: Tue Oct  6 23:17:34 2009
New Revision: 822535

URL: http://svn.apache.org/viewvc?rev=822535&view=rev
Log:
added a unit test for removing a project with build result
merge -r 822533:822534 from 1.3.x branch

Modified:
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=822535&r1=822534&r2=822535&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Tue Oct  6 23:17:34 2009
@@ -166,6 +166,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