You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dj...@apache.org on 2007/10/01 21:06:35 UTC
svn commit: r581038 - in /directory/apacheds/branches/bigbang:
apacheds-xbean-spring/ server-xml/ server-xml/src/test/
server-xml/src/test/java/ server-xml/src/test/java/org/
server-xml/src/test/java/org/apache/
server-xml/src/test/java/org/apache/dire...
Author: djencks
Date: Mon Oct 1 12:06:31 2007
New Revision: 581038
URL: http://svn.apache.org/viewvc?rev=581038&view=rev
Log:
DIRSERVER-1079 Basic test to start a server using xbean-spring and server.xml. Currently fails
Added:
directory/apacheds/branches/bigbang/server-xml/src/test/
directory/apacheds/branches/bigbang/server-xml/src/test/java/
directory/apacheds/branches/bigbang/server-xml/src/test/java/org/
directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/
directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/
directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/
directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java (with props)
Modified:
directory/apacheds/branches/bigbang/apacheds-xbean-spring/pom.xml
directory/apacheds/branches/bigbang/server-xml/pom.xml
Modified: directory/apacheds/branches/bigbang/apacheds-xbean-spring/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/apacheds-xbean-spring/pom.xml?rev=581038&r1=581037&r2=581038&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/apacheds-xbean-spring/pom.xml (original)
+++ directory/apacheds/branches/bigbang/apacheds-xbean-spring/pom.xml Mon Oct 1 12:06:31 2007
@@ -59,6 +59,12 @@
<version>${pom.version}</version>
<classifier>sources</classifier>
</dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-jdbm-store</artifactId>
+ <version>${pom.version}</version>
+ <classifier>sources</classifier>
+ </dependency>
<!-- replication service xbean config metadata -->
<dependency>
<groupId>org.apache.directory.server</groupId>
Modified: directory/apacheds/branches/bigbang/server-xml/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-xml/pom.xml?rev=581038&r1=581037&r2=581038&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-xml/pom.xml (original)
+++ directory/apacheds/branches/bigbang/server-xml/pom.xml Mon Oct 1 12:06:31 2007
@@ -29,4 +29,42 @@
<description>
A single authoritative server.xml file.
</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-xbean-spring</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-jndi</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
Added: directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java?rev=581038&view=auto
==============================================================================
--- directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java (added)
+++ directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java Mon Oct 1 12:06:31 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.directory.server;
+
+import java.io.File;
+import java.util.Properties;
+import java.net.URL;
+
+import javax.naming.Context;
+import javax.naming.directory.InitialDirContext;
+
+import org.junit.Test;
+import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
+import org.apache.directory.server.configuration.MutableServerStartupConfiguration;
+import org.apache.directory.server.jndi.ServerContextFactory;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class SpringServerTest
+{
+ private String providerURL = "dc=example,dc=com";
+
+ @Test
+ public void testSpringServerStartup() throws Exception {
+ ClassLoader classLoader = this.getClass().getClassLoader();
+ URL configURL = classLoader.getResource( "server.xml" );
+
+ File configF = new File(configURL.toURI());
+ ApplicationContext factory = new FileSystemXmlApplicationContext(configF.toURL().toString());
+ MutableServerStartupConfiguration cfg = (MutableServerStartupConfiguration) factory.getBean("configuration");
+ Properties env = (Properties) factory.getBean("environment");
+ env.setProperty( Context.PROVIDER_URL, providerURL);
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
+
+ File workingDirFile = new File(configF.getParentFile(), "work");
+ cfg.setWorkingDirectory(workingDirFile);
+
+ env.putAll(cfg.toJndiEnvironment());
+ new InitialDirContext(env);
+
+ }
+}
Propchange: directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain