You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/08/24 21:04:06 UTC
svn commit: r434472 - in /directory/branches/apacheds/1.0/schema-archetype:
./ src/ src/main/ src/main/resources/ src/main/resources/META-INF/
src/main/resources/archetype-resources/
src/main/resources/archetype-resources/src/ src/main/resources/archet...
Author: akarasulu
Date: Thu Aug 24 12:04:05 2006
New Revision: 434472
URL: http://svn.apache.org/viewvc?rev=434472&view=rev
Log:
initial schema archetype commit: still need to add code for test case to use the schema
Added:
directory/branches/apacheds/1.0/schema-archetype/ (with props)
directory/branches/apacheds/1.0/schema-archetype/pom.xml
directory/branches/apacheds/1.0/schema-archetype/src/
directory/branches/apacheds/1.0/schema-archetype/src/main/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/archetype.xml
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/pom.xml
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/Dummy.java
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/car.schema
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/myschema.schema
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/SchemaTest.java
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/
directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties
Propchange: directory/branches/apacheds/1.0/schema-archetype/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Aug 24 12:04:05 2006
@@ -0,0 +1,4 @@
+target
+.classpath
+.project
+*.log
Added: directory/branches/apacheds/1.0/schema-archetype/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/pom.xml?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/pom.xml (added)
+++ directory/branches/apacheds/1.0/schema-archetype/pom.xml Thu Aug 24 12:04:05 2006
@@ -0,0 +1,12 @@
+<project>
+ <parent>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>build</artifactId>
+ <version>1.0-RC4-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>apacheds-schema-archetype</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>ApacheDS Schema Archetype</name>
+</project>
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/archetype.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/archetype.xml?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/archetype.xml (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/META-INF/archetype.xml Thu Aug 24 12:04:05 2006
@@ -0,0 +1,11 @@
+<archetype>
+ <id>apacheds-schema-archetype</id>
+ <sources>
+ <source>src/main/java/Dummy.java</source>
+ <source>src/test/java/SchemaTest.java</source>
+ </sources>
+ <resources>
+ <resource>src/main/schema/car.schema</resource>
+ <resource>src/test/resources/log4j.properties</resource>
+ </resources>
+</archetype>
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/pom.xml?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/pom.xml (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/pom.xml Thu Aug 24 12:04:05 2006
@@ -0,0 +1,69 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>jar</packaging>
+ <version>${version}</version>
+ <name>Schema Project</name>
+ <url>http://directory.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core</artifactId>
+ <version>1.0-RC4-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-unit</artifactId>
+ <version>1.0-RC4-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>nlog4j</artifactId>
+ <version>1.2.25</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Uncomment to override default jar naming convention
+ <finalName>car-schema.jar</finalName>
+ -->
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core-plugin</artifactId>
+ <configuration>
+ <schemaSourcesDir>src/main/schema</schemaSourcesDir>
+ <schemas>
+ <schema>
+ <name>car</name>
+ <pkg>${groupId}</pkg>
+ <dependencies>
+ <dependency>system</dependency>
+ <dependency>core</dependency>
+ </dependencies>
+ </schema>
+ </schemas>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/Dummy.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/Dummy.java?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/Dummy.java (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/java/Dummy.java Thu Aug 24 12:04:05 2006
@@ -0,0 +1,28 @@
+/*
+ * 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 ${groupId};
+
+
+/**
+ * This class does nothing. Makes sure maven builds and the archetype works.
+ */
+public class Dummy
+{
+}
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/car.schema
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/car.schema?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/car.schema (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/main/schema/car.schema Thu Aug 24 12:04:05 2006
@@ -0,0 +1,43 @@
+# =============================================================================
+# Car Schema
+# =============================================================================
+#
+#
+# +--------------------------------+-----------------+
+# | AttributeType OIDs | name |
+# +--------------------------------+-----------------+
+# | 1.2.6.1.4.1.18060.1.1.1.3.1001 | carMake |
+# | 1.2.6.1.4.1.18060.1.1.1.3.1002 | carModel |
+# | 1.2.6.1.4.1.18060.1.1.1.3.1003 | carYear |
+# +--------------------------------+-----------------+
+#
+# +--------------------------------+-----------------+
+# | ObjectClass OIDs | name |
+# +--------------------------------+-----------------+
+# | 1.2.6.1.4.1.18060.1.1.1.4.1001 | car |
+# +--------------------------------+-----------------+
+#
+# =============================================================================
+
+
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.1001 NAME 'carMake'
+ DESC 'The make of the car'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.1002 NAME 'carModel'
+ DESC 'The model of the car'
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.1003 NAME 'carYear'
+ DESC 'The year the car was manufactured'
+ EQUALITY integerMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
+
+objectclass ( 1.2.6.1.4.1.18060.1.1.1.4.1000
+ NAME 'car'
+ SUP top
+ STRUCTURAL
+ MUST ( carMake $ carModel $ carYear ) )
+
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/myschema.schema
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/myschema.schema?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/myschema.schema (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/schema/myschema.schema Thu Aug 24 12:04:05 2006
@@ -0,0 +1,21 @@
+# =============================================================================
+# Car Schema
+# =============================================================================
+#
+# +--------------------------------+-----------------+
+# | Car AttributeType OID | name |
+# +--------------------------------+-----------------+
+# | 1.2.6.1.4.1.18060.1.1.1.3.1000 | carMake |
+# +--------------------------------+-----------------+
+# =============================================================================
+
+
+attributetype ( 1.2.6.1.4.1.18060.1.1.1.3.1000 NAME 'carMake'
+ DESC 'The make of a car'
+ SUP name
+ EQUALITY caseIgnoreMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+ NO-USER-MODIFICATION
+ USAGE dSAOperation )
+
+
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/SchemaTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/SchemaTest.java?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/SchemaTest.java (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/java/SchemaTest.java Thu Aug 24 12:04:05 2006
@@ -0,0 +1,95 @@
+/*
+ * 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 ${groupId};
+
+
+import javax.naming.directory.*;
+import javax.naming.NamingException;
+
+import org.apache.directory.server.unit.AbstractServerTest;
+
+import java.util.Hashtable;
+
+
+/**
+ * Verify the use of our new schema and test that we can create entries using it.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class SchemaTest extends AbstractServerTest
+{
+ private DirContext ctx = null;
+
+
+ /**
+ * Make sure embedded instance uses our schema and get a connection to
+ * the embedded server using the SUN JNDI LDAP provider over the wire.
+ */
+ public void setUp() throws Exception
+ {
+ // -------------------------------------------------------------------
+ // Setup our schema to load
+ // -------------------------------------------------------------------
+
+ // todo
+
+ super.setUp();
+
+ // -------------------------------------------------------------------
+ // Get a connection (JNDI context) to the LDAP server
+ // -------------------------------------------------------------------
+
+ Hashtable env = new Hashtable();
+ env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+ env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
+ env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+ env.put( "java.naming.security.credentials", "secret" );
+ env.put( "java.naming.security.authentication", "simple" );
+ ctx = new InitialDirContext( env );
+ }
+
+
+ /**
+ * Closes our context before shuting down the server.
+ */
+ public void tearDown() throws Exception
+ {
+ ctx.close();
+ super.tearDown();
+ }
+
+
+ /**
+ * Let's test to make sure our schema elements have been installed and are
+ * ready to be used.
+ */
+ public void testSchemaPresence() throws NamingException
+ {
+ }
+
+
+ /**
+ * Adds a Car objectClass to the DIT under ou=system.
+ */
+ public void testAddCar() throws NamingException
+ {
+ }
+}
Added: directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties?rev=434472&view=auto
==============================================================================
--- directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties (added)
+++ directory/branches/apacheds/1.0/schema-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties Thu Aug 24 12:04:05 2006
@@ -0,0 +1,23 @@
+log4j.rootCategory=ERROR, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=apacheds-rolling.log
+
+log4j.appender.R.MaxFileSize=1024KB
+# Keep some backup files
+log4j.appender.R.MaxBackupIndex=5
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+
+# with these we'll not get innundated when switching to DEBUG
+log4j.logger.org.apache.directory.shared.ldap.name=ERROR
+log4j.logger.org.springframework=ERROR
+log4j.logger.org.apache.directory.shared.codec=ERROR
+log4j.logger.org.apache.directory.shared.asn1=ERROR
+