Skip to Content.
Sympa Menu

notify-dpml - r868 - in trunk/main/depot/library: common/src/test/net/dpml/library/impl console/etc/bin

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: r868 - in trunk/main/depot/library: common/src/test/net/dpml/library/impl console/etc/bin
  • Date: Sat, 7 Jan 2006 17:40:06 +0100

Author: mcconnell
Date: 2006-01-07 17:40:05 +0100 (Sat, 07 Jan 2006)
New Revision: 868

Modified:

trunk/main/depot/library/common/src/test/net/dpml/library/impl/AbstractTestCase.java

trunk/main/depot/library/common/src/test/net/dpml/library/impl/AnonymousTestCase.java

trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultDictionaryTestCase.java

trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultLibraryTestCase.java

trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultModuleTestCase.java

trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultResourceTestCase.java
trunk/main/depot/library/console/etc/bin/build.lap
Log:
checkstyle cleanup of testcases

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AbstractTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -44,21 +44,39 @@
import net.dpml.transit.monitor.LoggingAdapter;

/**
- * The ModuleDirective class describes a module data-structure.
+ * Abstract library testcase.
*
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
abstract class AbstractTestCase extends TestCase
{
- Logger m_logger = new LoggingAdapter( "test" );
- DefaultLibrary m_library;
+ private Logger m_logger = new LoggingAdapter( "test" );
+ private DefaultLibrary m_library;

+ /**
+ * Return the library established by setup.
+ * @return the library
+ */
+ public DefaultLibrary getLibrary()
+ {
+ return m_library;
+ }
+
+ /**
+ * Testcase setup using library.xml.
+ * @exception Exception if an error in library setup occurs
+ */
public void setUp() throws Exception
{
setUp( "library.xml" );
}

+ /**
+ * Testcase setup.
+ * @param path file path relative to the target/test directory
+ * @exception Exception if an error in library setup occurs
+ */
public void setUp( String path ) throws Exception
{
String testPath = System.getProperty( "project.test.dir" );
@@ -67,6 +85,12 @@
m_library = new DefaultLibrary( m_logger, example );
}

+ /**
+ * Test that the supplied object can be serialized and the deserialization
+ * process returns an equivalent object to the supplied object.
+ * @param object the object to test
+ * @exception Exception if an test exception occurs
+ */
public void doSerializationTest( Object object )
throws Exception
{
@@ -85,6 +109,12 @@
assertEquals( object.hashCode(), serialized.hashCode() );
}

+ /**
+ * Test that the supplied object can be encoded and the decoding
+ * process returns an equivalent object to the supplied object.
+ * @param object the object to encode/decode
+ * @exception Exception if an test exception occurs
+ */
public Object doEncodingTest( Object object, String filename ) throws
Exception
{
String base = System.getProperty( "project.test.dir" );

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AnonymousTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AnonymousTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/AnonymousTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -50,26 +50,34 @@
}

/**
- * Test library properties.
+ * Test anonymous resource providers.
+ * @exception if a test error occurs
*/
-
public void testAnonymousResourceProviders() throws Exception
{
- Resource resource = m_library.getResource( "demo/example" );
+ Resource resource = getLibrary().getResource( "demo/example" );
Resource[] providers = resource.getAggregatedProviders(
Scope.RUNTIME, false, false );
assertEquals( "direct-providers", 1, providers.length );
}

+ /**
+ * Test anonymous module providers.
+ * @exception if a test error occurs
+ */
public void testAnonymousModuleProviders() throws Exception
{
- Module module = (Module) m_library.getResource( "demo" );
+ Module module = (Module) getLibrary().getResource( "demo" );
Resource[] providers = module.getAggregatedProviders( Scope.RUNTIME,
false, false );
assertEquals( "direct-providers", 1, providers.length );
}

+ /**
+ * Test expanded anonymous module providers.
+ * @exception if a test error occurs
+ */
public void testExpandedAnonymousModuleProviders() throws Exception
{
- Module module = (Module) m_library.getResource( "demo" );
+ Module module = (Module) getLibrary().getResource( "demo" );
Resource[] providers = module.getAggregatedProviders( Scope.RUNTIME,
true, false );
assertEquals( "expanded-providers", 2, providers.length );
boolean test = false;

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultDictionaryTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultDictionaryTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultDictionaryTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -53,10 +53,11 @@
* include the 7 properties definined in the module plus 3 properties
* defined in the library, and 4 dynamic basedir property (resulting
* in a total of 14 property names).
+ * @exception Exception if the test fails
*/
public void testModuleProperties() throws Exception
{
- Resource resource = m_library.getResource( "dpml" );
+ Resource resource = getLibrary().getResource( "dpml" );
String[] names = resource.getPropertyNames();
assertEquals( "property-count", 14, names.length );
}
@@ -66,10 +67,11 @@
* of all parent modules and the library. In the case of the
dpml-transit-main
* resource there are 3 library properties, 7 module properties, 4
dynamic
* property, and 1 resource property - resulting in a total of 15
properties.
+ * @exception Exception if the test fails
*/
public void testResourceProperties() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/transit/dpml-transit-main" );
+ Resource resource = getLibrary().getResource(
"dpml/transit/dpml-transit-main" );
String[] names = resource.getPropertyNames();
assertEquals( "property-count", 15, names.length );
}

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultLibraryTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultLibraryTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultLibraryTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -45,89 +45,93 @@
{
/**
* Test library properties.
+ * @exception Exception if the test fails
*/
public void testProperties()
{
- String[] names = m_library.getPropertyNames();
+ String[] names = getLibrary().getPropertyNames();
assertEquals( "property-count", 3, names.length );
- //for( int i=0; i<names.length; i++ )
- //{
- // System.out.println( "# " + names[i] );
- //}
}

/**
* Test correct resolution of top-level modules from the library.
+ * @exception Exception if the test fails
*/
public void testRootModuleCount()
{
- Module[] modules = m_library.getModules();
+ Module[] modules = getLibrary().getModules();
assertEquals( "top-module-count", 6, modules.length );
}

/**
* Test expanded module request and validate that the 'dpml' module
* is on the end of the stack.
+ * @exception Exception if the test fails
*/
public void testExpandedModuleCount() throws Exception
{
- Module[] modules = m_library.getAllModules();
+ Module[] modules = getLibrary().getAllModules();
assertEquals( "expanded-module-count", 10, modules.length );
- Module dpml = m_library.getModule( "dpml" );
+ Module dpml = getLibrary().getModule( "dpml" );
assertEquals( "last-module", dpml, modules[ modules.length - 1 ] );
}

/**
* Test aquisition of a named resource.
+ * @exception Exception if the test fails
*/
public void testGetResourceLevelOne() throws Exception
{
String spec = "ant";
- Resource resource = m_library.getResource( spec );
+ Resource resource = getLibrary().getResource( spec );
String path = resource.getResourcePath();
assertEquals( "spec-to-path", spec, path );
}

/**
* Test aquisition of a named resource.
+ * @exception Exception if the test fails
*/
public void testGetResourceLevelTwo() throws Exception
{
String spec = "ant/ant-junit";
- Resource resource = m_library.getResource( spec );
+ Resource resource = getLibrary().getResource( spec );
String path = resource.getResourcePath();
assertEquals( "spec-to-path", spec, path );
}

/**
* Test aquisition of a named resource.
+ * @exception Exception if the test fails
*/
public void testGetResourceLevelThree() throws Exception
{
String spec = "dpml/metro/dpml-composition-runtime";
- Resource resource = m_library.getResource( spec );
+ Resource resource = getLibrary().getResource( spec );
String path = resource.getResourcePath();
assertEquals( "spec-to-path", spec, path );
}

/**
* Test aquisition of a named module.
+ * @exception Exception if the test fails
*/
public void testGetModuleLevelOne() throws Exception
{
String spec = "dpml";
- Module module = m_library.getModule( spec );
+ Module module = getLibrary().getModule( spec );
String path = module.getResourcePath();
assertEquals( "spec-to-path", spec, path );
}

/**
* Test aquisition of a named module.
+ * @exception Exception if the test fails
*/
public void testGetModuleLevelTwo() throws Exception
{
String spec = "dpml/metro";
- Module module = m_library.getModule( spec );
+ Module module = getLibrary().getModule( spec );
String path = module.getResourcePath();
assertEquals( "spec-to-path", spec, path );
}
@@ -137,32 +141,60 @@
private String m_name;
private boolean m_alias;

+ /**
+ * Creation of a new mock type instance.
+ * @param name the type name
+ * @param alias the alias production flag
+ */
public MockType( String name, boolean alias )
{
m_name = name;
m_alias = alias;
}

+ /**
+ * Return the type name.
+ * @return the name
+ */
public String getName()
{
return m_name;
}

+ /**
+ * Return the type alias flag.
+ * @return the flag
+ */
public boolean getAlias()
{
return m_alias;
}

+ /**
+ * Return the type property names.
+ * @return the names
+ */
public String[] getPropertyNames()
{
return new String[0];
}

+ /**
+ * Return a named property value.
+ * @param key the property key (ignored)
+ * @return the value (allays returns null in mock)
+ */
public String getProperty( String key )
{
return null;
}

+ /**
+ * Return a named property value.
+ * @param key the property key (ignored)
+ * @param value the default value (ignored)
+ * @return the value (allays returns null in mock)
+ */
public String getProperty( String key, String value )
{
return value;

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultModuleTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultModuleTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultModuleTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -47,36 +47,29 @@
{
public void testExpandedAnonymousModuleProviders() throws Exception
{
- Module module = (Module) m_library.getResource( "dpml/transit" );
+ Module module = (Module) getLibrary().getResource( "dpml/transit" );
Resource[] providers = module.getAggregatedProviders( Scope.RUNTIME,
true, false );
- //System.out.println( "# AGGREGATED MODULE PROVIDERS " +
providers.length );
- //for( int i=0; i<providers.length; i++ )
- //{
- // System.out.println( "# " + providers[i] );
- //}
}

/**
* Test expanded module request on the dpml module.
+ * @exception Exception if a test error occurs
*/
public void testModuleGetResources() throws Exception
{
- Module metro = m_library.getModule( "dpml/metro" );
+ Module metro = getLibrary().getModule( "dpml/metro" );
Resource[] resources = metro.getResources();
assertEquals( "nested-expanded-resource-count", 15, resources.length
);
- //for( int i=0; i<resources.length; i++ )
- //{
- // System.out.println( "> " + (i+1) + " " + resources[i] );
- //}
}

/**
* Test aquisition of a named resource.
+ * @exception Exception if a test error occurs
*/
public void testGetResourceLevelOne() throws Exception
{
String spec = "dpml/metro";
- Module module = m_library.getModule( spec );
+ Module module = getLibrary().getModule( spec );
String name = "dpml-composition-runtime";
Resource resource = module.getResource( name );
String path = resource.getResourcePath();
@@ -85,11 +78,12 @@

/**
* Test aquisition of a named resource.
+ * @exception Exception if a test error occurs
*/
public void testGetResourceLevelTwo() throws Exception
{
String spec = "dpml";
- Module module = m_library.getModule( spec );
+ Module module = getLibrary().getModule( spec );
String name = "metro/dpml-composition-runtime";
Resource resource = module.getResource( name );
String path = resource.getResourcePath();
@@ -98,10 +92,11 @@

/**
* Test getModules operation.
+ * @exception Exception if a test error occurs
*/
public void testGetModule() throws Exception
{
- Module dpml = m_library.getModule( "dpml" );
+ Module dpml = getLibrary().getModule( "dpml" );
Module[] modules = dpml.getModules();
assertEquals( "nested-module-count", 4, modules.length );
}
@@ -109,26 +104,29 @@
/**
* Test selection of the set of immediate child module from within
* the enclosing module.
+ * @exception Exception if a test error occurs
*/
public void testGetModules() throws Exception
{
- Module dpml = m_library.getModule( "dpml" );
+ Module dpml = getLibrary().getModule( "dpml" );
Module[] modules = dpml.getModules();
assertEquals( "nested-module-count", 4, modules.length );
}

/**
* Test expanded module request on the dpml module.
+ * @exception Exception if a test error occurs
*/
public void testGetAllModules() throws Exception
{
- Module dpml = m_library.getModule( "dpml" );
+ Module dpml = getLibrary().getModule( "dpml" );
Module[] modules = dpml.getAllModules();
assertEquals( "nested-expanded-module-count", 4, modules.length );
}

/**
* Test scoped non-transitive providers.
+ * @exception Exception if a test error occurs
*/
public void testProviders() throws Exception
{
@@ -176,6 +174,7 @@

/**
* Test scoped non-transitive providers.
+ * @exception Exception if a test error occurs
*/
public void testAggregatedProviders() throws Exception
{
@@ -223,49 +222,73 @@
*/
}

+ /**
+ * Test select *.
+ * @exception Exception if a test error occurs
+ */
public void testSelectChildren() throws Exception
{
- Resource[] resources = m_library.select( "*", true );
+ Resource[] resources = getLibrary().select( "*", true );
assertEquals( "top-level-child-count", 6, resources.length );
}

+ /**
+ * Test select **.
+ * @exception Exception if a test error occurs
+ */
public void testSelectAllModules() throws Exception
{
- Resource[] resources = m_library.select( "**", false );
+ Resource[] resources = getLibrary().select( "**", false );
assertEquals( "all-module-count", 10, resources.length );
}

+ /**
+ * Test select pattern.
+ * @exception Exception if a test error occurs
+ */
public void testSelectWithPattern() throws Exception
{
- Resource[] resources = m_library.select( "*l*", true );
+ Resource[] resources = getLibrary().select( "*l*", true );
assertEquals( "'*l*'-selection", 2, resources.length );
}

+ /**
+ * Test select all.
+ * @exception Exception if a test error occurs
+ */
public void testSelectAll() throws Exception
{
- Resource[] resources = m_library.select( "**/*", false );
- //for( int i=0; i<resources.length; i++ )
- //{
- // System.out.println( " (" + (i+1) + ")\t" +
resources[i].getResourcePath() );
- //}
+ Resource[] resources = getLibrary().select( "**/*", false );
assertEquals( "'**/*'-selection", 44, resources.length );
}

+ /**
+ * Test select intermidiate pattern.
+ * @exception Exception if a test error occurs
+ */
public void testSelectAllWithPattern() throws Exception
{
- Resource[] resources = m_library.select( "**/*tools*", true );
+ Resource[] resources = getLibrary().select( "**/*tools*", true );
assertEquals( "'**/*tools*'-selection", 7, resources.length );
}

+ /**
+ * Test select absolute pattern.
+ * @exception Exception if a test error occurs
+ */
public void testAbsolutePattern() throws Exception
{
- Resource[] resources = m_library.select(
"dpml/tools/dpml-tools-control", false );
+ Resource[] resources = getLibrary().select(
"dpml/tools/dpml-tools-control", false );
assertEquals( "'**/*tools*'-selection", 1, resources.length );
}

+ /**
+ * Test select invalid pattern.
+ * @exception Exception if a test error occurs
+ */
public void testInvalidPatternWithWildcard() throws Exception
{
- Resource[] resources = m_library.select(
"dpml/tools/dpml-tools-control-*", false );
+ Resource[] resources = getLibrary().select(
"dpml/tools/dpml-tools-control-*", false );
assertEquals( "'dpml/tools/dpml-tools-control-*", 0,
resources.length );
}
}

Modified:
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultResourceTestCase.java
===================================================================
---
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultResourceTestCase.java
2006-01-07 16:20:08 UTC (rev 867)
+++
trunk/main/depot/library/common/src/test/net/dpml/library/impl/DefaultResourceTestCase.java
2006-01-07 16:40:05 UTC (rev 868)
@@ -50,20 +50,22 @@
{
/**
* Test resource name.
+ * @exception Exception if a test error occurs
*/
public void testName() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/metro/dpml-composition-runtime" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-composition-runtime" );
String name = resource.getName();
assertEquals( "name", "dpml-composition-runtime", name );
}

/**
* Test assigned build signature version.
+ * @exception Exception if a test error occurs
*/
public void testExplicitVersion() throws Exception
{
- Resource resource = m_library.getResource( "junit/junit" );
+ Resource resource = getLibrary().getResource( "junit/junit" );
String version = resource.getVersion();
assertEquals( "version", "@JUNIT_VERSION@", version );
//System.out.println( "# version: " + version );
@@ -71,46 +73,48 @@

/**
* Test assigned build signature version.
+ * @exception Exception if a test error occurs
*/
public void testBuildSignatureVersion() throws Exception
{
System.setProperty( "build.signature", "project.timestamp" );
- Resource resource = m_library.getResource(
"dpml/metro/dpml-composition-runtime" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-composition-runtime" );
String version = resource.getVersion();
assertEquals( "version", "YYYYMMDD.HHMMSS".length(),
version.length() );
System.getProperties().remove( "build.signature" );
- //System.out.println( "# version: " + version );
}

/**
* Test resource version.
+ * @exception Exception if a test error occurs
*/
public void testSnapshotVersion() throws Exception
{
System.getProperties().remove( "build.signature" );
- Resource resource = m_library.getResource(
"dpml/metro/dpml-composition-runtime" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-composition-runtime" );
String version = resource.getVersion();
assertEquals( "version", "SNAPSHOT", version );
- //System.out.println( "# version: " + version );
}

/**
* Test resource path.
+ * @exception Exception if a test error occurs
*/
public void testResourcePath() throws Exception
{
String path = "dpml/metro/dpml-composition-runtime";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
assertEquals( "resource-path", path, resource.getResourcePath() );
}

/**
* Test basedir feature.
+ * @exception Exception if a test error occurs
*/
public void testBaseDir() throws Exception
{
String path = "dpml";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
File basedir = resource.getBaseDir();
assertNotNull( "basedir", basedir );
String testPath = System.getProperty( "project.test.dir" );
@@ -121,22 +125,24 @@

/**
* Test basedir feature.
+ * @exception Exception if a test error occurs
*/
public void testNullBaseDir() throws Exception
{
String path = "ant/ant";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
File basedir = resource.getBaseDir();
assertNull( "basedir", basedir );
}

/**
* Test resource types.
+ * @exception Exception if a test error occurs
*/
public void testTypeNames() throws Exception
{
String path = "dpml/metro/dpml-composition-runtime";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Type[] types = resource.getTypes();
//for( int i=0; i<types.length; i++ )
//{
@@ -151,11 +157,12 @@

/**
* Test isa function on an implied type.
+ * @exception Exception if a test error occurs
*/
public void testIsa() throws Exception
{
String path = "dpml/tools/dpml-tools-ant";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
assertTrue( "isa-jar", resource.isa( "jar" ) );
assertTrue( "isa-plugin", resource.isa( "plugin" ) );
assertFalse( "isa-rabbit", resource.isa( "rabbit" ) );
@@ -163,11 +170,12 @@

/**
* Test artifact uri function.
+ * @exception Exception if a test error occurs
*/
public void testArtifact() throws Exception
{
String path = "dpml/tools/dpml-tools-ant";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Type[] types = resource.getTypes();
for( int i=0; i<types.length; i++ )
{
@@ -186,13 +194,14 @@

/**
* Test enclosing parent module.
+ * @exception Exception if a test error occurs
*/
public void testGetParent() throws Exception
{
String path = "dpml/tools/dpml-tools-ant";
- Resource dpml = m_library.getResource( "dpml" );
- Resource tools = m_library.getResource( "dpml/tools" );
- Resource ant = m_library.getResource( "dpml/tools/dpml-tools-ant" );
+ Resource dpml = getLibrary().getResource( "dpml" );
+ Resource tools = getLibrary().getResource( "dpml/tools" );
+ Resource ant = getLibrary().getResource( "dpml/tools/dpml-tools-ant"
);
assertEquals( "parent", null, dpml.getParent() );
assertEquals( "parent", dpml, tools.getParent() );
assertEquals( "parent", tools, ant.getParent() );
@@ -200,6 +209,7 @@

/**
* Test scoped non-transitive providers.
+ * @exception Exception if a test error occurs
*/
public void testProviders() throws Exception
{
@@ -236,11 +246,12 @@
}

/**
- * Checking
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
*/
public void testAggregatedProvidersCase1() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/metro/dpml-composition-runtime" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-composition-runtime" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
false, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
false, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST,
false, false );
@@ -249,9 +260,13 @@
assertEquals( "test", 6, test.length );
}

+ /**
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
+ */
public void testAggregatedExpandedProvidersCase1() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/metro/dpml-composition-runtime" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-composition-runtime" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
true, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
true, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST, true,
false );
@@ -260,9 +275,13 @@
assertEquals( "test", 12, test.length );
}

+ /**
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
+ */
public void testAggregatedProvidersCase2() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/transit/dpml-transit-tools" );
+ Resource resource = getLibrary().getResource(
"dpml/transit/dpml-transit-tools" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
false, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
false, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST,
false, false );
@@ -271,9 +290,13 @@
assertEquals( "test", 3, test.length );
}

+ /**
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
+ */
public void testAggregatedExpandedProvidersCase2() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/transit/dpml-transit-tools" );
+ Resource resource = getLibrary().getResource(
"dpml/transit/dpml-transit-tools" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
true, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
true, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST, true,
false );
@@ -282,9 +305,13 @@
assertEquals( "test", 5, test.length );
}

+ /**
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
+ */
public void testAggregatedProvidersCase3() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/metro/dpml-component-model" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-component-model" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
false, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
false, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST,
false, false );
@@ -293,9 +320,13 @@
assertEquals( "test", 8, test.length );
}

+ /**
+ * Testing aggregated providers.
+ * @exception Exception if a test error occurs
+ */
public void testAggregatedExpandedProvidersCase3() throws Exception
{
- Resource resource = m_library.getResource(
"dpml/metro/dpml-component-model" );
+ Resource resource = getLibrary().getResource(
"dpml/metro/dpml-component-model" );
Resource[] build = resource.getAggregatedProviders( Scope.BUILD,
true, false );
Resource[] runtime = resource.getAggregatedProviders( Scope.RUNTIME,
true, false );
Resource[] test = resource.getAggregatedProviders( Scope.TEST, true,
false );
@@ -304,22 +335,34 @@
assertEquals( "test", 12, test.length );
}

+ /**
+ * Testing classpath providers.
+ * @exception Exception if a test error occurs
+ */
public void testRuntimeClasspathProviders() throws Exception
{
String path = "dpml/transit/dpml-transit-tools";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Resource[] chain = resource.getClasspathProviders( Scope.RUNTIME );
assertEquals( "chain-length", 3, chain.length );
}

+ /**
+ * Testing test classpath providers.
+ * @exception Exception if a test error occurs
+ */
public void testTestClasspathProviders() throws Exception
{
String path = "dpml/transit/dpml-transit-tools";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Resource[] chain = resource.getClasspathProviders( Scope.TEST );
assertEquals( "chain-length", 5, chain.length );
}

+ /**
+ * Testing test classloader chain construction.
+ * @exception Exception if a test error occurs
+ */
public void testClassloaderChainConstruction() throws Exception
{
doClasspathChainTest( "dpml/metro/dpml-composition-runtime", 0, 3,
6, 3 );
@@ -327,18 +370,26 @@
doClasspathChainTest( "dpml/transit/dpml-transit-tools", 0, 0, 0, 3
);
}

+ /**
+ * Testing direct consumers.
+ * @exception Exception if a test error occurs
+ */
public void testDirectConsumers() throws Exception
{
String path = "dpml/transit/dpml-transit-main";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Resource[] consumers = resource.getConsumers( false, false );
assertEquals( "consumer-count", 6, consumers.length );
}

+ /**
+ * Testing transitive consumers.
+ * @exception Exception if a test error occurs
+ */
public void testTransitiveConsumers() throws Exception
{
String path = "dpml/transit/dpml-transit-main";
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Resource[] consumers = resource.getConsumers( true, true );
assertEquals( "consumer-count", 20, consumers.length );
}
@@ -374,7 +425,7 @@

private int doCategoryTest( String path, Category category, int n )
throws Exception
{
- Resource resource = m_library.getResource( path );
+ Resource resource = getLibrary().getResource( path );
Resource[] chain = resource.getClasspathProviders( category );
int j = chain.length;
if( n > -1 )

Modified: trunk/main/depot/library/console/etc/bin/build.lap
===================================================================
--- trunk/main/depot/library/console/etc/bin/build.lap 2006-01-07 16:20:08
UTC (rev 867)
+++ trunk/main/depot/library/console/etc/bin/build.lap 2006-01-07 16:40:05
UTC (rev 868)
@@ -8,7 +8,8 @@
-Ddpml.depot.application=dpml.builder
janel.main.class=net.dpml.depot.Main
janel.min.java.version=1.4.0
-janel.max.java.version=1.4.2_09
+#janel.max.java.version=1.4.2_09
+janel.max.java.version=1.5
janel.classpath.jars.dir=${env.DPML_HOME}\share\lib
janel.sysprop.process.id=true
janel.java.bundle=require_sdk




  • r868 - in trunk/main/depot/library: common/src/test/net/dpml/library/impl console/etc/bin, mcconnell at BerliOS, 01/07/2006

Archive powered by MHonArc 2.6.24.

Top of Page