notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r870 - trunk/main/depot/library/common/src/test/net/dpml/library/info
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r870 - trunk/main/depot/library/common/src/test/net/dpml/library/info
- Date: Sat, 7 Jan 2006 18:46:01 +0100
Author: mcconnell
Date: 2006-01-07 18:45:59 +0100 (Sat, 07 Jan 2006)
New Revision: 870
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/AbstractTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/DependencyDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/ImportDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/IncludeDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/LibraryDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
trunk/main/depot/library/common/src/test/net/dpml/library/info/TypeDirectiveTestCase.java
Log:
resolve all checkstyle issues in the library package
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/AbstractTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/AbstractTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/AbstractTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -27,18 +27,15 @@
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;
/**
- * The ModuleDirective class describes a module data-structure.
+ * AbstractTestCase.
*
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/DependencyDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/DependencyDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/DependencyDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -18,8 +18,6 @@
package net.dpml.library.info;
-import net.dpml.transit.Category;
-
/**
* The ModuleDirective class describes a module data-structure.
*
@@ -28,8 +26,8 @@
*/
public final class DependencyDirectiveTestCase extends AbstractTestCase
{
- static IncludeDirective[] INCLUDES = IncludeDirectiveTestCase.INCLUDES;
- static DependencyDirective[] DEPENDENCIES = new DependencyDirective[3];
+ static final IncludeDirective[] INCLUDES =
IncludeDirectiveTestCase.INCLUDES;
+ static final DependencyDirective[] DEPENDENCIES = new
DependencyDirective[3];
static
{
DEPENDENCIES[0] = new DependencyDirective( Scope.BUILD, INCLUDES,
PROPERTIES );
@@ -37,6 +35,9 @@
DEPENDENCIES[2] = new DependencyDirective( Scope.TEST, INCLUDES,
PROPERTIES );
}
+ /**
+ * Test null scope.
+ */
public void testNullScope()
{
try
@@ -51,6 +52,9 @@
}
}
+ /**
+ * Test null includes.
+ */
public void testNullIncludes()
{
try
@@ -65,6 +69,9 @@
}
}
+ /**
+ * Test runtime scope.
+ */
public void testScopeRuntime()
{
DependencyDirective dep =
@@ -72,6 +79,9 @@
assertEquals( "scope", Scope.RUNTIME, dep.getScope() );
}
+ /**
+ * Test test scope.
+ */
public void testScopeTest()
{
DependencyDirective dep =
@@ -79,18 +89,29 @@
assertEquals( "scope", Scope.TEST, dep.getScope() );
}
+ /**
+ * Test includes.
+ */
public void testIncludes()
{
DependencyDirective dep = new DependencyDirective( Scope.RUNTIME,
INCLUDES, PROPERTIES );
assertEquals( "includes", 3, dep.getIncludeDirectives().length );
}
+ /**
+ * Test directive serialization.
+ * @exception Exception if the serailization test raises an error
+ */
public void testSerialization() throws Exception
{
DependencyDirective dep = new DependencyDirective( Scope.RUNTIME,
INCLUDES, PROPERTIES );
doSerializationTest( dep );
}
+ /**
+ * Test directive encoding and decoding.
+ * @exception Exception if the test raises an error
+ */
public void testXMLEncoding() throws Exception
{
DependencyDirective dep = new DependencyDirective( Scope.RUNTIME,
INCLUDES, PROPERTIES );
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/ImportDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/ImportDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/ImportDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -26,7 +26,7 @@
*/
public final class ImportDirectiveTestCase extends AbstractTestCase
{
- static ImportDirective[] IMPORTS = new ImportDirective[3];
+ static final ImportDirective[] IMPORTS = new ImportDirective[3];
static
{
IMPORTS[0] = new ImportDirective( ImportDirective.URI, "something",
PROPERTIES );
@@ -34,6 +34,9 @@
IMPORTS[2] = new ImportDirective( ImportDirective.URI, "acme",
PROPERTIES );
}
+ /**
+ * Test that the import directive throws an NPE if a null name is
supplied.
+ */
public void testNullName()
{
try
@@ -47,6 +50,9 @@
}
}
+ /**
+ * Test that the import directive throws an NPE if a null value is
supplied.
+ */
public void testNullValue()
{
try
@@ -60,6 +66,9 @@
}
}
+ /**
+ * Test the import mode accessor.
+ */
public void testImportMode()
{
ImportDirective include =
@@ -67,6 +76,9 @@
assertEquals( "mode", ImportDirective.FILE, include.getMode() );
}
+ /**
+ * Test the import value accessor.
+ */
public void testImportValue()
{
ImportDirective include =
@@ -74,6 +86,10 @@
assertEquals( "value", "value", include.getValue() );
}
+ /**
+ * Test directive serialization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
ImportDirective include =
@@ -81,6 +97,10 @@
doSerializationTest( include );
}
+ /**
+ * Test directive encoding/decoding.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
ImportDirective include =
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/IncludeDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/IncludeDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/IncludeDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -28,7 +28,7 @@
*/
public final class IncludeDirectiveTestCase extends AbstractTestCase
{
- static IncludeDirective[] INCLUDES = new IncludeDirective[3];
+ static final IncludeDirective[] INCLUDES = new IncludeDirective[3];
static
{
INCLUDES[0] = new IncludeDirective( IncludeDirective.REF, null,
"value", PROPERTIES );
@@ -36,6 +36,9 @@
INCLUDES[2] = new IncludeDirective( IncludeDirective.REF,
Category.PUBLIC, "value", PROPERTIES );
}
+ /**
+ * Test that an NPE is thrown when the null mode is supplied as a
constructor argument.
+ */
public void testNullMode()
{
try
@@ -49,6 +52,9 @@
}
}
+ /**
+ * Test that an NPE is thrown when the null value is supplied as a
constructor argument.
+ */
public void testNullValue()
{
try
@@ -62,6 +68,9 @@
}
}
+ /**
+ * Test the mode accessor.
+ */
public void testIncludeMode()
{
IncludeDirective include =
@@ -69,6 +78,9 @@
assertEquals( "mode", IncludeDirective.REF, include.getMode() );
}
+ /**
+ * Test the value accessor.
+ */
public void testIncludeValue()
{
IncludeDirective include =
@@ -76,6 +88,9 @@
assertEquals( "value", "value", include.getValue() );
}
+ /**
+ * Test include classloader category.
+ */
public void testIncludeCategory()
{
IncludeDirective include =
@@ -83,6 +98,10 @@
assertEquals( "category", Category.PROTECTED, include.getCategory()
);
}
+ /**
+ * Test serialization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
IncludeDirective include =
@@ -90,6 +109,10 @@
doSerializationTest( include );
}
+ /**
+ * Test encoding/decoding.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
IncludeDirective include =
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/LibraryDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/LibraryDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/LibraryDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -26,17 +26,25 @@
*/
public final class LibraryDirectiveTestCase extends AbstractTestCase
{
- static ImportDirective[] IMPORTS = ImportDirectiveTestCase.IMPORTS;
- static ModuleDirective[] MODULES = ModuleDirectiveTestCase.MODULES;
+ static final ImportDirective[] IMPORTS = ImportDirectiveTestCase.IMPORTS;
+ static final ModuleDirective[] MODULES = ModuleDirectiveTestCase.MODULES;
private LibraryDirective m_library;
+ /**
+ * Setup the testcase.
+ * @exception Exception if an error occurs during setup
+ */
public void setUp() throws Exception
{
m_library =
new LibraryDirective( IMPORTS, MODULES, PROPERTIES );
}
+ /**
+ * Validate that the imports argument to the library directive
+ * throws an NPE when supplied with a null imports value.
+ */
public void testNullImports()
{
try
@@ -50,16 +58,27 @@
}
}
+ /**
+ * Test the imports accessor.
+ */
public void testImportDirectives()
{
assertEquals( "imports", IMPORTS, m_library.getImportDirectives() );
}
+ /**
+ * Test serialization of the library directive.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
doSerializationTest( m_library );
}
+ /**
+ * Test encoding/decoding of the library directive.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
doEncodingTest( m_library, "library-encoded.xml" );
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/ModuleDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -28,7 +28,7 @@
*/
public final class ModuleDirectiveTestCase extends AbstractTestCase
{
- static ModuleDirective[] MODULES = new ModuleDirective[3];
+ static final ModuleDirective[] MODULES = new ModuleDirective[3];
static
{
TypeDirective[] types = TypeDirectiveTestCase.TYPES;
@@ -56,6 +56,10 @@
private ModuleDirective m_module;
+ /**
+ * Test case setup.
+ * @exception Exception if a setup error occurs
+ */
public void setUp() throws Exception
{
m_module =
@@ -63,6 +67,10 @@
m_name, m_version, m_classifier, "test", m_types,
m_dependencies, m_resources, PROPERTIES );
}
+ /**
+ * Validate that the name argument to the module directive
+ * throws an NPE when supplied with a null name.
+ */
public void testNullName()
{
try
@@ -77,6 +85,10 @@
}
}
+ /**
+ * Validate that the module directive constructor
+ * throws an NPE when supplied with a null version.
+ */
public void testNullVersion()
{
try
@@ -90,6 +102,10 @@
}
}
+ /**
+ * Validate that the module directive constructor
+ * throws an NPE when supplied with a null dependencies array.
+ */
public void testNullDependencies()
{
try
@@ -104,6 +120,10 @@
}
}
+ /**
+ * Validate that the module directive constructor
+ * throws an NPE when supplied with a null resources array.
+ */
public void testNullResources()
{
try
@@ -118,36 +138,59 @@
}
}
+ /**
+ * Test the name accessor.
+ */
public void testName()
{
assertEquals( "name", m_name, m_module.getName() );
}
+ /**
+ * Test the classifier accessor.
+ */
public void testClassifier()
{
assertEquals( "classifier", m_classifier, m_module.getClassifier() );
}
+ /**
+ * Test the version accessor.
+ */
public void testVersion()
{
assertEquals( "version", m_version, m_module.getVersion() );
}
+ /**
+ * Test the dependency directives accessor.
+ */
public void testDependencyDirectives()
{
assertEquals( "dependencies", m_dependencies,
m_module.getDependencyDirectives() );
}
+ /**
+ * Test the resource directives accessor.
+ */
public void testResourceDirectives()
{
assertEquals( "resources", m_resources,
m_module.getResourceDirectives() );
}
+ /**
+ * Test directive serialization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
doSerializationTest( m_module );
}
+ /**
+ * Test directive encoding/decoding.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
doEncodingTest( m_module, "module-descriptor-encoded.xml" );
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/ResourceDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -29,18 +29,28 @@
*/
public final class ResourceDirectiveTestCase extends AbstractTestCase
{
- static Classifier CLASSIFIER = ResourceDirective.LOCAL;
- static DependencyDirective[] DEPENDENCIES =
DependencyDirectiveTestCase.DEPENDENCIES;
- static TypeDirective[] TYPES = TypeDirectiveTestCase.TYPES;
+ static final Classifier CLASSIFIER = ResourceDirective.LOCAL;
+ static final DependencyDirective[] DEPENDENCIES =
DependencyDirectiveTestCase.DEPENDENCIES;
+ static final TypeDirective[] TYPES = TypeDirectiveTestCase.TYPES;
+ static final ResourceDirective[] RESOURCES = new ResourceDirective[3];
- static ResourceDirective[] RESOURCES = new ResourceDirective[3];
static
{
- RESOURCES[0] = new ResourceDirective( "fred", null, CLASSIFIER,
"example/fred", TYPES, DEPENDENCIES, PROPERTIES );
- RESOURCES[1] = new ResourceDirective( "george", "1.3.0", CLASSIFIER,
"example/george", TYPES, DEPENDENCIES, PROPERTIES );
- RESOURCES[2] = new ResourceDirective( "mary", "2.7", CLASSIFIER,
"example/mary", TYPES, DEPENDENCIES, PROPERTIES );
+ RESOURCES[0] =
+ new ResourceDirective(
+ "fred", null, CLASSIFIER, "example/fred", TYPES, DEPENDENCIES,
PROPERTIES );
+ RESOURCES[1] =
+ new ResourceDirective(
+ "george", "1.3.0", CLASSIFIER, "example/george", TYPES,
DEPENDENCIES, PROPERTIES );
+ RESOURCES[2] =
+ new ResourceDirective(
+ "mary", "2.7", CLASSIFIER, "example/mary", TYPES, DEPENDENCIES,
PROPERTIES );
}
-
+
+ /**
+ * Validate that the resource directive constructor
+ * throws an NPE when supplied with a null name.
+ */
public void testNullName()
{
try
@@ -55,6 +65,10 @@
}
}
+ /**
+ * Validate that the resource directive constructor
+ * throws an NPE when supplied with a null type array.
+ */
public void testNullTypes()
{
try
@@ -69,6 +83,10 @@
}
}
+ /**
+ * Validate that the resource directive constructor
+ * throws an NPE when supplied with a null dependencies array.
+ */
public void testNullDependencies()
{
try
@@ -83,48 +101,88 @@
}
}
+ /**
+ * Test the name accessor.
+ */
public void testResourceName()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "name", "resource", resource.getName() );
}
+ /**
+ * Test the version accessor.
+ */
public void testResourceVersion()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "version", "2.7", resource.getVersion() );
}
+ /**
+ * Test the basedir accessor.
+ */
public void testResourceBasedir()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "basedir", "test", resource.getBasedir() );
}
+ /**
+ * Test the types array accessor.
+ */
public void testResourceTypes()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "types", 3, resource.getTypeDirectives().length );
}
+ /**
+ * Test the dependencies array accessor.
+ */
public void testDependencyDirectives()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "dependencies", 3,
resource.getDependencyDirectives().length );
}
+ /**
+ * Test the properties accessor.
+ */
public void testResourceProperties()
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
assertEquals( "properties", PROPERTIES, resource.getProperties() );
}
+ /**
+ * Test the directive serailization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
- ResourceDirective resource = new ResourceDirective( "resource",
"2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES, PROPERTIES );
+ ResourceDirective resource =
+ new ResourceDirective(
+ "resource", "2.7", CLASSIFIER, "test", TYPES, DEPENDENCIES,
PROPERTIES );
doSerializationTest( resource );
}
+ /**
+ * Test the directive encoding/decoding.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
ResourceDirective resource =
Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/info/TypeDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/info/TypeDirectiveTestCase.java
2006-01-07 17:11:02 UTC (rev 869)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/info/TypeDirectiveTestCase.java
2006-01-07 17:45:59 UTC (rev 870)
@@ -26,14 +26,18 @@
*/
public final class TypeDirectiveTestCase extends AbstractTestCase
{
- static TypeDirective[] TYPES = new TypeDirective[3];
+ static final TypeDirective[] TYPES = new TypeDirective[3];
static
{
TYPES[0] = new TypeDirective( "jar", false, PROPERTIES );
- TYPES[1] = new TypeDirective( "plugin", true ,PROPERTIES );
+ TYPES[1] = new TypeDirective( "plugin", true, PROPERTIES );
TYPES[2] = new TypeDirective( "widget", false, PROPERTIES );
}
+ /**
+ * Validate that the type directive constructor
+ * throws an NPE when supplied with a null name.
+ */
public void testNullName()
{
try
@@ -47,12 +51,18 @@
}
}
+ /**
+ * Test the type directive name accessor.
+ */
public void testTypeName()
{
TypeDirective type = new TypeDirective( "abc", true, PROPERTIES );
assertEquals( "type", "abc", type.getName() );
}
+ /**
+ * Test the type directive alias accessor.
+ */
public void testTypeAlias()
{
TypeDirective type = new TypeDirective( "abc", true, PROPERTIES );
@@ -61,12 +71,20 @@
assertFalse( "alias", type.getAlias() );
}
+ /**
+ * Test the type directive serialization.
+ * @exception Exception if an error occurs
+ */
public void testSerialization() throws Exception
{
TypeDirective type = new TypeDirective( "abc", true, PROPERTIES );
doSerializationTest( type );
}
+ /**
+ * Test the type directive encoding/decoding.
+ * @exception Exception if an error occurs
+ */
public void testXMLEncoding() throws Exception
{
TypeDirective type = new TypeDirective( "abc", true, PROPERTIES );
- r870 - trunk/main/depot/library/common/src/test/net/dpml/library/info, mcconnell at BerliOS, 01/07/2006
Archive powered by MHonArc 2.6.24.