Skip to Content.
Sympa Menu

notify-dpml - r1247 - in trunk/main/util: . job/api/src job/api/src/test job/api/src/test/net job/api/src/test/net/dpml job/api/src/test/net/dpml/job job/api/src/test/net/dpml/job/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1247 - in trunk/main/util: . job/api/src job/api/src/test job/api/src/test/net job/api/src/test/net/dpml job/api/src/test/net/dpml/job job/api/src/test/net/dpml/job/test
  • Date: Wed, 22 Mar 2006 19:18:17 +0100

Author: mcconnell
Date: 2006-03-22 19:18:03 +0100 (Wed, 22 Mar 2006)
New Revision: 1247

Added:
trunk/main/util/job/api/src/test/
trunk/main/util/job/api/src/test/net/
trunk/main/util/job/api/src/test/net/dpml/
trunk/main/util/job/api/src/test/net/dpml/job/
trunk/main/util/job/api/src/test/net/dpml/job/test/

trunk/main/util/job/api/src/test/net/dpml/job/test/CommissionerEventTestCase.java

trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutErrorTestCase.java

trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutExceptionTestCase.java
Modified:
trunk/main/util/module.xml
Log:
add some job api related tests

Added:
trunk/main/util/job/api/src/test/net/dpml/job/test/CommissionerEventTestCase.java
===================================================================
---
trunk/main/util/job/api/src/test/net/dpml/job/test/CommissionerEventTestCase.java
2006-03-22 17:18:47 UTC (rev 1246)
+++
trunk/main/util/job/api/src/test/net/dpml/job/test/CommissionerEventTestCase.java
2006-03-22 18:18:03 UTC (rev 1247)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.job.test;
+
+import net.dpml.job.Commissionable;
+import net.dpml.job.CommissionerEvent;
+
+import junit.framework.TestCase;
+
+/**
+ * Validation of the timeout exception.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class CommissionerEventTestCase extends TestCase
+{
+
+ /**
+ * Test the commissioner event flag accessor.
+ * @exception Exception if an error occurs
+ */
+ public void testFlag() throws Exception
+ {
+ Commissionable commissionable = new MockCommissionable();
+ CommissionerEvent event = new CommissionerEvent( commissionable,
true, 0 );
+ assertEquals( "flag", true, event.isCommissioning() );
+ }
+
+ /**
+ * Test the commissioner event duration accessor.
+ * @exception Exception if an error occurs
+ */
+ public void testDuration() throws Exception
+ {
+ Commissionable commissionable = new MockCommissionable();
+ CommissionerEvent event = new CommissionerEvent( commissionable,
true, 0 );
+ assertEquals( "timeout", 0, event.getDuration() );
+ }
+
+ /**
+ * Test the commissioner event source accessor.
+ * @exception Exception if an error occurs
+ */
+ public void testSource() throws Exception
+ {
+ Commissionable commissionable = new MockCommissionable();
+ CommissionerEvent event = new CommissionerEvent( commissionable,
true, 0 );
+ assertEquals( "source", commissionable, event.getSource() );
+ }
+
+ private class MockCommissionable implements Commissionable
+ {
+ /**
+ * Commission the object.
+ * @throws Exception if a error occurs
+ */
+ public void commission() throws Exception
+ {
+ }
+
+ /**
+ * Decommission the object.
+ */
+ public void decommission()
+ {
+ }
+ }
+
+}

Added:
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutErrorTestCase.java
===================================================================
---
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutErrorTestCase.java
2006-03-22 17:18:47 UTC (rev 1246)
+++
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutErrorTestCase.java
2006-03-22 18:18:03 UTC (rev 1247)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.job.test;
+
+import net.dpml.job.TimeoutError;
+
+import junit.framework.TestCase;
+
+/**
+ * Validation of the timeout exception.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class TimeoutErrorTestCase extends TestCase
+{
+
+ /**
+ * Test the commissioner implementation.
+ * @exception Exception if an error occurs
+ */
+ public void testDurationValue() throws Exception
+ {
+ long timeout = 1;
+ TimeoutError exception = new TimeoutError( timeout );
+ assertEquals( "timeout", timeout, exception.getDuration() );
+ }
+}

Added:
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutExceptionTestCase.java
===================================================================
---
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutExceptionTestCase.java
2006-03-22 17:18:47 UTC (rev 1246)
+++
trunk/main/util/job/api/src/test/net/dpml/job/test/TimeoutExceptionTestCase.java
2006-03-22 18:18:03 UTC (rev 1247)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.job.test;
+
+import net.dpml.job.TimeoutException;
+
+import junit.framework.TestCase;
+
+/**
+ * Validation of the timeout exception.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class TimeoutExceptionTestCase extends TestCase
+{
+
+ /**
+ * Test the commissioner implementation.
+ * @exception Exception if an error occurs
+ */
+ public void testDurationValue() throws Exception
+ {
+ long timeout = 1;
+ TimeoutException exception = new TimeoutException( timeout );
+ assertEquals( "timeout", timeout, exception.getDuration() );
+ }
+}

Modified: trunk/main/util/module.xml
===================================================================
--- trunk/main/util/module.xml 2006-03-22 17:18:47 UTC (rev 1246)
+++ trunk/main/util/module.xml 2006-03-22 18:18:03 UTC (rev 1247)
@@ -11,6 +11,9 @@
<types>
<type id="jar"/>
</types>
+ <dependencies scope="test">
+ <include ref="ant/ant-junit"/>
+ </dependencies>
</project>

<project name="dpml-job-impl" basedir="job/impl">
@@ -22,9 +25,9 @@
</types>
<dependencies>
<include ref="dpml/util/dpml-job-api"/>
- <include ref="dpml/transit/dpml-transit-main"/>
</dependencies>
<dependencies scope="test">
+ <include ref="dpml/transit/dpml-transit-main"/>
<include ref="ant/ant-junit"/>
</dependencies>
</project>




  • r1247 - in trunk/main/util: . job/api/src job/api/src/test job/api/src/test/net job/api/src/test/net/dpml job/api/src/test/net/dpml/job job/api/src/test/net/dpml/job/test, mcconnell at BerliOS, 03/22/2006

Archive powered by MHonArc 2.6.24.

Top of Page