geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r566893 [2/2] - in /geronimo/server/trunk: maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ modules/geronimo-connector-builder/ modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector...
Date Fri, 17 Aug 2007 00:52:58 GMT
Modified: geronimo/server/trunk/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
Thu Aug 16 17:52:52 2007
@@ -20,10 +20,8 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.LinkedHashSet;
 import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import java.util.HashSet;
 import java.util.jar.JarFile;
 
 import javax.management.ObjectName;
@@ -44,13 +42,14 @@
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.SimpleConfigurationManager;
-import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.mock.MockRepository;
 import org.apache.geronimo.kernel.repository.ArtifactManager;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev$ $Date$
@@ -89,7 +88,12 @@
         try {
 
             Environment environment = EnvironmentBuilder.buildEnvironment(plan.getEnvironment());
-            MockRepository mockRepository = new MockRepository();
+            Set<Artifact> repo = new HashSet<Artifact>();
+            repo.add(Artifact.create("geronimo/foo1/DEV/car"));
+            repo.add(Artifact.create("geronimo/foo2/DEV/car"));
+            repo.add(Artifact.create("geronimo/foo3/DEV/car"));
+            repo.add(Artifact.create("geronimo/foo4/DEV/car"));
+            ListableRepository mockRepository = new MockRepository(repo);
             ArtifactManager artifactManager = new DefaultArtifactManager();
             ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager,
Collections.singleton(mockRepository), null);
             ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET,
artifactResolver, Collections.EMPTY_SET);
@@ -129,31 +133,6 @@
         file.delete();
     }
 
-    private static class MockRepository implements ListableRepository {
-        public boolean contains(Artifact artifact) {
-            return true;
-        }
-
-        public File getLocation(Artifact artifact) {
-            return new File(".");
-        }
-
-        public LinkedHashSet getDependencies(Artifact artifact) {
-            return new LinkedHashSet();
-        }
-
-        public SortedSet list() {
-            return new TreeSet();
-        }
-
-        public SortedSet list(Artifact query) {
-            SortedSet set = new TreeSet();
-            if(query.getGroupId() != null && query.getArtifactId() != null &&
query.getVersion() != null && query.getType() == null) {
-                set.add(new Artifact(query.getGroupId(), query.getArtifactId(), query.getVersion(),
"jar"));
-            }
-            return set;
-        }
-    }
     private static class MockReferenceCollection extends ArrayList implements ReferenceCollection
{
 
         public void addReferenceCollectionListener(ReferenceCollectionListener listener)
{

Modified: geronimo/server/trunk/modules/geronimo-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/pom.xml?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-system/pom.xml Thu Aug 16 17:52:52 2007
@@ -56,7 +56,15 @@
             <artifactId>geronimo-kernel</artifactId>
             <version>${version}</version>
         </dependency>
-        
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>commons-jexl</groupId>
             <artifactId>commons-jexl</artifactId>

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Thu Aug 16 17:52:52 2007
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -182,7 +183,7 @@
         return location;
     }
 
-    public Set resolve(Artifact configId, String moduleName, String path) throws NoSuchConfigException,
MalformedURLException {
+    public Set<URL> resolve(Artifact configId, String moduleName, String path) throws
NoSuchConfigException, MalformedURLException {
         if(!configId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
         }
@@ -381,7 +382,7 @@
         }
     }
 
-    public List listConfigurations() {
+    public List<ConfigurationInfo> listConfigurations() {
         SortedSet artifacts = repository.list();
 
         List configs;

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/resolver/ExplicitDefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/resolver/ExplicitDefaultArtifactResolver.java?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/resolver/ExplicitDefaultArtifactResolver.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/resolver/ExplicitDefaultArtifactResolver.java
Thu Aug 16 17:52:52 2007
@@ -63,9 +63,8 @@
     }
 
     private static Map propertiesToArtifactMap(Properties properties) {
-        Map explicitResolution = new HashMap();
-        for (Iterator iterator = properties.entrySet().iterator(); iterator.hasNext();) {
-            Map.Entry entry = (Map.Entry) iterator.next();
+        Map<Artifact, Artifact> explicitResolution = new HashMap<Artifact, Artifact>();
+        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
             String key = (String) entry.getKey();
             String resolvedString = (String) entry.getValue();
             //split the string ourselves since we wish to allow blank artifactIds.
@@ -73,9 +72,9 @@
             if (parts.length != 4) {
                 throw new IllegalArgumentException("Invalid id: " + key);
             }
-            Artifact source = new Artifact(parts[0], parts[1], (String)null, parts[3]);
+            Artifact source = new Artifact(parts[0], parts[1], (String) null, parts[3]);
             Artifact resolved = Artifact.create(resolvedString);
-            explicitResolution.put(source,resolved);
+            explicitResolution.put(source, resolved);
         }
         return explicitResolution;
     }

Modified: geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java
Thu Aug 16 17:52:52 2007
@@ -16,15 +16,10 @@
  */
 package org.apache.geronimo.system.plugin;
 
-import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URL;
 import java.util.Collections;
-import java.util.LinkedHashSet;
 import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
 import java.util.concurrent.TimeUnit;
 
 import junit.framework.TestCase;
@@ -33,15 +28,14 @@
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
-import org.apache.geronimo.kernel.config.NullConfigurationStore;
-import org.apache.geronimo.kernel.config.LifecycleResults;
 import org.apache.geronimo.kernel.config.LifecycleException;
 import org.apache.geronimo.kernel.config.LifecycleMonitor;
+import org.apache.geronimo.kernel.config.LifecycleResults;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.mock.MockConfigStore;
+import org.apache.geronimo.kernel.mock.MockWritableListableRepository;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.FileWriteMonitor;
-import org.apache.geronimo.kernel.repository.WritableListableRepository;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
@@ -63,7 +57,7 @@
         String url = getClass().getResource("/geronimo-plugins.xml").toString();
         int pos = url.lastIndexOf("/");
         testRepo = new URL(url.substring(0, pos));
-        installer = new PluginInstallerGBean(new MockConfigManager(), new MockRepository(),
new MockConfigStore(),
+        installer = new PluginInstallerGBean(new MockConfigManager(), new MockWritableListableRepository(),
new MockConfigStore(),
                 new BasicServerInfo("."), new ThreadPool() {
             public int getPoolSize() {
                 return 0;
@@ -103,38 +97,6 @@
             }
         }
         assertTrue(prereqCount > 0);
-    }
-
-    private static class MockConfigStore extends NullConfigurationStore {
-
-    }
-
-    private static class MockRepository implements WritableListableRepository {
-        public void copyToRepository(File source, Artifact destination, FileWriteMonitor
monitor) throws IOException {
-        }
-
-        public void copyToRepository(InputStream source, int size, Artifact destination,
FileWriteMonitor monitor) throws IOException {
-        }
-
-        public boolean contains(Artifact artifact) {
-            return false;
-        }
-
-        public File getLocation(Artifact artifact) {
-            return null;
-        }
-
-        public LinkedHashSet getDependencies(Artifact artifact) {
-            return new LinkedHashSet();
-        }
-
-        public SortedSet list() {
-            return new TreeSet();
-        }
-
-        public SortedSet list(Artifact query) {
-            return new TreeSet();
-        }
     }
 
     private static class MockConfigManager implements ConfigurationManager {

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/pom.xml?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/pom.xml Thu Aug 16 17:52:52 2007
@@ -90,6 +90,14 @@
             <artifactId>asm</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
     <build>

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?view=diff&rev=566893&r1=566892&r2=566893
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Thu Aug 16 17:52:52 2007
@@ -51,6 +51,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.mock.MockConfigStore;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
@@ -338,55 +339,6 @@
     protected void tearDown() throws Exception {
         kernel.shutdown();
         super.tearDown();
-    }
-
-    public static class MockConfigStore extends NullConfigurationStore {
-        private Map configs = new HashMap();
-
-        URL baseURL;
-
-        public MockConfigStore() {
-        }
-
-        public MockConfigStore(URL baseURL) {
-            this.baseURL = baseURL;
-        }
-
-        public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException
{
-            configs.put(configurationData.getId(), configurationData);
-        }
-
-        public void uninstall(Artifact configID) throws NoSuchConfigException, IOException
{
-            configs.remove(configID);
-        }
-
-        public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException,
IOException, InvalidConfigException {
-            if (configs.containsKey(configId)) {
-                ConfigurationData configurationData = (ConfigurationData) configs.get(configId);
-                configurationData.setConfigurationStore(this);
-                return configurationData;
-            } else {
-                ConfigurationData configurationData = new ConfigurationData(configId, naming);
-                configurationData.setConfigurationStore(this);
-                return configurationData;
-            }
-        }
-
-        public boolean containsConfiguration(Artifact configID) {
-            return true;
-        }
-
-        public Set resolve(Artifact configId, String moduleName, String pattern) throws NoSuchConfigException,
MalformedURLException {
-            return Collections.singleton(baseURL);
-        }
-
-        public final static GBeanInfo GBEAN_INFO;
-
-        static {
-            GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class,
NameFactory.CONFIGURATION_STORE);
-            infoBuilder.addInterface(ConfigurationStore.class);
-            GBEAN_INFO = infoBuilder.getBeanInfo();
-        }
     }
 
     private static class WebModuleInfo {



Mime
View raw message