continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r168106 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/ main/java/org/apache/maven/continuum/buildqueue/ main/resources/META-INF/plexus/ test/java/org/apache/maven/continuum/buildqueue/
Date Wed, 04 May 2005 09:35:46 GMT
Author: trygvis
Date: Wed May  4 02:35:46 2005
New Revision: 168106

URL: http://svn.apache.org/viewcvs?rev=168106&view=rev
Log:
o Removing the old build queue code, it's all handled by plexus-taskqueue now.
o Switching the build queue tests to use the task queue instead.

Removed:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/BuilderThread.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/AbstractBuildQueue.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/SimpleBuildQueue.java
Modified:
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=168106&r1=168105&r2=168106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Wed May  4 02:35:46 2005
@@ -82,17 +82,6 @@
         </requirement>
       </requirements>
     </component>
-<!-- TODO: remove -->
-    <component>
-      <role>org.apache.maven.continuum.buildqueue.BuildQueue</role>
-      <implementation>org.apache.maven.continuum.buildqueue.DefaultBuildQueue</implementation>
-      <requirements>
-        <requirement>
-          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>build-project</role-hint>
-        </requirement>
-      </requirements>
-    </component>
 
     <component>
       <role>org.apache.maven.continuum.store.ContinuumStore</role>

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java?rev=168106&r1=168105&r2=168106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
Wed May  4 02:35:46 2005
@@ -16,12 +16,12 @@
  * limitations under the License.
  */
 
-import java.util.Properties;
-
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ModelloJPoxContinuumStoreTest;
 
 import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.TaskQueue;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -30,7 +30,7 @@
 public class BuildQueueTest
     extends PlexusTestCase
 {
-    private BuildQueue buildQueue;
+    private TaskQueue buildQueue;
 
     private ContinuumStore store;
 
@@ -39,7 +39,7 @@
     {
         super.setUp();
 
-        buildQueue = (BuildQueue) lookup( BuildQueue.ROLE );
+        buildQueue = (TaskQueue) lookup( TaskQueue.ROLE, "build-project" );
 
         store = (ContinuumStore) lookup( ContinuumStore.ROLE );
     }
@@ -119,7 +119,7 @@
     {
         String buildId = store.createBuild( projectId );
 
-        buildQueue.enqueue( projectId, buildId );
+        buildQueue.put( new BuildProjectTask( projectId, buildId ) );
 
         return buildId;
     }
@@ -127,18 +127,23 @@
     private void assertNextBuildIs( String expectedBuildId )
         throws Exception
     {
-        String actualBuildId = buildQueue.dequeue();
+        Task task = buildQueue.take();
+
+        assertEquals( BuildProjectTask.class.getName(), task.getClass().getName() );
 
-        assertNotNull( "Got a null build id returned.", actualBuildId );
+        BuildProjectTask buildProjectTask = ( BuildProjectTask ) task;
 
-        assertEquals( "Didn't get the expected build id.", expectedBuildId, actualBuildId
);
+        assertEquals( "Didn't get the expected build id.", expectedBuildId, buildProjectTask.getBuildId()
);
     }
 
     private void assertNextBuildIsNull()
         throws Exception
     {
-        String actualBuildId = buildQueue.dequeue();
+        Task task = buildQueue.take();
 
-        assertNull( "Got a non-null build id returned: " + actualBuildId, actualBuildId );
+        if ( task != null )
+        {
+            fail( "Got a non-null build id returned: " + (( BuildProjectTask ) task ).getBuildId()
);
+        }
     }
 }



Mime
View raw message