Skip to Content.
Sympa Menu

notify-dpml - r872 - trunk/main/depot/tools/builder/src/test/net/dpml/tools/info

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: r872 - trunk/main/depot/tools/builder/src/test/net/dpml/tools/info
  • Date: Sat, 7 Jan 2006 19:14:00 +0100

Author: mcconnell
Date: 2006-01-07 19:13:58 +0100 (Sat, 07 Jan 2006)
New Revision: 872

Modified:

trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/AbstractTestCase.java

trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/ListenerDirectiveTestCase.java
Log:
resolve depot test package checkstyle issues

Modified:
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/AbstractTestCase.java
===================================================================
---
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/AbstractTestCase.java
2006-01-07 17:46:59 UTC (rev 871)
+++
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/AbstractTestCase.java
2006-01-07 18:13:58 UTC (rev 872)
@@ -22,17 +22,6 @@
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.BufferedOutputStream;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.beans.Encoder;
-import java.beans.XMLDecoder;
-import java.beans.XMLEncoder;
-import java.beans.ExceptionListener;
-import java.beans.Expression;
import java.util.Properties;

import junit.framework.TestCase;
@@ -44,8 +33,16 @@
*/
abstract class AbstractTestCase extends TestCase
{
+ /**
+ * Test properties.
+ */
public static final Properties PROPERTIES = new Properties();

+ /**
+ * Test directive serialization.
+ * @param object the object to serialize
+ * @exception Exception if an error occurs
+ */
public void doSerializationTest( Object object )
throws Exception
{

Modified:
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/ListenerDirectiveTestCase.java
===================================================================
---
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/ListenerDirectiveTestCase.java
2006-01-07 17:46:59 UTC (rev 871)
+++
trunk/main/depot/tools/builder/src/test/net/dpml/tools/info/ListenerDirectiveTestCase.java
2006-01-07 18:13:58 UTC (rev 872)
@@ -27,13 +27,13 @@
*/
public final class ListenerDirectiveTestCase extends AbstractTestCase
{
- static String NAME = "test";
- static String SPEC = "local:plugin:acme/widget";
- static String CLASSNAME = "net.dpml.tools.process.JarProcess";
- static String[] DEPS = new String[0];
- static boolean ARTIFACT = true;
+ static final String NAME = "test";
+ static final String SPEC = "local:plugin:acme/widget";
+ static final String CLASSNAME = "net.dpml.tools.process.JarProcess";
+ static final String[] DEPS = new String[0];
+ static final boolean ARTIFACT = true;
+ static final ListenerDirective[] LISTENERS = new ListenerDirective[3];

- static ListenerDirective[] LISTENERS = new ListenerDirective[3];
static
{
try
@@ -46,7 +46,7 @@
"acme", new URI( SPEC ), null, ARTIFACT, DEPS, PROPERTIES );
LISTENERS[2] =
new ListenerDirective(
- "widget", (URI) null, CLASSNAME, ARTIFACT, new String[]{
"acme" }, PROPERTIES );
+ "widget", (URI) null, CLASSNAME, ARTIFACT, new
String[]{"acme"}, PROPERTIES );
}
catch( Exception e )
{
@@ -54,6 +54,11 @@
}
}

+ /**
+ * Validate that the listener directive constructor throws an NPE
+ * when supplied with a null name.
+ * @exception Exception if an error occurs
+ */
public void testNullName() throws Exception
{
try
@@ -68,6 +73,11 @@
}
}

+ /**
+ * Validate that the listener directive constructor throws an NPE
+ * when supplied with a null depends argument.
+ * @exception Exception if an error occurs
+ */
public void testNullDepends() throws Exception
{
try
@@ -82,6 +92,10 @@
}
}

+ /**
+ * Test name accessor.
+ * @exception Exception if an error occurs
+ */
public void testProcessName() throws Exception
{
ListenerDirective process =
@@ -90,6 +104,10 @@
assertEquals( "name", NAME, process.getName() );
}

+ /**
+ * Test uri spec accessor.
+ * @exception Exception if an error occurs
+ */
public void testProcessURN() throws Exception
{
ListenerDirective process =
@@ -98,21 +116,29 @@
assertEquals( "uri", SPEC, process.getURISpec() );
}

+ /**
+ * Test dependencies accessor.
+ * @exception Exception if an error occurs
+ */
public void testDependencies() throws Exception
{
String dep1 = "abc";
String dep2 = "def";
- String[] deps = new String[]{ dep1, dep2 };
+ String[] deps = new String[]{dep1, dep2};
ListenerDirective process =
new ListenerDirective( NAME, new URI( SPEC ), CLASSNAME, ARTIFACT,
deps, PROPERTIES );
assertEquals( "deps", deps, process.getDependencies() );
}

+ /**
+ * Test directive serialization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
String dep1 = "abc";
String dep2 = "def";
- String[] deps = new String[]{ dep1, dep2 };
+ String[] deps = new String[]{dep1, dep2};
ListenerDirective process =
new ListenerDirective( NAME, new URI( SPEC ), CLASSNAME, ARTIFACT,
deps, PROPERTIES );
doSerializationTest( process );




  • r872 - trunk/main/depot/tools/builder/src/test/net/dpml/tools/info, mcconnell at BerliOS, 01/07/2006

Archive powered by MHonArc 2.6.24.

Top of Page