You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/09/10 11:37:47 UTC
svn commit: r693756 - in
/geronimo/gshell/trunk/gshell-support/gshell-artifact: ./
src/main/java/org/apache/geronimo/gshell/artifact/ src/test/ src/test/java/
src/test/java/org/ src/test/java/org/apache/
src/test/java/org/apache/geronimo/ src/test/java...
Author: jdillon
Date: Wed Sep 10 02:37:46 2008
New Revision: 693756
URL: http://svn.apache.org/viewvc?rev=693756&view=rev
Log:
Fix up the classpath for loading the ArtifactManager
Add some tests for the ArtifactManagerFactory
Added:
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java (with props)
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java (with props)
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml (with props)
Modified:
geronimo/gshell/trunk/gshell-support/gshell-artifact/pom.xml
geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
Modified: geronimo/gshell/trunk/gshell-support/gshell-artifact/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/pom.xml?rev=693756&r1=693755&r2=693756&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/pom.xml Wed Sep 10 02:37:46 2008
@@ -88,6 +88,12 @@
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
Modified: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java?rev=693756&r1=693755&r2=693756&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java Wed Sep 10 02:37:46 2008
@@ -22,6 +22,9 @@
import org.springframework.beans.factory.FactoryBean;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.DefaultContainerConfiguration;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.classworlds.ClassWorld;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +44,15 @@
@PostConstruct
public void init() throws Exception {
- container = new DefaultPlexusContainer();
+ DefaultContainerConfiguration config = new DefaultContainerConfiguration();
+
+ ClassWorld classWorld = new ClassWorld();
+ config.setClassWorld(classWorld);
+
+ ClassRealm classRealm = classWorld.newRealm("gshell.artifact", getClass().getClassLoader());
+ config.setRealm(classRealm);
+
+ container = new DefaultPlexusContainer(config);
log.debug("Constructed Plexus container: {}", container);
}
Added: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java?rev=693756&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java (added)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java Wed Sep 10 02:37:46 2008
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.geronimo.gshell.artifact;
+
+import org.apache.geronimo.gshell.spring.SpringTestSupport;
+
+/**
+ * Unit tests for the {@link ArtifactManagerFactory} class.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ArtifactManagerFactoryTest
+ extends SpringTestSupport
+{
+ public void testProcessor() throws Exception {
+ ArtifactManager artifactManager = (ArtifactManager) applicationContext.getBean("artifactManager");
+ assertNotNull(artifactManager);
+ }
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java?rev=693756&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java (added)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java Wed Sep 10 02:37:46 2008
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.geronimo.gshell.artifact;
+
+import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
+
+/**
+ * Suport for Spring-based tests.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class SpringTestSupport
+ extends AbstractDependencyInjectionSpringContextTests
+{
+ protected String[] getConfigLocations() {
+ return new String[] {
+ "classpath:" + getClass().getName().replace('.', '/') + "-context.xml"
+ };
+ }
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/SpringTestSupport.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml?rev=693756&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml (added)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml Wed Sep 10 02:37:46 2008
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <context:annotation-config/>
+
+ <bean id="artifactManager" class="org.apache.geronimo.gshell.artifact.ArtifactManagerFactory"/>
+
+</beans>
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/resources/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest-context.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml