You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2013/02/12 18:11:21 UTC

svn commit: r1445272 - in /archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry: ./ src/main/resources/org/apache/archiva/redback/components/registry/modello/ src/test/java/org/apache/archiva/redback/components/regis...

Author: olamy
Date: Tue Feb 12 17:11:20 2013
New Revision: 1445272

URL: http://svn.apache.org/r1445272
Log:
fix write boolean to default his default value: that was ignored

Modified:
    archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/pom.xml
    archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/main/resources/org/apache/archiva/redback/components/registry/modello/RegistryWriter.java.vm
    archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
    archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/verifiers/registry-writer/RegistryWriterVerifier.java

Modified: archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/pom.xml?rev=1445272&r1=1445271&r2=1445272&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/pom.xml (original)
+++ archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/pom.xml Tue Feb 12 17:11:20 2013
@@ -101,6 +101,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-simple</artifactId>
       <version>${slf4jVersion}</version>
@@ -139,6 +144,7 @@
           <systemPropertyVariables>
             <registryVersion>${project.version}</registryVersion>
             <slf4jVersion>${slf4jVersion}</slf4jVersion>
+            <springVersion>${springVersion}</springVersion>
           </systemPropertyVariables>
         </configuration>
       </plugin>

Modified: archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/main/resources/org/apache/archiva/redback/components/registry/modello/RegistryWriter.java.vm
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/main/resources/org/apache/archiva/redback/components/registry/modello/RegistryWriter.java.vm?rev=1445272&r1=1445271&r2=1445272&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/main/resources/org/apache/archiva/redback/components/registry/modello/RegistryWriter.java.vm (original)
+++ archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/main/resources/org/apache/archiva/redback/components/registry/modello/RegistryWriter.java.vm Tue Feb 12 17:11:20 2013
@@ -62,8 +62,10 @@ import ${class.packageName}.${class.name
 #end
 
 #macro ( writeValueChecker $type $value $field )
-#if ( $type == "boolean" || $type == "double" || $type == "float" || $type == "int" || $type == "long" || $type == "short" )
+#if ( $type == "double" || $type == "float" || $type == "int" || $type == "long" || $type == "short" )
 $value != $field.defaultValue
+#elseif ( $type == "boolean" )
+
 #elseif ( $type == "char" )
 $value != '$field.defaultValue'
 #elseif ( $type == "java.util.List" || $type == "java.util.Set" || $type == "java.util.Map" || $type == "java.util.Properties" )
@@ -97,11 +99,15 @@ public class ${model.name}RegistryWriter
 #set ( $uncapFieldName = $javaTool.uncapitalise($field.name) )
 #set ( $value = "value.${javaTool.makeGetter( $field )}()" )
 #if ( $field.primitive )
+      #if ($field.type != "boolean")
             if ( #writeValueChecker( $field.type $value $field ) )
             {
-                String name = "$uncapFieldName";
-#writePrimitive( $field.type $value "name" )
+      #end
+                String $uncapFieldName = "$uncapFieldName";
+#writePrimitive( $field.type $value $uncapFieldName )
+      #if ($field.type != "boolean")
             }
+      #end
 #else
 #set ( $assoc = $field )
 #if ( $assoc.multiplicity == "1" )

Modified: archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java?rev=1445272&r1=1445271&r2=1445272&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java (original)
+++ archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java Tue Feb 12 17:11:20 2013
@@ -87,6 +87,7 @@ public abstract class AbstractRegistryGe
         addDependency( "commons-configuration", "commons-configuration", "1.8" );
         addDependency( "commons-lang", "commons-lang", "2.6" );
         addDependency( "commons-logging", "commons-logging-api", "1.0.4" );
+        addDependency( "org.springframework","spring-context", System.getProperty( "springVersion" ) );
         addDependency( "org.codehaus.plexus", "plexus-interpolation", "1.14" );
         addDependency( "org.slf4j", "slf4j-api", System.getProperty( "slf4jVersion" ) );
         addDependency( "org.slf4j", "slf4j-simple", System.getProperty( "slf4jVersion" ) );
@@ -147,6 +148,6 @@ public abstract class AbstractRegistryGe
             }
         }
 
-        assertEquals( "There was compilation errors.", 0, error );
+        assertEquals( "There was compilation errors.:" + messages, 0, error );
     }
 }

Modified: archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/verifiers/registry-writer/RegistryWriterVerifier.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/verifiers/registry-writer/RegistryWriterVerifier.java?rev=1445272&r1=1445271&r2=1445272&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/verifiers/registry-writer/RegistryWriterVerifier.java (original)
+++ archiva/redback/redback-components/trunk/spring-registry/modello-plugin-redback-registry/src/test/verifiers/registry-writer/RegistryWriterVerifier.java Tue Feb 12 17:11:20 2013
@@ -29,6 +29,7 @@ import org.apache.archiva.redback.compon
 
 import junit.framework.Assert;
 
+import java.lang.AssertionError;
 import java.util.*;
 
 /**
@@ -126,15 +127,9 @@ public class RegistryWriterVerifier
             // expected
         }
 
-        try
-        {
-            registry.getBoolean( "defBoolean" );
-            Assert.fail();
-        }
-        catch ( NoSuchElementException e )
-        {
-            // expected
-        }
+
+        Assert.assertTrue( registry.getBoolean( "defBoolean" ) );
+
 
         // test removing an element from a list [MODELLO-84]
         model.getListReferences().remove( 0 );