directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r559823 - in /directory/sandbox/akarasulu/j2l/trunk/runtime/src: main/java/org/apache/directory/j2l/annotations/ main/java/org/apache/directory/j2l/annotations/attribute/ main/java/org/apache/directory/j2l/annotations/objectClass/ main/java...
Date Thu, 26 Jul 2007 14:19:49 GMT
Author: akarasulu
Date: Thu Jul 26 07:19:48 2007
New Revision: 559823

URL: http://svn.apache.org/viewvc?view=rev&rev=559823
Log:
changes ...

 o some cleanup
 o renamed and reorganized some test beans 
 o created generic test case to test schema parameter extraction
 o still working on object class enhancers


Added:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java
      - copied, changed from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClass.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java
      - copied, changed from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapRdnAttributes.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSyntaxLength.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/package.html
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/objectClass/
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/FooEnum.java
      - copied, changed from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/FooEnum.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/MutableTestBean.java
      - copied, changed from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/MutableTestBean.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/NoAnnotationsBean.java
      - copied, changed from r559292, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/TestBeanNoAnnotations.java
Removed:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClass.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapRdnAttributes.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/AnnotationTest.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/FooEnum.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/MutableTestBean.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/TestBeanNoAnnotations.java
Modified:
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMapping.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMappingRegistry.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeToPropertyMapping.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractorTest.java
    directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/resources/log4j.properties

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java
(from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClass.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java?view=diff&rev=559823&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClass.java&r1=558576&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClass.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassAliases.java
Thu Jul 26 07:19:48 2007
@@ -19,9 +19,9 @@
  */
 package org.apache.directory.j2l.annotations;
 
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Inherited;
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+
+import java.lang.annotation.*;
 
 /**
  *
@@ -29,8 +29,9 @@
  * @version $Rev$, $Date$
  */
 @Inherited
-@Retention(RetentionPolicy.RUNTIME)
-public @interface LdapObjectClass
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
+public @interface LdapObjectClassAliases
 {
-    String value();
+    String[] value();
 }

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java
(from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapRdnAttributes.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java?view=diff&rev=559823&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapRdnAttributes.java&r1=558576&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapRdnAttributes.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/LdapObjectClassRdnAttributes.java
Thu Jul 26 07:19:48 2007
@@ -21,18 +21,21 @@
 
 import org.apache.directory.j2l.annotations.LdapAttributeToPropertyMapping;
 
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Inherited;
+import java.lang.annotation.*;
 
 /**
+ * Declares which attributeTypes associated with bean properties can be used
+ * as relative distinguished names.  Effectively this constitues as NameForm
+ * however it is merely used by the persistence engine as a queue to determine
+ * how construct the name of an entry added to the directory.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 @Inherited
 @Retention( RetentionPolicy.RUNTIME )
-public @interface LdapRdnAttributes
+@Target( ElementType.TYPE )
+public @interface LdapObjectClassRdnAttributes
 {
     LdapAttributeToPropertyMapping[] value();
 }

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSyntaxLength.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSyntaxLength.java?view=auto&rev=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSyntaxLength.java
(added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/LdapAttributeSyntaxLength.java
Thu Jul 26 07:19:48 2007
@@ -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.directory.j2l.annotations.attribute;
+
+import java.lang.annotation.*;
+
+/**
+ * Used to set the length of an attribute associated with a syntax.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+@Inherited
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+public @interface LdapAttributeSyntaxLength
+{
+    int value();
+}

Added: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/package.html
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/package.html?view=auto&rev=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/package.html
(added)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/annotations/attribute/package.html
Thu Jul 26 07:19:48 2007
@@ -0,0 +1,19 @@
+<h2>TODO: turn this into a real package description instead of a place for design notes</h2>
+        
+<h2>Design FAQ</h2>
+<ol>
+    <li>
+        <h3>Question</h3>
+        <b> Why do we have an annotation for each aspect of an AttributeTypeDescription
rather than a single annotation
+        for an AttributeTypeDescription?</b>
+        <h3>Answer</h3>
+        We could have defined a single annotation yes however most often users need to tweak
a set of defaults
+        that are configured for the system: either preconfigured system defaults or overrides
for these system
+        wide defaults.  We don't want users to have to specify more than what it is they
want different from
+        the default.  This way there's less work that a user must do to tweak a single attribute.
 Some may come
+        back and counter with using annotation defaults.  This is also possible however it
makes it difficult
+        for us to figure out a way to implement overrides to these system defaults when they
are ingrained in
+        the Annotation as defaults.
+    </li>
+</ol>
+

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMapping.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMapping.java?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMapping.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMapping.java
Thu Jul 26 07:19:48 2007
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.j2l.configuration;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
+
 /**
  * A means to map a Java class to an LDAP syntax.
  *
@@ -27,6 +29,10 @@
  */
 public class PrimitiveMapping
 {
+    public static final PrimitiveMapping DEFAULT = new PrimitiveMapping( Object.class,
+            SchemaConstants.DIRECTORY_STRING_SYNTAX,
+            SchemaConstants.CASE_EXACT_MR, null,
+            SchemaConstants.CASE_EXACT_SUBSTRING_MR );
     private Class javaType;
     private String ldapSyntaxOid;
     private String equalityMatchingRule;

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMappingRegistry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMappingRegistry.java?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMappingRegistry.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/configuration/PrimitiveMappingRegistry.java
Thu Jul 26 07:19:48 2007
@@ -105,6 +105,10 @@
             new PrimitiveMapping( URL.class, SchemaConstants.DIRECTORY_STRING_SYNTAX,
                     SchemaConstants.CASE_EXACT_MR, null, SchemaConstants.CASE_EXACT_SUBSTRING_MR
);
 
+    private static final PrimitiveMapping ENUM_MAPPING =
+            new PrimitiveMapping( Enum.class, SchemaConstants.DIRECTORY_STRING_SYNTAX,
+                    SchemaConstants.CASE_EXACT_MR, null, SchemaConstants.CASE_EXACT_SUBSTRING_MR
);
+
 
 
     private Map<Class, PrimitiveMapping> class2syntax = new HashMap<Class, PrimitiveMapping>();
@@ -144,6 +148,7 @@
         class2syntax.put( SQL_TIME_MAPPING.getJavaType(), SQL_TIME_MAPPING );
         class2syntax.put( SQL_TIMESTAMP_MAPPING.getJavaType(), SQL_TIMESTAMP_MAPPING );
         class2syntax.put( URL_MAPPING.getJavaType(), URL_MAPPING );
+        class2syntax.put( ENUM_MAPPING.getJavaType(), ENUM_MAPPING );
 
         // Need a ASN.1 REAL syntax converstion to LDAP Syntax and matchingRules to do this
         // class2syntax.put( FLOAT_MAPPING.getJavaType(), FLOAT_MAPPING );

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeToPropertyMapping.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeToPropertyMapping.java?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeToPropertyMapping.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeToPropertyMapping.java
Thu Jul 26 07:19:48 2007
@@ -19,17 +19,21 @@
  */
 package org.apache.directory.j2l.descriptions;
 
+
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 import org.apache.directory.j2l.configuration.PrimitiveMapping;
 import org.apache.directory.j2l.configuration.J2LConfiguration;
 import org.apache.commons.beanutils.DynaProperty;
-import org.apache.commons.beanutils.DynaClass;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.lang.reflect.Method;
 import java.lang.annotation.Annotation;
 import java.util.Map;
 import java.util.HashMap;
 
+
 /**
  * Useful data structure to track an attributeType to Java Bean Property along with
  * various aspects useful during mapping.
@@ -39,6 +43,7 @@
  */
 public class AttributeToPropertyMapping
 {
+    private static final Logger LOG = LoggerFactory.getLogger( AttributeToPropertyMapping.class
);
     private final J2LConfiguration configuration;
     private AttributeTypeDescription attributeTypeDescription = new AttributeTypeDescription();
     private boolean required = false;
@@ -156,8 +161,16 @@
     {
         this.dynaProperty = dynaProperty;
         this.primitiveMapping = configuration.getPrimitiveMappingRegistry().lookup( dynaProperty.getType()
);
+
+        if ( this.primitiveMapping == null )
+        {
+            LOG.warn( "Using default mapping for '" + dynaProperty.getName() + "' property\nin
bean class " +
+                    this.beanClass.getName() + " with type " + dynaProperty.getType().getName()
);
+            this.primitiveMapping = PrimitiveMapping.DEFAULT;
+        }
     }
 
+    
     public PrimitiveMapping getPrimitiveMapping()
     {
         if ( primitiveMapping == null )

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/main/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractor.java
Thu Jul 26 07:19:48 2007
@@ -485,7 +485,7 @@
         }
         catch ( NoSuchMethodException e )
         {
-            if ( property.getType() == Boolean.class )
+            if ( property.getType() == Boolean.class || property.getType() == boolean.class
)
             {
                 log.info( "No getter expected for boolean bean property: {}", property.getName()
);
             }

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractorTest.java?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractorTest.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/descriptions/AttributeTypeExtractorTest.java
Thu Jul 26 07:19:48 2007
@@ -21,8 +21,13 @@
 
 import junit.framework.TestCase;
 import org.apache.directory.j2l.configuration.J2LConfiguration;
-import org.apache.directory.j2l.annotations.TestBeanNoAnnotations;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
+import org.apache.directory.shared.ldap.schema.syntax.parser.AttributeTypeDescriptionSchemaParser;
+import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
+import org.apache.commons.logging.LogFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.List;
 
@@ -35,34 +40,72 @@
  */
 public class AttributeTypeExtractorTest extends TestCase
 {
-    J2LConfiguration configuration;
-    AttributeTypeExtractor extractor;
+    private static final Logger LOG = LoggerFactory.getLogger( AttributeTypeExtractorTest.class
);
+    private static final String TEST_BEANS_PKG = "org.apache.directory.j2l.testbeans";
 
+    private J2LConfiguration configuration;
+    private AttributeTypeExtractor extractor;
+    private Class testBeanClass = null;
+    private AttributeTypeDescriptionSchemaParser parser;
 
-    public void setUp()
+    public void setUp() throws Exception
     {
+        parser = new AttributeTypeDescriptionSchemaParser();
         configuration = new J2LConfiguration();
         configuration.setEntityPrefix( "bogus" );
         configuration.getSchemaConfiguration().setName( "bogus" );
         configuration.setGenerateSchemaFile( true );
         extractor = new AttributeTypeExtractor( configuration );
+
+        // Load the test bean class corresponding to the test case which
+        // is simply the name of the test case minus the 'test' prefix
+        String testBeanClassName = TEST_BEANS_PKG + "." + getName().substring( 4 );
+        testBeanClass = Class.forName( testBeanClassName );
     }
 
 
     public void tearDown()
     {
+        if ( ! this.createResult().wasSuccessful() )
+        {
+            LOG.error( "Failed extraction on " + testBeanClass.getName() );
+        }
+        testBeanClass = null;
         extractor = null;
         configuration = null;
     }
 
 
-    public void testExtraction() throws Exception
+    protected void doExtraction( Class beanClass ) throws Exception
     {
         List<AttributeToPropertyMapping> mappings =
-                extractor.extractAttributeToPropertyMappings( TestBeanNoAnnotations.class
);
+                extractor.extractAttributeToPropertyMappings( beanClass );
+
         for ( AttributeToPropertyMapping mapping : mappings )
         {
-            System.out.println( SchemaUtils.render( mapping.getAttributeTypeDescription()
) );
+            AttributeTypeDescription extracted = mapping.getAttributeTypeDescription();
+            StringBuffer description = SchemaUtils.render( extracted );
+            LOG.info( "Extracted description: " + description.toString() );
+            AttributeTypeDescription parsed = ( AttributeTypeDescription ) parser.parse(
description.toString() );
+
+            assertEquals( extracted.getDescription(), parsed.getDescription() );
+            assertEquals( extracted.getEqualityMatchingRule(), parsed.getEqualityMatchingRule()
);
+            assertEquals( extracted.getExtensions(), parsed.getExtensions() );
+            assertEquals( extracted.getNames(), parsed.getNames() );
+            assertEquals( extracted.getNumericOid(), parsed.getNumericOid() );
+            assertEquals( extracted.getOrderingMatchingRule(), parsed.getOrderingMatchingRule()
);
+            assertEquals( extracted.getSubstringsMatchingRule(), parsed.getSubstringsMatchingRule()
);
+            assertEquals( extracted.getSuperType(), parsed.getSuperType() );
+            assertEquals( extracted.getSyntax(), parsed.getSyntax() );
+            assertEquals( extracted.getSyntaxLength(), parsed.getSyntaxLength() );
+            assertEquals( extracted.getUsage(), parsed.getUsage() );
+            LOG.info( "Schema attributeType extraction succeeded on class " + testBeanClass.getName()
);
         }
+    }
+
+
+    public void testNoAnnotationsBean() throws Exception
+    {
+        doExtraction( testBeanClass );
     }
 }

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/FooEnum.java
(from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/FooEnum.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/FooEnum.java?view=diff&rev=559823&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/FooEnum.java&r1=558576&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/FooEnum.java&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/FooEnum.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/FooEnum.java
Thu Jul 26 07:19:48 2007
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations;
+package org.apache.directory.j2l.testbeans;
 
 /**
  * Document me!

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/MutableTestBean.java
(from r558576, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/MutableTestBean.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/MutableTestBean.java?view=diff&rev=559823&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/MutableTestBean.java&r1=558576&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/MutableTestBean.java&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/MutableTestBean.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/MutableTestBean.java
Thu Jul 26 07:19:48 2007
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations;
+package org.apache.directory.j2l.testbeans;
 
 /**
  * Document me!

Copied: directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/NoAnnotationsBean.java
(from r559292, directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/TestBeanNoAnnotations.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/NoAnnotationsBean.java?view=diff&rev=559823&p1=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/TestBeanNoAnnotations.java&r1=559292&p2=directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/NoAnnotationsBean.java&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/annotations/TestBeanNoAnnotations.java
(original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/java/org/apache/directory/j2l/testbeans/NoAnnotationsBean.java
Thu Jul 26 07:19:48 2007
@@ -17,7 +17,13 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.j2l.annotations;
+package org.apache.directory.j2l.testbeans;
+
+import java.util.Date;
+import java.net.URL;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.math.BigInteger;
 
 
 /**
@@ -26,20 +32,36 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class TestBeanNoAnnotations
+public class NoAnnotationsBean
 {
     private String stringProperty;
     private short shortProperty;
     private long longProperty;
     private byte byteProperty;
     private boolean booleanProperty;
-    // not supported
-    // private char charProperty;
     private int intProperty;
-    // not supported
+
+    // data types not yet supported
+    // ----------------------------
+
+    // private char charProperty;
     // private float floatProperty;
     // private double doubleProperty;
     // private FooEnum enumProperty;
+    // private BigDecimal bigDecimalProperty;
+
+
+    /*
+     * Other simple yet object data types with default mappings
+     */
+    private FooEnum enumProperty;
+    private Date dateProperty;
+    private URL urlProperty;
+    private Time timeProperty;
+    private Timestamp timestampProperty;
+    private java.sql.Date sqlDateProperty;
+    private BigInteger bigIntegerProperty;
+
 
     public String getStringProperty()
     {
@@ -147,5 +169,75 @@
     protected void setByteProperty( byte byteProperty )
     {
         this.byteProperty = byteProperty;
+    }
+
+    public Date getDateProperty()
+    {
+        return dateProperty;
+    }
+
+    public void setDateProperty( Date dateProperty )
+    {
+        this.dateProperty = dateProperty;
+    }
+
+    public URL getUrlProperty()
+    {
+        return urlProperty;
+    }
+
+    public void setUrlProperty( URL urlProperty )
+    {
+        this.urlProperty = urlProperty;
+    }
+
+    public Time getTimeProperty()
+    {
+        return timeProperty;
+    }
+
+    public void setTimeProperty( Time timeProperty )
+    {
+        this.timeProperty = timeProperty;
+    }
+
+    public Timestamp getTimestampProperty()
+    {
+        return timestampProperty;
+    }
+
+    public void setTimestampProperty( Timestamp timestampProperty )
+    {
+        this.timestampProperty = timestampProperty;
+    }
+
+    public java.sql.Date getSqlDateProperty()
+    {
+        return sqlDateProperty;
+    }
+
+    public void setSqlDateProperty( java.sql.Date sqlDateProperty )
+    {
+        this.sqlDateProperty = sqlDateProperty;
+    }
+
+    public BigInteger getBigIntegerProperty()
+    {
+        return bigIntegerProperty;
+    }
+
+    public void setBigIntegerProperty( BigInteger bigIntegerProperty )
+    {
+        this.bigIntegerProperty = bigIntegerProperty;
+    }
+
+    public FooEnum getEnumProperty()
+    {
+        return enumProperty;
+    }
+
+    public void setEnumProperty( FooEnum enumProperty )
+    {
+        this.enumProperty = enumProperty;
     }
 }

Modified: directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/resources/log4j.properties?view=diff&rev=559823&r1=559822&r2=559823
==============================================================================
--- directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/resources/log4j.properties (original)
+++ directory/sandbox/akarasulu/j2l/trunk/runtime/src/test/resources/log4j.properties Thu
Jul 26 07:19:48 2007
@@ -3,4 +3,6 @@
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
-
+log4j.logger.org.apache.directory.j2l.descriptions.AttributeTypeExtractor=WARN
+log4j.logger.org.apache.directory.j2l.configuration.PrimitiveMappingRegistry=WARN
+log4j.logger.org.apache.directory.j2l.descriptions.AttributeTypeExtractorTest=WARN



Mime
View raw message