Author: mcconnell Date: Wed Jun 9 00:26:27 2004 New Revision: 20927 Added: avalon/trunk/runtime/composition/api/build.properties (contents, props changed) avalon/trunk/runtime/composition/api/build.xml (contents, props changed) avalon/trunk/runtime/composition/impl/build.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/ avalon/trunk/runtime/composition/impl/etc/test/ avalon/trunk/runtime/composition/impl/etc/test/manifests/ avalon/trunk/runtime/composition/impl/etc/test/manifests/a.mf avalon/trunk/runtime/composition/impl/etc/test/manifests/b.mf avalon/trunk/runtime/composition/impl/etc/test/manifests/c.mf avalon/trunk/runtime/composition/impl/etc/test/manifests/d.mf avalon/trunk/runtime/composition/impl/etc/test/manifests/e.mf avalon/trunk/runtime/composition/impl/etc/test/unit/ avalon/trunk/runtime/composition/impl/etc/test/unit/block.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/context.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/dependency.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/dynamics.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/ext/ avalon/trunk/runtime/composition/impl/etc/test/unit/ext/test-a.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/ext/test-b.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/includes.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/lib/ avalon/trunk/runtime/composition/impl/etc/test/unit/lib/test-c.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/playground.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/repository/ avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/ avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/ avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/includes.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/test-d.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/test-e.jar (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/secure-block.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/security.policy avalon/trunk/runtime/composition/impl/etc/test/unit/system/ avalon/trunk/runtime/composition/impl/etc/test/unit/system/kernel.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/system/logging.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/targets-config.xml (contents, props changed) avalon/trunk/runtime/composition/impl/etc/test/unit/targets.xml (contents, props changed) avalon/trunk/runtime/composition/spi/build.xml (contents, props changed) avalon/trunk/runtime/util/lifecycle/ avalon/trunk/runtime/util/lifecycle/build.properties (contents, props changed) avalon/trunk/runtime/util/lifecycle/build.xml (contents, props changed) avalon/trunk/runtime/util/lifecycle/src/ avalon/trunk/runtime/util/lifecycle/src/java/ avalon/trunk/runtime/util/lifecycle/src/java/org/ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Accessor.java (contents, props changed) avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Creator.java (contents, props changed) avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/package.html (contents, props changed) avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/package.html (contents, props changed) Modified: avalon/trunk/central/system/index.xml avalon/trunk/runtime/composition/api/src/java/org/apache/avalon/composition/data/ComponentProfile.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLComponentProfileCreator.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLContainmentProfileCreator.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfileCreator.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfilePackageCreator.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/writer/XMLComponentProfileWriter.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultClassLoaderModel.java avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultComponentModel.java avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/testa/ConfigurableComponent.java avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java avalon/trunk/runtime/logging/test/src/test/org/apache/avalon/logging/LoggingManagerHelper.java avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/OutputTargetTestCase.java avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/RevolvingFileStrategyTestCase.java avalon/trunk/runtime/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextFactoryTestCase.java avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextTest.java avalon/trunk/runtime/util/defaults/src/test/org/apache/avalon/util/defaults/test/DefaultsBuilderTestCase.java avalon/trunk/runtime/util/extension/impl/src/test/org/apache/avalon/extension/test/PackageRepositoryTestCase.java avalon/trunk/tools/project/README.TXT avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java Log: Updates to handle composition apiu, spi and partial impl builds.
Modified: avalon/trunk/central/system/index.xml ============================================================================== --- avalon/trunk/central/system/index.xml (original) +++ avalon/trunk/central/system/index.xml Wed Jun 9 00:26:27 2004 @@ -236,6 +236,19 @@ </dependencies> </project> + <project basedir="../../runtime/util/lifecycle"> + <info> + <group>avalon/util</group> + <name>avalon-util-lifecycle</name> + <version>1.1.1</version> + </info> + <dependencies> + <projects> + <projectref key="avalon-framework-api"/> + </projects> + </dependencies> + </project> + <!-- Avalon Meta. --> @@ -548,6 +561,58 @@ <projectref key="avalon-repository-main"/> <projectref key="avalon-logging-impl"/> <projectref key="avalon-framework-impl"/> + </projects> + </dependencies> + </project> + + <!-- + Avalon Composition. + --> + + <project basedir="../../runtime/composition/api"> + <info> + <group>avalon/composition</group> + <name>avalon-composition-api</name> + <version>2.0.0</version> + </info> + <dependencies> + <projects> + <projectref key="avalon-util-extension-api"/> + <projectref key="avalon-repository-api"/> + <projectref key="avalon-logging-spi"/> + <projectref key="avalon-meta-api"/> + </projects> + </dependencies> + </project> + + <project basedir="../../runtime/composition/spi"> + <info> + <group>avalon/composition</group> + <name>avalon-composition-spi</name> + <version>2.0.0</version> + </info> + <dependencies> + <projects> + <projectref key="avalon-composition-api"/> + </projects> + </dependencies> + </project> + + <project basedir="../../runtime/composition/impl"> + <info> + <group>avalon/composition</group> + <name>avalon-composition-impl</name> + <version>2.0.1-dev</version> + </info> + <dependencies> + <projects> + <projectref key="avalon-composition-spi"/> + <projectref key="avalon-repository-main"/> + <projectref key="avalon-meta-impl"/> + <projectref key="avalon-util-configuration"/> + <projectref key="avalon-util-extension-impl"/> + <projectref key="avalon-util-lifecycle"/> + <projectref key="avalon-logging-impl" build="false" test="true"/> </projects> </dependencies> </project> Added: avalon/trunk/runtime/composition/api/build.properties ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/api/build.properties Wed Jun 9 00:26:27 2004 @@ -0,0 +1,3 @@ +project.name = avalon-composition-api +project.src.main = java +project.home = ../../../central/system Added: avalon/trunk/runtime/composition/api/build.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/api/build.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<project name="avalon-composition-api" default="dist" basedir="."> + <property file="build.properties"/> + <import file="${project.home}/build/standard.xml"/> +</project> Modified: avalon/trunk/runtime/composition/api/src/java/org/apache/avalon/composition/data/ComponentProfile.java ============================================================================== --- avalon/trunk/runtime/composition/api/src/java/org/apache/avalon/composition/data/ComponentProfile.java (original) +++ avalon/trunk/runtime/composition/api/src/java/org/apache/avalon/composition/data/ComponentProfile.java Wed Jun 9 00:26:27 2004 @@ -47,7 +47,7 @@ may be serviced by components declared in parent container. --></i></font> -<component name="<font color="darkred">complex</font>" class="<font color="darkred">org.apache.excalibur.playground.ComplexComponent</font>" activation="<font color="darkred">startup</font>"> +<component name="<font color="darkred">complex</font>" class="<font color="darkred">org.apache.avalon.playground.ComplexComponent</font>" activation="<font color="darkred">startup</font>"> <font color="gray"><i><!-- Priority and target assignments for component specific logging categrories. Added: avalon/trunk/runtime/composition/impl/build.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/build.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<project name="avalon-composition-impl" default="dist" basedir="." + xmlns:x="antlib:org.apache.avalon.tools"> + + <property file="build.properties"/> + <import file="${project.home}/build/standard.xml"/> + + <target name="init" depends="standard.init"> + <x:filter key="avalon-logging-logkit-impl" feature="uri" + token="AVALON-LOGGING-LOGKIT-SPEC"/> + <x:filter key="avalon-framework-impl" feature="version" + token="FRAMEWORK_IMPL_VERSION"/> + </target> + +</project> Added: avalon/trunk/runtime/composition/impl/etc/test/manifests/a.mf ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/manifests/a.mf Wed Jun 9 00:26:27 2004 @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Created-By: Apache Avalon Merlin +Built-By: mcconnell +Package: org.apache.avalon.merlin +Build-Jdk: 1.4.1 +Extension-Name: test-a +Specification-Version: 1.0 +Specification-Vendor: Apache Software Foundation +Specification-Title: Assembly Model Test Case 1 +Implementation-Version: 1.0 +Implementation-Vendor: Apache Software Foundation +Implementation-Vendor-Id: ASF + Added: avalon/trunk/runtime/composition/impl/etc/test/manifests/b.mf ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/manifests/b.mf Wed Jun 9 00:26:27 2004 @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Created-By: Apache Avalon Merlin +Built-By: mcconnell +Package: org.apache.avalon.merlin +Build-Jdk: 1.4.1 +Extension-Name: test-b +Specification-Version: 1.0 +Specification-Vendor: Apache Software Foundation +Specification-Title: Assembly Model Test Case 1 +Implementation-Version: 1.0 +Implementation-Vendor: Apache Software Foundation +Implementation-Vendor-Id: ASF + Added: avalon/trunk/runtime/composition/impl/etc/test/manifests/c.mf ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/manifests/c.mf Wed Jun 9 00:26:27 2004 @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Created-By: Apache Avalon Merlin +Built-By: mcconnell +Package: org.apache.avalon.merlin +Build-Jdk: 1.4.1 +Extension-Name: test-c +Specification-Version: 1.0 +Specification-Vendor: Apache Software Foundation +Specification-Title: Assembly Model Test Case 1 +Implementation-Version: 1.0 +Implementation-Vendor: Apache Software Foundation +Implementation-Vendor-Id: ASF +Extension-List: test-a test-b +test-a-Implementation-Vendor-Id: ASF +test-a-Extension-Name: test-a +test-a-Specification-Version: 1.0 +test-a-Implementation-Version: 1.0 +test-b-Implementation-Vendor-Id: ASF +test-b-Extension-Name: test-b +test-b-Specification-Version: 1.0 +test-b-Implementation-Version: 1.0 + Added: avalon/trunk/runtime/composition/impl/etc/test/manifests/d.mf ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/manifests/d.mf Wed Jun 9 00:26:27 2004 @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Created-By: Apache Avalon Merlin +Built-By: mcconnell +Package: org.apache.avalon.merlin +Build-Jdk: 1.4.1 +Extension-Name: test-d +Specification-Version: 1.0 +Specification-Vendor: Apache Software Foundation +Specification-Title: Assembly Model Test Case 1 +Implementation-Version: 1.0 +Implementation-Vendor: Apache Software Foundation +Implementation-Vendor-Id: ASF +Extension-List: test-c +test-c-Implementation-Vendor-Id: ASF +test-c-Extension-Name: test-c +test-c-Specification-Version: 1.0 +test-c-Implementation-Version: 1.0 + Added: avalon/trunk/runtime/composition/impl/etc/test/manifests/e.mf ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/manifests/e.mf Wed Jun 9 00:26:27 2004 @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Created-By: Apache Avalon Merlin +Built-By: mcconnell +Package: org.apache.avalon.merlin +Build-Jdk: 1.4.1 +Extension-Name: test-e +Specification-Version: 1.0 +Specification-Vendor: Apache Software Foundation +Specification-Title: Assembly Model Test Case 1 +Implementation-Version: 1.0 +Implementation-Vendor: Apache Software Foundation +Implementation-Vendor-Id: ASF +Extension-List: test-a +test-a-Implementation-Vendor-Id: ASF +test-a-Extension-Name: test-a +test-a-Specification-Version: 1.0 +test-a-Implementation-Version: 1.0 + Added: avalon/trunk/runtime/composition/impl/etc/test/unit/block.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/block.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,50 @@ + + +<container name="test-block"> + + <services> + <service type="org.apache.avalon.composition.model.testa.A"> + <source>primary</source> + </service> + <service type="org.apache.avalon.composition.model.testd.D"> + <source>my-component</source> + </service> + </services> + + <classloader> + <library> + <include>ext</include> + <group>avalon-framework</group> + </library> + <classpath> + <fileset dir="lib"> + <include>test-c.jar</include> + </fileset> + <artifact>avalon-framework/[EMAIL PROTECTED]@</artifact> + <artifact>test/test-d</artifact> + </classpath> + </classloader> + + <component name="my-component" class="org.apache.avalon.composition.model.testd.TestD"/> + + <container name="primary"> + + <classloader> + <classpath> + <artifact>test/test-e</artifact> + </classpath> + </classloader> + + <container name="block"> + <component name="test" class="org.apache.avalon.composition.model.teste.TestE"> + <context> + <entry key="home"> + <import key="urn:avalon:home"/> + </entry> + </context> + </component> + </container> + + </container> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/context.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/context.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,30 @@ + + +<container> + + <classloader> + <classpath> + <fileset dir="ext"> + <include>test-a.jar</include> + </fileset> + </classpath> + </classloader> + + <component name="test-a" class="org.apache.avalon.composition.model.testa.TestA"> + <context class="org.apache.avalon.composition.model.testa.DefaultFacade"> + <entry key="home"> + <constructor class="java.io.File"> + <param class="java.io.File">${urn:avalon:home}</param> + <param>xxx</param> + </constructor> + </entry> + <entry key="time"> + <constructor class="java.util.Date"/> + </entry> + <entry key="path"> + <import key="urn:avalon:partition"/> + </entry> + </context> + </component> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/dependency.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/dependency.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,48 @@ + + +<container> + + <classloader> + <classpath> + <fileset dir="ext"> + <include>test-a.jar</include> + <include>test-b.jar</include> + </fileset> + <fileset dir="lib"> + <include>test-c.jar</include> + </fileset> + </classpath> + </classloader> + + <component name="test-a" class="org.apache.avalon.composition.model.testa.TestA"> + <context class="org.apache.avalon.composition.model.testa.DefaultFacade"> + <entry key="home"> + <constructor class="java.io.File"> + <param class="java.io.File">${urn:avalon:home}</param> + <param>xxx</param> + </constructor> + </entry> + <entry key="time"> + <constructor class="java.util.Date"/> + </entry> + <entry key="path"> + <import key="urn:avalon:partition"/> + </entry> + </context> + </component> + + <container name="fred"> + + <component name="test-b" class="org.apache.avalon.composition.model.testb.TestB"/> + + <component name="test-c" class="org.apache.avalon.composition.model.testc.TestC"> + <dependencies> + <dependency key="a" source="../test-a"/> + <dependency key="a2" source="/test-a"/> + <dependency key="b" source="test-b"/> + </dependencies> + </component> + + </container> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/dynamics.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/dynamics.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,8 @@ + +<container name="test"> + <classloader> + <classpath> + <fileset dir="../test-classes"/> + </classpath> + </classloader> +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/ext/test-a.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/ext/test-b.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/includes.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/includes.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,10 @@ + +<container> + + <include name="test" id="test:includes"> + <target path="primary/block/test"> + <categories priority="INFO"/> + </target> + </include> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/lib/test-c.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/playground.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/playground.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,59 @@ + +<!-- +Example block deployment descriptor. +--> + +<container name="playground"> + + <categories priority="INFO"/> + + <classloader> + <classpath> + <fileset dir="../test-classes"/> + <artifact>avalon-framework/[EMAIL PROTECTED]@</artifact> + </classpath> + </classloader> + + <services> + <service type="org.apache.avalon.playground.basic.BasicService" version="1.1"/> + </services> + + <container name="subsidiary"> + + <component name="complex" + class="org.apache.avalon.playground.ComplexComponent"> + <categories priority="INFO"/> + </component> + + <container name="test"> + <component name="simple" class="org.apache.avalon.playground.SimpleComponent"/> + </container> + + </container> + + <!-- + Commenting the following out to validate demand-driven discovery in + combination with automated assembly and export resolution. + --> + <!-- + <component name="demo" + class="org.apache.avalon.playground.DemoManager"/> + + <component name="exploitation" + class="org.apache.avalon.playground.ExploitationManager"/> + + <component name="basic" + class="org.apache.avalon.playground.basic.BasicComponent" + activation="startup"> + <context class="org.apache.avalon.playground.basic.BasicContextImp"> + <entry key="location"> + <constructor>My Place</constructor> + </entry> + <entry key="home"> + <import key="urn:avalon:home"/> + </entry> + </context> + </component> + --> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/includes.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/test-d.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/repository/test/jars/test-e.jar ============================================================================== Binary file. No diff available. Added: avalon/trunk/runtime/composition/impl/etc/test/unit/secure-block.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/secure-block.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<container name="secure-block"> + + <classloader> + <classpath> + <artifact>avalon-framework/[EMAIL PROTECTED]@</artifact> + </classpath> + </classloader> + +</container> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/security.policy ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/security.policy Wed Jun 9 00:26:27 2004 @@ -0,0 +1,4 @@ +grant { + permission java.security.AllPermission; +}; + Added: avalon/trunk/runtime/composition/impl/etc/test/unit/system/kernel.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/system/kernel.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,39 @@ +<!-- +Configuration used by the DefaultInitialContextFactoryTest to validate the +populatation of registered artifacts with the initial context. +--> + +<kernel> + + <system> + <artifact spec="@AVALON-LOGGING-LOGKIT-SPEC@"/> + </system> + + <logging path="system/logging.xml"/> + + <security> + <profile name="default"> + <permissions> + <permission class="java.util.PropertyPermission" name="java.*"> + <action>read</action> + </permission> + <permission class="java.util.PropertyPermission" name="os.*"> + <action>read</action> + </permission> + <permission class="java.util.PropertyPermission" name="file.separator"> + <action>read</action> + </permission> + <permission class="java.util.PropertyPermission" name="path.separator"> + <action>read</action> + </permission> + <permission class="java.util.PropertyPermission" name="line.separator"> + <action>read</action> + </permission> + <permission class="java.util.PropertyPermission" name="user.name"> + <action>read</action> + </permission> + </permissions> + </profile> + </security> + +</kernel> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/system/logging.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/system/logging.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +Logging configuration for testing. +Not in use yet. +--> + +<logging> + + <factories> + <factory type="file" + class="org.apache.avalon.logging.logkit.factory.FileTargetFactory"/> + </factories> + + <targets> + <file id="simple"> + <filename>../testing.log</filename> + <append>true</append> + </file> + </targets> + + <categories priority="debug" target="simple"/> + + <logger name="kernel.logger"/> + +</logging> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/targets-config.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/targets-config.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,20 @@ + +<targets> + + <target path="/aaa"> + <configuration> + <source>External configuration target for AAA.</source> + </configuration> + </target> + + <target path="/ccc/sss"> + <security profile="default"/> + </target> + + <target path="/ccc/sss/xxx"> + <configuration> + <source>External configuration target for XXX.</source> + </configuration> + </target> + +</targets> Added: avalon/trunk/runtime/composition/impl/etc/test/unit/targets.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/impl/etc/test/unit/targets.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,28 @@ + +<container> + + <classloader> + <classpath> + <fileset dir="ext"> + <include>test-a.jar</include> + </fileset> + </classpath> + </classloader> + + <component + class="org.apache.avalon.composition.model.testa.ConfigurableComponent" + name="aaa"/> + + <component + class="org.apache.avalon.composition.model.testa.ConfigurableComponent" + name="bbb"/> + + <container name="ccc"> + <container name="sss"> + <component + class="org.apache.avalon.composition.model.testa.ConfigurableComponent" + name="xxx"/> + </container> + </container> + +</container> Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLComponentProfileCreator.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLComponentProfileCreator.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLComponentProfileCreator.java Wed Jun 9 00:26:27 2004 @@ -39,7 +39,7 @@ import org.apache.avalon.meta.info.InfoDescriptor; -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.ConfigurationUtil; /** * Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLContainmentProfileCreator.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLContainmentProfileCreator.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLContainmentProfileCreator.java Wed Jun 9 00:26:27 2004 @@ -47,7 +47,7 @@ import org.apache.avalon.repository.Artifact; -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.ConfigurationUtil; /** * Handles internalization of an XML based description of a [EMAIL PROTECTED] ContainmentProfile} Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfileCreator.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfileCreator.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfileCreator.java Wed Jun 9 00:26:27 2004 @@ -28,7 +28,7 @@ import org.apache.avalon.util.i18n.ResourceManager; import org.apache.avalon.util.i18n.Resources; -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.ConfigurationUtil; /** * Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfilePackageCreator.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfilePackageCreator.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/builder/XMLProfilePackageCreator.java Wed Jun 9 00:26:27 2004 @@ -27,8 +27,7 @@ import org.apache.avalon.util.i18n.ResourceManager; import org.apache.avalon.util.i18n.Resources; - -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.ConfigurationUtil; /** * Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/writer/XMLComponentProfileWriter.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/writer/XMLComponentProfileWriter.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/data/writer/XMLComponentProfileWriter.java Wed Jun 9 00:26:27 2004 @@ -28,16 +28,20 @@ import org.apache.avalon.composition.data.DeploymentProfile; import org.apache.avalon.composition.data.ContextDirective; import org.apache.avalon.composition.data.DependencyDirective; -import org.apache.avalon.composition.data.SelectionDirective; +import org.apache.avalon.composition.data.SelectionDirective; + import org.apache.avalon.logging.data.CategoriesDirective; -import org.apache.avalon.logging.data.CategoryDirective; +import org.apache.avalon.logging.data.CategoryDirective; + import org.apache.avalon.composition.data.ImportDirective; import org.apache.avalon.composition.data.EntryDirective; import org.apache.avalon.composition.data.ConstructorDirective; import org.apache.avalon.composition.data.StageDirective; -import org.apache.avalon.composition.data.Parameter; +import org.apache.avalon.composition.data.Parameter; + import org.apache.avalon.meta.info.InfoDescriptor; -import org.apache.excalibur.configuration.ConfigurationUtil; + +import org.apache.avalon.util.configuration.ConfigurationUtil; /** * Write a [EMAIL PROTECTED] ComponentProfile} to a stream as xml documents. Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultClassLoaderModel.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultClassLoaderModel.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultClassLoaderModel.java Wed Jun 9 00:26:27 2004 @@ -85,7 +85,7 @@ * classloader models</li> * </ul> * <p> - * Class dependecies include the Excalibur i18n, the assembly + * Class dependecies include the util i18n, the assembly * repository package, the avalon framework and meta packages, * and the extensions package. * </p> Modified: avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultComponentModel.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultComponentModel.java (original) +++ avalon/trunk/runtime/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultComponentModel.java Wed Jun 9 00:26:27 2004 @@ -57,7 +57,8 @@ import org.apache.avalon.util.i18n.ResourceManager; import org.apache.avalon.util.i18n.Resources; -import org.apache.excalibur.configuration.CascadingConfiguration; +import org.apache.avalon.util.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.CascadingConfiguration; /** * Deployment model defintion. Modified: avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java (original) +++ avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/impl/fileset/FilesetModelTestCase.java Wed Jun 9 00:26:27 2004 @@ -30,7 +30,22 @@ import org.apache.avalon.framework.logger.ConsoleLogger; public class FilesetModelTestCase extends TestCase -{ +{ + private static File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } + private ConsoleLogger m_logger; private File m_root; @@ -39,9 +54,10 @@ */ public void setUp() { - m_root = new File( System.getProperty( "basedir" ) ); + m_root = getWorkDir(); m_logger = new ConsoleLogger( ConsoleLogger.LEVEL_INFO ); - } + } + /** * Cleans up the test case. @@ -111,7 +127,7 @@ ExcludeDirective[] excludes = new ExcludeDirective[0]; // provide legitimate fileset directory attribute - final String dir = "target/test-classes"; + final String dir = "."; FilesetDirective fsd = new FilesetDirective( dir, includes, excludes ); // create the fileset model's anchor directory @@ -165,7 +181,7 @@ * .jar extension. */ public void testWildcardIncludes() throws Exception - { + { // testing an include directive = "*.jar" IncludeDirective[] includes = new IncludeDirective[1]; includes[0] = new IncludeDirective( "*.jar" ); @@ -174,7 +190,7 @@ ExcludeDirective[] excludes = new ExcludeDirective[0]; // provide legitimate fileset directory attribute - final String dir = "target/test-classes/ext"; + final String dir = "ext"; FilesetDirective fsd = new FilesetDirective( dir, includes, excludes ); // create the fileset model's anchor directory @@ -243,7 +259,7 @@ excludes[0] = new ExcludeDirective( "test*.jar" ); // provide legitimate fileset directory attribute - final String dir = "target/test-classes/ext"; + final String dir = "ext"; FilesetDirective fsd = new FilesetDirective( dir, includes, excludes ); // create the fileset model's anchor directory @@ -313,7 +329,7 @@ ExcludeDirective[] excludes = new ExcludeDirective[0]; // provide legitimate fileset directory attribute - final String dir = "target/test-classes"; + final String dir = "."; FilesetDirective fsd = new FilesetDirective( dir, includes, excludes ); // create the fileset model's anchor directory Modified: avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java (original) +++ avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java Wed Jun 9 00:26:27 2004 @@ -61,14 +61,28 @@ private static Logger LOGGER = new ConsoleLogger( PRIORITY ); - public static final File BASEDIR = - new File( System.getProperty( "basedir" ) ); + public static final File BASEDIR = getWorkDir(); public static final File SYS_CONF = - new File( BASEDIR, "target/test-classes/conf/system/kernel.xml" ); + new File( BASEDIR, "system/kernel.xml" ); private static final XMLSecurityProfileBuilder SECURITY_BUILDER = new XMLSecurityProfileBuilder(); + + private static File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } //------------------------------------------------------- // state @@ -82,7 +96,7 @@ /** * Setup the system context and create m_model using a path - * relative to the ${basedir}/target-classes/conf directory. + * relative to the ${basedir}/conf directory. */ public ContainmentModel setUp( String path ) throws Exception { @@ -97,9 +111,8 @@ // system repository // - File test = new File( getTargetDir(), "test-classes" ); Configuration sysConfig = config.getChild( "system" ); - InitialContext context = setUpInitialContext( test, sysConfig ); + InitialContext context = setUpInitialContext( BASEDIR, sysConfig ); // // create a system context factory and start profiling the @@ -114,7 +127,7 @@ // String logConfigPath = config.getChild( "logging" ).getAttribute( "path" ); - File file = new File( test, logConfigPath ); + File file = new File( BASEDIR, logConfigPath ); URL url = file.toURL(); LoggingManager logging = DefaultSystemContextFactory.createLoggingManager( @@ -137,7 +150,7 @@ // Repository repository = - createTestRepository( context, new File( test, "repository" ) ); + createTestRepository( context, new File( BASEDIR, "repository" ) ); factory.setRepository( repository ); // @@ -152,8 +165,7 @@ // create a containment model using the supplied path // - File confDir = new File( test, "conf" ); - File source = new File( confDir, path ); + File source = new File( BASEDIR, path ); return modelFactory.createRootContainmentModel( source.toURL() ); } @@ -174,7 +186,7 @@ { InitialContextFactory initial = new DefaultInitialContextFactory( "test", base ); - initial.setCacheDirectory( getMavenRepositoryDirectory() ); + initial.setCacheDirectory( getCacheDirectory() ); registerSystemArtifacts( initial, config ); return initial.createInitialContext(); } @@ -197,10 +209,16 @@ { Configuration child = children[i]; String spec = child.getAttribute( "spec" ); - Artifact artifact = Artifact.createArtifact( "artifact:" + spec ); + Artifact artifact = Artifact.createArtifact( getURI( spec ) ); artifacts[i] = artifact; } return artifacts; + } + + private static String getURI( String spec ) + { + if( spec.startsWith( "artifact:" ) ) return spec; + return "artifact:" + spec; } public void printModel( String lead, DeploymentModel model ) @@ -284,6 +302,19 @@ System.out.println( lead + " --> " + m ); } } + + private File getCacheDirectory() + { + String cache = System.getProperty( "project.repository.cache.path" ); + if( null != cache ) + { + return new File( cache ); + } + else + { + return getMavenRepositoryDirectory(); + } + } private static File getMavenRepositoryDirectory() { @@ -333,10 +364,5 @@ protected File getBaseDir() { return BASEDIR; - } - - protected File getTargetDir() - { - return new File( getBaseDir(), "target" ); } } Modified: avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java (original) +++ avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java Wed Jun 9 00:26:27 2004 @@ -30,8 +30,7 @@ import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder; import org.apache.avalon.util.exception.ExceptionHelper; - -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.util.configuration.ConfigurationUtil; import org.apache.avalon.logging.data.CategoriesDirective; @@ -64,7 +63,7 @@ try { File source = - new File( getTargetDir(), "/test-classes/conf/targets-config.xml" ); + new File( BASEDIR, "targets-config.xml" ); TargetDirective[] targets = loadTargets( source ).getTargets(); for( int i=0; i<targets.length; i++ ) { Modified: avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/testa/ConfigurableComponent.java ============================================================================== --- avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/testa/ConfigurableComponent.java (original) +++ avalon/trunk/runtime/composition/impl/src/test/org/apache/avalon/composition/model/testa/ConfigurableComponent.java Wed Jun 9 00:26:27 2004 @@ -20,8 +20,9 @@ import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; -import org.apache.avalon.framework.logger.AbstractLogEnabled; -import org.apache.excalibur.configuration.ConfigurationUtil; +import org.apache.avalon.framework.logger.AbstractLogEnabled; + +import org.apache.avalon.util.configuration.ConfigurationUtil; public class ConfigurableComponent extends AbstractLogEnabled implements Configurable Added: avalon/trunk/runtime/composition/spi/build.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/composition/spi/build.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<project name="avalon-composition-spi" default="dist" basedir="."> + <property file="build.properties"/> + <import file="${project.home}/build/standard.xml"/> +</project> Modified: avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java ============================================================================== --- avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java (original) +++ avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationBuilderTestCase.java Wed Jun 9 00:26:27 2004 @@ -277,13 +277,29 @@ public DefaultConfigurationBuilderTestCase( final String name ) { super( name ); - File basedir = new File( System.getProperty( "basedir" ) ); + File basedir = getWorkDir(); m_testDirectory = (new File( basedir, TEST_PATH )).getAbsoluteFile(); if( !m_testDirectory.exists() ) { m_testDirectory.mkdirs(); } - } + } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } + protected void setUp() throws Exception Modified: avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java ============================================================================== --- avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java (original) +++ avalon/trunk/runtime/framework/impl/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationSerializerTestCase.java Wed Jun 9 00:26:27 2004 @@ -43,7 +43,7 @@ } public void setUp() { - File basedir = new File( System.getProperty( "basedir" ) ); + File basedir = getWorkDir(); testDirectory = (new File( basedir, "io" ) ).getAbsoluteFile(); testDirectory2 = new File( @@ -57,6 +57,21 @@ assertTrue ( !testDirectory2.exists() ); } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } /** * Checks that the <code>serializeToFile</code> method closes the output stream Modified: avalon/trunk/runtime/logging/test/src/test/org/apache/avalon/logging/LoggingManagerHelper.java ============================================================================== --- avalon/trunk/runtime/logging/test/src/test/org/apache/avalon/logging/LoggingManagerHelper.java (original) +++ avalon/trunk/runtime/logging/test/src/test/org/apache/avalon/logging/LoggingManagerHelper.java Wed Jun 9 00:26:27 2004 @@ -70,14 +70,8 @@ // File basedir = getBaseDir(); - File target = new File( basedir, "target" ); - - //File conf = new File( target, "test-classes/conf" ); - //File file = new File( conf, filename ); - File file = new File( basedir, filename ); - + File file = new File( basedir, filename ); criteria.put( "avalon.logging.configuration", file ); - //criteria.put( "avalon.logging.basedir", target ); criteria.put( "avalon.logging.basedir", basedir ); // @@ -161,10 +155,20 @@ throw new RuntimeException( message ); } } - - protected static File getBaseDir() - { - return new File( System.getProperty( "basedir" ) ); + + private static File getBaseDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } } private static Artifact[] getArtifactsToRegister( String path ) throws Exception Modified: avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/OutputTargetTestCase.java ============================================================================== --- avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/OutputTargetTestCase.java (original) +++ avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/OutputTargetTestCase.java Wed Jun 9 00:26:27 2004 @@ -65,8 +65,23 @@ { super( name ); - File basedir = new File( System.getProperty( "basedir" ) ); + File basedir = getWorkDir(); m_logFile = ( new File( basedir, "test/log/logfile.txt" ) ).getCanonicalFile(); + } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } } private String getResult( final ByteArrayOutputStream output ) Modified: avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/RevolvingFileStrategyTestCase.java ============================================================================== --- avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/RevolvingFileStrategyTestCase.java (original) +++ avalon/trunk/runtime/logkit/src/test/org/apache/log/output/test/RevolvingFileStrategyTestCase.java Wed Jun 9 00:26:27 2004 @@ -40,10 +40,25 @@ { super( name ); - File basedir = new File( System.getProperty( "basedir" ) ); + File basedir = getWorkDir(); m_baseFile = ( new File( basedir, "build/testdata/log" ) ).getCanonicalFile(); m_baseFile.getParentFile().mkdirs(); } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } private void deleteFiles( final int maxRotation ) throws IOException Modified: avalon/trunk/runtime/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java ============================================================================== --- avalon/trunk/runtime/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java (original) +++ avalon/trunk/runtime/meta/tools/src/test/org/apache/avalon/meta/MetaTestCase.java Wed Jun 9 00:26:27 2004 @@ -95,8 +95,7 @@ */ public void buildMeta() throws Exception { - String base = System.getProperty( "basedir" ); - File basedir = new File( base ); + File basedir = getWorkDir(); m_qdox.addSourceTree( basedir ); JavaSource[] sources = m_qdox.getSources(); for( int i=0; i<sources.length; i++ ) @@ -148,6 +147,21 @@ } } } + } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } } /** Modified: avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextFactoryTestCase.java ============================================================================== --- avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextFactoryTestCase.java (original) +++ avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextFactoryTestCase.java Wed Jun 9 00:26:27 2004 @@ -45,8 +45,23 @@ { private static final String KEY = "merlin"; - private static final File BASEDIR = - new File( System.getProperty( "basedir" ) ); + private static final File BASEDIR = getWorkDir(); + + private static File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } + public void testInitialContextCreation() throws Exception { Modified: avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextTest.java ============================================================================== --- avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextTest.java (original) +++ avalon/trunk/runtime/repository/test/src/test/org/apache/avalon/repository/main/DefaultInitialContextTest.java Wed Jun 9 00:26:27 2004 @@ -43,8 +43,22 @@ { private static final String KEY = "test"; - private static final File BASEDIR = - new File( System.getProperty( "basedir" ) ); + private static final File BASEDIR = getWorkDir(); + + private static File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } /** * Constructor for DefaultInitialContextTest. Modified: avalon/trunk/runtime/util/defaults/src/test/org/apache/avalon/util/defaults/test/DefaultsBuilderTestCase.java ============================================================================== --- avalon/trunk/runtime/util/defaults/src/test/org/apache/avalon/util/defaults/test/DefaultsBuilderTestCase.java (original) +++ avalon/trunk/runtime/util/defaults/src/test/org/apache/avalon/util/defaults/test/DefaultsBuilderTestCase.java Wed Jun 9 00:26:27 2004 @@ -38,9 +38,24 @@ protected void setUp() throws Exception { - File base = new File( System.getProperty( "basedir" ) ); + File base = getWorkDir(); m_builder = new DefaultsBuilder( KEY, base ); - } + } + + private File getWorkDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + return new File( path ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); + } + } public void testHomeDirectory() throws Exception { @@ -64,7 +79,7 @@ public void testConsolidatedProperties() throws Exception { - File base = new File( System.getProperty( "basedir" ) ); + File base = getWorkDir(); File props = new File( base, "test.keys" ); Properties properties = DefaultsBuilder.getProperties( props ); String[] keys = (String[]) properties.keySet().toArray( new String[0] ); Modified: avalon/trunk/runtime/util/extension/impl/src/test/org/apache/avalon/extension/test/PackageRepositoryTestCase.java ============================================================================== --- avalon/trunk/runtime/util/extension/impl/src/test/org/apache/avalon/extension/test/PackageRepositoryTestCase.java (original) +++ avalon/trunk/runtime/util/extension/impl/src/test/org/apache/avalon/extension/test/PackageRepositoryTestCase.java Wed Jun 9 00:26:27 2004 @@ -50,16 +50,32 @@ { super( name ); - File root = new File( System.getProperty( "basedir" ) ); - m_baseDirectory = + m_baseDirectory = new File( - root, - "../classes/org/apache/avalon/extension/test/" - ).getCanonicalFile(); + getTestClassesDir(), + "org/apache/avalon/extension/test/" + ).getCanonicalFile(); + m_pathElement1 = new File( m_baseDirectory, "path1" ); m_pathElement2 = new File( m_baseDirectory, "path2" ); m_path = new File[]{m_pathElement1, m_pathElement2}; - } + } + + private File getTestClassesDir() + { + String path = System.getProperty( "project.dir" ); + if( null != path ) + { + File base = new File( path ); + return new File( base, "../classes" ); + } + else + { + path = System.getProperty( "basedir" ); + File root = new File( path ); + return new File( root, "target/test-classes" ); // maven + } + } public void testGoodPath() throws Exception Added: avalon/trunk/runtime/util/lifecycle/build.properties ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/build.properties Wed Jun 9 00:26:27 2004 @@ -0,0 +1,3 @@ +project.name = avalon-util-lifecycle +project.src.main = java +project.home = ../../../central/system Added: avalon/trunk/runtime/util/lifecycle/build.xml ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/build.xml Wed Jun 9 00:26:27 2004 @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<project name="avalon-util-lifecycle" default="dist" basedir="."> + <property file="build.properties"/> + <import file="${project.home}/build/standard.xml"/> +</project> Added: avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Accessor.java ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Accessor.java Wed Jun 9 00:26:27 2004 @@ -0,0 +1,52 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * 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 org.apache.avalon.lifecycle; + +import org.apache.avalon.framework.context.Context; + +/** + * The <code>Accessor</code> interface describes the access and release + * stages that occur between a service or component manager and a container + * during service deployment. Lifecycle extensions supporting access + * and release stages must implement this interface. + * + * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a> + * @version CVS $Revision: 1.3 $ $Date: 2004/02/28 11:47:19 $ + */ +public interface Accessor +{ + /** + * Access stage handler. + * + * @param object the object that is being accessed + * @param context the context instance required by the access handler + * implementation + * @exception Exception if an error occurs + */ + void access( Object object, Context context ) + throws Exception; + + /** + * Release stage handler. + * + * @param object the object that is being released + * @param context the context instance required by the release handler + * implementation + */ + void release( Object object, Context context ); + +} Added: avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Creator.java ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/Creator.java Wed Jun 9 00:26:27 2004 @@ -0,0 +1,52 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * 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 org.apache.avalon.lifecycle; + +import org.apache.avalon.framework.context.Context; + +/** + * The <code>Creator</code> interface describes the create and destroy + * stages that occur between a component and a container + * during service management. Lifecycle extensions supporting create + * and destroy stages must implement this interface. + * + * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a> + * @version CVS $Revision: 1.3 $ $Date: 2004/02/28 11:47:19 $ + */ +public interface Creator +{ + /** + * Create stage handler. + * + * @param object the object that is being created + * @param context the context instance required by the create handler + * implementation + * @exception Exception if an error occurs + */ + void create( Object object, Context context ) + throws Exception; + + /** + * Destroy stage handler. + * + * @param object the object that is being destroyed + * @param context the context instance required by the handler + * implementation + */ + void destroy( Object object, Context context ); + +} Added: avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/package.html ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/lifecycle/package.html Wed Jun 9 00:26:27 2004 @@ -0,0 +1,3 @@ +<body> +Container independent interfaces and classes supporting component lifecycle extension. +</body> Added: avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/package.html ============================================================================== --- (empty file) +++ avalon/trunk/runtime/util/lifecycle/src/java/org/apache/avalon/package.html Wed Jun 9 00:26:27 2004 @@ -0,0 +1,10 @@ +<html> +<body> +Avalon is the framework and implementation for a component +architecture in java applications, allowing for easy re-use +of software components. It focuses on stable and scalable +solutions to ease collaborative development. While +server-oriented, it has been put to successful use in other +contexts as well. +</body> +</html> Modified: avalon/trunk/tools/project/README.TXT ============================================================================== --- avalon/trunk/tools/project/README.TXT (original) +++ avalon/trunk/tools/project/README.TXT Wed Jun 9 00:26:27 2004 @@ -1,8 +1,8 @@ -Build the antlib using the following command: +Build and install the antlib using the following command: $ cd avalon/tools/project - $ ant install + $ ant Test the antlib using the following command: Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java ============================================================================== --- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java (original) +++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java Wed Jun 9 00:26:27 2004 @@ -72,6 +72,7 @@ public static final boolean HALT_ON_FAILURE_VALUE = true; public static final String CACHE_PATH_KEY = "project.repository.cache.path"; + public static final String WORK_DIR_KEY = "project.dir"; private static final String ERROR_KEY = "project.test.error"; private static final String FAILURE_KEY = "project.test.failure"; @@ -272,15 +273,29 @@ xmlFormatter.setType( xml ); junit.addFormatter( xmlFormatter ); + Environment.Variable work = new Environment.Variable(); + work.setKey( WORK_DIR_KEY ); + work.setValue( base.toString() ); + junit.addSysproperty( work ); + Environment.Variable basedir = new Environment.Variable(); basedir.setKey( "basedir" ); - basedir.setValue( base.toString() ); + basedir.setValue( project.getBaseDir().toString() ); junit.addSysproperty( basedir ); Environment.Variable cache = new Environment.Variable(); cache.setKey( CACHE_PATH_KEY ); cache.setValue( getCachePath() ); junit.addSysproperty( cache ); + + File policy = new File( base, "security.policy" ); + if( policy.exists() ) + { + Environment.Variable security = new Environment.Variable(); + security.setKey( "java.security.policy" ); + security.setValue( policy.toString() ); + junit.addSysproperty( security ); + } junit.setErrorProperty( ERROR_KEY ); junit.setFailureProperty( FAILURE_KEY ); Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java ============================================================================== --- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java (original) +++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/PrepareTask.java Wed Jun 9 00:26:27 2004 @@ -48,7 +48,7 @@ private static final String ETC_FILTERED_INCLUDES_KEY = "project.prepare.etc.filtered.includes"; private static final String ETC_FILTERED_INCLUDES_VALUE = - "**/*.*"; + "**/*.java,**/*.x*,**/*.properties"; public void init() throws BuildException { @@ -86,7 +86,7 @@ File buildEtcDir = new File( build, "etc" ); String filters = project.getProperty( ETC_FILTERED_INCLUDES_KEY ); copy( etc, buildEtcDir, true, filters, "" ); - copy( etc, buildEtcDir, false, "**/*.*", filters ); + copy( etc, buildEtcDir, false, "**/*", filters ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]