Author: akarasulu
Date: Wed Oct 20 12:17:21 2004
New Revision: 55176
Added:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaTool.java
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/autofs.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/autofs.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/corba.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/corba.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/core.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/core.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/cosine.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/cosine.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/inetorgperson.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/inetorgperson.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/java.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/java.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/misc.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/misc.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/schema/nis.schema
- copied unchanged from rev 55159,
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/nis.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/EveSchemaToolTest.java
Removed:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/schema/
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/autofs.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/corba.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/core.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/cosine.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/inetorgperson.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/java.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/misc.schema
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/nis.schema
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/ (props changed)
incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.jelly
incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.properties
incubator/directory/eve/trunk/backend/maven-eve-plugin/project.properties
incubator/directory/eve/trunk/backend/maven-eve-plugin/project.xml
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/AttributeTypes.template
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/ObjectClassesTemplateTest.java
Log:
Commit changes ...
o moved back schema files to src/schema for testing
o added resources section to move them to the right place in test-classes
o added new tool that coordinates creation of all elements for a schema
o preparing to create the ant task
Modified: incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.jelly
==============================================================================
--- incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.jelly
(original)
+++ incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.jelly Wed Oct
20 12:17:21 2004
@@ -1,18 +1,79 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<project
- xmlns:j="jelly:core"
- xmlns:multiproject="multiproject"
- xmlns:ant="jelly:ant"
- xmlns:util="jelly:util"
- xmlns:maven="jelly:maven">
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:util="jelly:util"
xmlns:maven="jelly:maven">
+
+ <!-- Dir for generated source files -->
+ <j:set var="eveTargetDir" value="${maven.eve.schema.target.dir}"/>
+ <j:set var="eveSchemaDir" value="${maven.eve.schema.dir}"/>
+ <j:set var="eveSchemas" value="${maven.eve.schemas}"/>
+
+ <goal name="eve:prepare-filesystem">
+ <j:if test="${!eveTargetDir.equals('MAVEN_EVE_TARGET_DIR_NOT_SET')}">
+ <ant:mkdir dir="${maven.build.dir}/schema"/>
+ </j:if>
+ </goal>
+
+ <goal name="eve:generate"
+ prereqs="eve:prepare-filesystem">
+
+ <j:if test="${!eveTargetDir.equals('MAVEN_EVE_TARGET_DIR_NOT_SET')}">
+ <ant:path id="maven.eve.schema.compile.src.set"
+ location="${maven.build.dir}/schema"/>
+
+ <maven:addPath id="maven.compile.src.set"
+ refid="maven.eve.schema.compile.src.set"/>
+
+
+ <ant:taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" />
+
+ <!-- TODO: use this for src.dir, but smarter for individual schemas -->
+ <!-- TODO: it seems that if target exists but the flagfile doesn't, it
doesn't compile? -->
+ <ant:uptodate property="maven.jaxb.buildNotRequired"
targetfile="${maven.build.dir}/jaxb/.flagfile">
+ <ant:srcfiles
+ dir = "${maven.jaxb.src.dir}"
+ includes = "*.xsd"/>
+ </ant:uptodate>
+
+ <j:set var="jaxbBuildNotRequired" value="${maven.jaxb.buildNotRequired}"
/>
+ <j:if test="${jaxbBuildNotRequired == null}">
+ <j:if test="${jaxbSchemas.equals('MAVEN_JAXB_SCHEMAS_NOT_SET')}">
+ <xjc target="${maven.build.dir}/jaxb">
+ <ant:schema dir="${maven.jaxb.src.dir}" includes="*.xsd" />
+ <ant:classpath>
+ <ant:pathelement path="${maven.build.dest}" />
+ </ant:classpath>
+ </xjc>
+ </j:if>
+ <j:if test="${!jaxbSchemas.equals('MAVEN_JAXB_SCHEMAS_NOT_SET')}">
+ <util:tokenize var="schemas" delim=" ">
+ ${maven.jaxb.schemas}
+ </util:tokenize>
+ <j:forEach var="schema" items="${schemas.iterator()}">
+ <xjc target="${maven.build.dir}/jaxb"
schema="${maven.jaxb.src.dir}/${schema}">
+ <ant:classpath>
+ <ant:pathelement path="${maven.build.dest}" />
+ </ant:classpath>
+ </xjc>
+ </j:forEach>
+ </j:if>
+ <ant:copy todir="${maven.build.dest}">
+ <ant:fileset dir="${maven.build.dir}/jaxb"
includes="**/*.properties,**/bgm.ser" />
+ </ant:copy>
+ <ant:touch file="${maven.build.dir}/jaxb/.flagfile" />
+ </j:if>
+
+ </j:if>
+ </goal>
+
+
+ <preGoal name="java:compile">
+ <j:if test="${!jaxbSrcDir.equals('MAVEN_JAXB_SRC_DIR_NOT_SET')}">
+ <attainGoal name="jaxb:generate"/>
+ </j:if>
+ </preGoal>
<goal name="eve">
- <echo>Schema plugin not implemented yet!</echo>
- </goal>
-
- <goal name="eve:blah">
- <echo>Schema plugin not implemented yet!</echo>
+ <attainGoal name="eve:generate"/>
</goal>
</project>
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.properties
==============================================================================
--- incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.properties
(original)
+++ incubator/directory/eve/trunk/backend/maven-eve-plugin/plugin.properties
Wed Oct 20 12:17:21 2004
@@ -1,2 +1 @@
-maven.eve.schema.sources=src/schema
-
+maven.eve.schema.dir=src/schema
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/project.properties
==============================================================================
--- incubator/directory/eve/trunk/backend/maven-eve-plugin/project.properties
(original)
+++ incubator/directory/eve/trunk/backend/maven-eve-plugin/project.properties
Wed Oct 20 12:17:21 2004
@@ -20,3 +20,6 @@
# antlr configuration
maven.antlr.grammars=openldap.g
maven.antlr.src.dir=src/antlr
+
+# eve schema configuration
+maven.eve.schema.dir=src/schema
\ No newline at end of file
Modified: incubator/directory/eve/trunk/backend/maven-eve-plugin/project.xml
==============================================================================
--- incubator/directory/eve/trunk/backend/maven-eve-plugin/project.xml
(original)
+++ incubator/directory/eve/trunk/backend/maven-eve-plugin/project.xml Wed Oct
20 12:17:21 2004
@@ -19,7 +19,7 @@
<project>
<extend>${basedir}/../../project.xml</extend>
<pomVersion>1</pomVersion>
- <artifactId>null</artifactId>
+ <artifactId>maven-eve-plugin</artifactId>
<groupId>incubator-directory</groupId>
<id>maven-eve-plugin</id>
<name>maven-eve-plugin</name>
@@ -68,7 +68,8 @@
<unitTest>
<resources>
<resource>
- <directory>src/test</directory>
+ <directory>src/schema</directory>
+ <targetPath>org/apache/eve/tools/schema</targetPath>
<includes>
<include>**/*.schema</include>
</includes>
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/AttributeTypes.template
==============================================================================
---
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/AttributeTypes.template
(original)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/AttributeTypes.template
Wed Oct 20 12:17:21 2004
@@ -64,7 +64,7 @@
// AttributeType $attrType.getOid() $!attrType.getName()
// --------------------------------------------------------------------
- attributeType = new BootstrapAttributeType( "$attrType.getOid()",
registries );
+ attributeType = newAttributeType( "$attrType.getOid()", registries );
attributeType.setSingleValue( $attrType.isSingleValue() );
attributeType.setCollective( $attrType.isCollective() );
attributeType.setObsolete( $attrType.isObsolete() );
Added:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaTool.java
==============================================================================
--- (empty file)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaTool.java
Wed Oct 20 12:17:21 2004
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed 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.eve.tools.schema;
+
+
+import java.io.*;
+import java.util.Properties;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.eve.schema.bootstrap.BootstrapSchema;
+import org.apache.eve.schema.bootstrap.ProducerTypeEnum;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+
+
+/**
+ * Generates Eve schema classses from OpenLDAP schema files.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class EveSchemaTool
+{
+
+ /** property for dir where OpenLDAP schema files and deps file are stored
*/
+ public static final String SCHEMA_SRC_DIR_PROP =
+ "maven.eve.schema.src.dir";
+ /** property for dir where the generated class files are created */
+ public static final String SCHEMA_TARGET_DIR_PROP =
+ "maven.eve.schema.target.dir";
+
+ /** default dir where OpenLDAP schema files and deps file are kept */
+ public static final String SCHEMA_SRC_DIR_DEFAULT =
+ "src" + File.separator + "schema";
+ /** property for the name of the schema dependency file */
+ public static final String SCHEMA_DEP_FILE_DEFAULT = "schema.deps";
+ /** default dir where the generated class files are created */
+ public static final String SCHEMA_TARGET_DIR_DEFAULT =
+ "target" + File.separator + "schema";
+
+
+ /** the source directory where the schema OpenLDAP source files are kept */
+ private String schemaSrcDir = SCHEMA_SRC_DIR_DEFAULT;
+ /** the directory where we generate schema class files */
+ private String schemaTargetDir = SCHEMA_TARGET_DIR_DEFAULT;
+
+
+ private BootstrapSchema schema;
+ private OpenLdapSchemaParser parser;
+
+
+
+ public EveSchemaTool() throws IOException
+ {
+ parser = new OpenLdapSchemaParser();
+ }
+
+
+ public String getSchemaSrcDir()
+ {
+ return schemaSrcDir;
+ }
+
+
+ public void setSchemaSrcDir( String schemaSrcDir )
+ {
+ this.schemaSrcDir = schemaSrcDir;
+ }
+
+
+ public String getSchemaTargetDir()
+ {
+ return schemaTargetDir;
+ }
+
+
+ public void setSchemaTargetDir( String schemaTargetDir )
+ {
+ this.schemaTargetDir = schemaTargetDir;
+ }
+
+
+ public BootstrapSchema getSchema()
+ {
+ return schema;
+ }
+
+
+ public void setSchema( BootstrapSchema schema )
+ {
+ this.schema = schema;
+ }
+
+
+ public void generate() throws Exception
+ {
+ if ( schema == null )
+ {
+ throw new NullPointerException( "the schema property must be set"
);
+ }
+
+
+ InputStream in = new FileInputStream( schemaSrcDir + File.separator
+ + schema.getSchemaName() + ".schema" );
+ parser.parse( in );
+
+ generateAttributeTypes();
+ generateObjectClasses();
+ }
+
+
+ protected void generateAttributeTypes() throws Exception
+ {
+ // check to see if the producer exists for this type
+ if ( exists( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER ) )
+ {
+ return;
+ }
+
+ int size = parser.getAttributeTypes().size();
+ AttributeTypeLiteral[] attributeTypes = new AttributeTypeLiteral[size];
+ attributeTypes = ( AttributeTypeLiteral[] )
+ parser.getAttributeTypes().values().toArray( attributeTypes );
+
+ VelocityContext context = new VelocityContext();
+ context.put( "package", schema.getPackageName() );
+ context.put( "classname",
+ schema.getUnqualifiedClassName(
ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER ) );
+ context.put( "schema", schema.getSchemaName() );
+ context.put( "owner", schema.getOwner() ) ;
+ context.put( "schemaDepCount", new Integer(
schema.getDependencies().length ) );
+ context.put( "schemaDeps", new String[] { "dep1", "dep2" } ) ;
+ context.put( "attrTypes", attributeTypes );
+
+ FileReader template = getResourceReader( "AttributeTypes.template" );
+
+ FileWriter writer = getResourceWriter( schema.getUnqualifiedClassName(
+ ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER ) );
+ Velocity.init();
+ Velocity.evaluate( context, writer, "LOG", template );
+ writer.flush();
+ writer.close();
+ }
+
+
+ protected void generateObjectClasses() throws Exception
+ {
+ // check to see if the producer exists for this type
+ if ( exists( ProducerTypeEnum.OBJECT_CLASS_PRODUCER ) )
+ {
+ return;
+ }
+
+ int size = parser.getObjectClassTypes().size();
+ ObjectClassLiteral[] objectClasses = new ObjectClassLiteral[size];
+ objectClasses = ( ObjectClassLiteral[] )
+ parser.getObjectClassTypes().values().toArray( objectClasses );
+
+ VelocityContext context = new VelocityContext();
+ context.put( "package", schema.getPackageName() );
+ context.put( "classname",
+ schema.getUnqualifiedClassName(
ProducerTypeEnum.OBJECT_CLASS_PRODUCER ) );
+ context.put( "schema", schema.getSchemaName() );
+ context.put( "owner", schema.getOwner() ) ;
+ context.put( "schemaDepCount", new Integer(
schema.getDependencies().length ) );
+ context.put( "schemaDeps", new String[] { "dep1", "dep2" } ) ;
+ context.put( "objectClasses", objectClasses );
+
+ FileReader template = getResourceReader( "ObjectClasses.template" );
+ FileWriter writer = getResourceWriter( schema.getUnqualifiedClassName(
+ ProducerTypeEnum.OBJECT_CLASS_PRODUCER ) );
+ Velocity.init();
+ Velocity.evaluate( context, writer, "LOG", template );
+ writer.flush();
+ writer.close();
+ }
+
+
+ protected FileReader getResourceReader( String res ) throws IOException
+ {
+ String path = getClass().getResource( res ).getFile() ;
+ return new FileReader( path );
+ }
+
+
+ protected boolean mkdirs( String base, String path )
+ {
+ String[] comps = path.split( "/" );
+ File file = new File( base );
+
+ if ( ! file.exists() )
+ {
+ file.mkdirs();
+ }
+
+ for ( int ii = 0; ii < comps.length; ii++ )
+ {
+ file = new File( file, comps[ii] );
+ if ( ! file.exists() )
+ {
+ file.mkdirs();
+ }
+ }
+
+ return file.exists();
+ }
+
+
+ protected FileWriter getResourceWriter( String classname ) throws
IOException
+ {
+ String pkg = schema.getPackageName();
+ mkdirs( schemaTargetDir, pkg.replace( '.', File.separatorChar ) );
+ File base = new File( schemaTargetDir );
+ String relativePath = pkg.replace( '.', File.separatorChar );
+ File dir = new File( base, relativePath );
+ return new FileWriter( new File( dir, classname + ".java" ) );
+ }
+
+
+ protected boolean exists( ProducerTypeEnum type )
+ {
+ boolean exists = true;
+
+ String defaultClass = schema.getFullDefaultBaseClassName(
+ ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER );
+ String targetClass = schema.getFullDefaultBaseClassName(
+ ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER );
+
+ try
+ {
+ exists = Class.forName( defaultClass ) != null;
+ }
+ catch ( ClassNotFoundException e )
+ {
+ exists = false;
+ }
+
+ try
+ {
+ exists = Class.forName( targetClass ) != null;
+ }
+ catch ( ClassNotFoundException e )
+ {
+ exists = false;
+ }
+
+ return exists;
+ }
+}
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
==============================================================================
---
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
(original)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/java/org/apache/eve/tools/schema/ObjectClasses.template
Wed Oct 20 12:17:21 2004
@@ -62,7 +62,7 @@
// ObjectClass $objectClass.getOid() $!objectClass.getName()
// --------------------------------------------------------------------
- objectClass = new BootstrapObjectClass( "$objectClass.getOid()",
registries );
+ objectClass = newObjectClass( "$objectClass.getOid()", registries );
objectClass.setObsolete( $objectClass.isObsolete() );
objectClass.setDescription( "$objectClass.getDescription()" );
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
==============================================================================
---
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
(original)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/AttributeTypesTemplateTest.java
Wed Oct 20 12:17:21 2004
@@ -33,7 +33,7 @@
public void testCoreAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "core", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "core", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -42,7 +42,7 @@
public void testJavaAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "java", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "java", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -51,7 +51,7 @@
public void testCorbaAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "corba", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "corba", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -60,7 +60,7 @@
public void testCosineAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "cosine", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "cosine", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -69,7 +69,7 @@
public void testInetorgpersonAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "inetorgperson",
"org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "inetorgperson", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -78,7 +78,7 @@
public void testMiscAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "misc", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "misc", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
@@ -87,7 +87,7 @@
public void testNisAttributeTypeGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "nis", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "nis", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateAttributeTypeProducer( schema );
}
Added:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/EveSchemaToolTest.java
==============================================================================
--- (empty file)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/EveSchemaToolTest.java
Wed Oct 20 12:17:21 2004
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed 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.eve.tools.schema;
+
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+import org.apache.eve.schema.bootstrap.AbstractBootstrapSchema;
+
+
+/**
+ * Tests the EveSchemaTool.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class EveSchemaToolTest extends TestCase
+{
+ public void testEveSchemaTool() throws Exception
+ {
+ EveSchemaTool tool = new EveSchemaTool();
+ AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
+ "cn=admin,ou=system", "core", null, new String[] { "system",
"dep2" }
+ ){};
+ tool.setSchema( schema );
+ tool.generate();
+ }
+}
Modified:
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/ObjectClassesTemplateTest.java
==============================================================================
---
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/ObjectClassesTemplateTest.java
(original)
+++
incubator/directory/eve/trunk/backend/maven-eve-plugin/src/test/org/apache/eve/tools/schema/ObjectClassesTemplateTest.java
Wed Oct 20 12:17:21 2004
@@ -33,7 +33,7 @@
public void testCoreObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "core", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "core", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -42,7 +42,7 @@
public void testJavaObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "java", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "java", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -51,7 +51,7 @@
public void testCorbaObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "corba", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "corba", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -60,7 +60,7 @@
public void testCosineObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "cosine", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "cosine", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -69,7 +69,7 @@
public void testInetorgpersonObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "inetorgperson",
"org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "inetorgperson", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -78,7 +78,7 @@
public void testMiscObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "misc", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "misc", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}
@@ -87,7 +87,7 @@
public void testNisObjectClassGeneration() throws Exception
{
AbstractBootstrapSchema schema = new AbstractBootstrapSchema(
- "uid=admin,ou=system", "nis", "org.apache.eve.schema.bootstrap",
+ "uid=admin,ou=system", "nis", "dummy.test",
new String[] { "dep1", "dep2" }) {};
generateObjectClassProducer( schema );
}