You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ep...@apache.org on 2003/11/14 13:29:39 UTC
cvs commit: jakarta-turbine-2/conf/test/merlin/BLOCK-INF block.xml
epugh 2003/11/14 04:29:39
Modified: . project.xml
src/java/org/apache/turbine/services/avaloncomponent
TurbineMerlinComponentService.java
src/test/org/apache/turbine/services/avaloncomponent
MerlinComponentServiceTest.java
conf/test/merlin/BLOCK-INF block.xml
Log:
Change MerlinComponentService to properly resolve the object. Updated support files.
Revision Changes Path
1.146 +3 -3 jakarta-turbine-2/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/project.xml,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- project.xml 13 Nov 2003 21:29:55 -0000 1.145
+++ project.xml 14 Nov 2003 12:29:39 -0000 1.146
@@ -703,9 +703,9 @@
<!-- Needed for testing -->
<dependency>
- <groupId>merlin</groupId>
- <artifactId>merlin-hello-tutorial</artifactId>
- <version>1.0</version>
+ <groupId>merlin/tutorial</groupId>
+ <artifactId>hello</artifactId>
+ <version>1.1</version>
</dependency>
</dependencies>
1.2 +3 -2 jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/TurbineMerlinComponentService.java
Index: TurbineMerlinComponentService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/TurbineMerlinComponentService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TurbineMerlinComponentService.java 2 Nov 2003 21:51:28 -0000 1.1
+++ TurbineMerlinComponentService.java 14 Nov 2003 12:29:39 -0000 1.2
@@ -71,7 +71,8 @@
import org.apache.turbine.services.TurbineBaseService;
/**
- * An implementation of AvalonComponentService based on the avalon Merlin 3.2 container.
+ * An implementation of AvalonComponentService based on the Avalon
+ * Merlin 3.2 container.
*
* @author <a mailto="peter@courcoux.biz">Peter Courcoux</a>
* @author <a mailto="epugh@upstate.com">Eric Pugh</a>
@@ -211,7 +212,7 @@
public Object lookup(String path) throws Exception
{
Block root = m_kernel.getRootBlock();
- return root.locate(path);
+ return root.locate(path).resolve();
}
/**
1.3 +50 -52 jakarta-turbine-2/src/test/org/apache/turbine/services/avaloncomponent/MerlinComponentServiceTest.java
Index: MerlinComponentServiceTest.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/test/org/apache/turbine/services/avaloncomponent/MerlinComponentServiceTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MerlinComponentServiceTest.java 13 Nov 2003 21:29:26 -0000 1.2
+++ MerlinComponentServiceTest.java 14 Nov 2003 12:29:39 -0000 1.3
@@ -54,14 +54,15 @@
* <http://www.apache.org/>.
*/
-import org.apache.avalon.activation.appliance.Appliance;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.turbine.services.TurbineServices;
import org.apache.turbine.test.BaseTestCase;
import org.apache.turbine.util.TurbineConfig;
-import tutorial.HelloComponent;
+import tutorial.Hello;
+
+
/**
* Simple test to make sure that the AvalonComponentService can be initialized.
@@ -71,60 +72,56 @@
*/
public class MerlinComponentServiceTest extends BaseTestCase
{
- private static final Log log = LogFactory.getLog(MerlinComponentServiceTest.class);
+ private static final Log log = LogFactory.getLog(MerlinComponentServiceTest.class);
- public MerlinComponentServiceTest(String name) throws Exception
- {
- super(name);
- }
- private MerlinComponentService getService()
- {
- return (MerlinComponentService) TurbineServices.getInstance().getService(
- MerlinComponentService.SERVICE_NAME);
- }
-
- /**
- * Test that we successfully download and install the HelloComponent form the
- * Merlin tutorial. Currently pulling from http://jakarta.apache.org/turbine/repo/merlin
- * @throws Exception
- */
- public void testMerlinWithHelloComponent() throws Exception
- {
-
- TurbineConfig tc =
- new TurbineConfig(".", "/conf/test/MerlinComponentServiceTest.properties");
-
- try
- {
- tc.initialize();
-
- Object appliance = getService().lookup("/tutorial/hello"); // just to test
- assertNotNull(appliance);
- assertEquals("appliance:/tutorial/hello", appliance.toString());
- log.info("Looked up appliance: " + appliance.toString());
-
- HelloComponent hello = (HelloComponent)appliance;
+ public MerlinComponentServiceTest(String name) throws Exception
+ {
+ super(name);
+ }
+ private MerlinComponentService getService()
+ {
+ return (MerlinComponentService) TurbineServices.getInstance().getService(
+ MerlinComponentService.SERVICE_NAME);
+ }
+
+ /**
+ * Test that we successfully download and install the HelloComponent form the
+ * Merlin tutorial. Currently pulling from http://jakarta.apache.org/turbine/repo/merlin
+ * @throws Exception
+ */
+ public void testMerlinWithHelloComponent() throws Exception
+ {
+
+ TurbineConfig tc =
+ new TurbineConfig(".", "/conf/test/MerlinComponentServiceTest.properties");
+
+ try
+ {
+ tc.initialize();
+
+ Hello hello = (Hello) getService().lookup("/fulcrum/hello"); // just to test
+ assertNotNull(hello);
- getService().release(appliance);
+ getService().release(hello);
- }
- catch (Exception e)
- {
- throw e;
- }
- finally
- {
- tc.dispose();
- }
- }
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ finally
+ {
+ tc.dispose();
+ }
+ }
- /**
- * Test that a locally compiled component can be loaded and used. Currently not
- * working because the org.apache.turbine.test.TestComponent is in this classloader,
- * not in a downloaded jar.
- * @throws Exception
- */
+ /**
+ * Test that a locally compiled component can be loaded and used. Currently not
+ * working because the org.apache.turbine.test.TestComponent is in this classloader,
+ * not in a downloaded jar.
+ * @throws Exception
+ */
public void OFF_testMerlinWithTestComponent() throws Exception
{
@@ -153,3 +150,4 @@
}
}
}
+
1.2 +2 -9 jakarta-turbine-2/conf/test/merlin/BLOCK-INF/block.xml
Index: block.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/conf/test/merlin/BLOCK-INF/block.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- block.xml 2 Nov 2003 21:51:28 -0000 1.1
+++ block.xml 14 Nov 2003 12:29:39 -0000 1.2
@@ -1,9 +1,9 @@
-<container name="tutorial">
+<container name="fulcrum">
<classloader>
<classpath>
<repository>
- <resource id="merlin:merlin-hello-tutorial" version="1.0"/>
+ <resource id="merlin/tutorial:hello" version="1.1"/>
</repository>
</classpath>
</classloader>
@@ -11,10 +11,3 @@
</container>
-<!-- Not working, dont' know how to load wit local path...
-<container name="local">
-
- <component name="testcomponent" class="org.apache.turbine.test.TestComponent"/>
-
-</container>
--->
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org