archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r540343 - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-database-consumers/src/test/ archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ archiva-base/archiva-model/src/main/java/org/apache/maven/archiv...
Date Mon, 21 May 2007 23:01:38 GMT
Author: joakime
Date: Mon May 21 16:01:36 2007
New Revision: 540343

URL: http://svn.apache.org/viewvc?view=rev&rev=540343
Log:
[MRM-346]: Show Artifact results in error 500. 

Added:
    maven/archiva/trunk/archiva-base/archiva-consumers/archiva-database-consumers/src/test/
    maven/archiva/trunk/archiva-database/src/test/resources/projects/
    maven/archiva/trunk/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom
Modified:
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java
    maven/archiva/trunk/archiva-base/archiva-model/src/main/mdo/archiva-base.xml
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
    maven/archiva/trunk/archiva-database/pom.xml
    maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java
    maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java
Mon May 21 16:01:36 2007
@@ -79,6 +79,8 @@
 public class AbstractArtifactKey
     implements CompoundKey, Serializable
 {
+    private static final long serialVersionUID = 1084250769223555422L;
+
     /**
      * The Group ID. (JPOX Requires this remain public)
      */

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java
Mon May 21 16:01:36 2007
@@ -79,6 +79,8 @@
 public class AbstractProjectKey
     implements CompoundKey, Serializable
 {
+    private static final long serialVersionUID = 4949927971768396064L;
+
     /**
      * The Group ID. (JPOX Requires this remain public)
      */

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java
Mon May 21 16:01:36 2007
@@ -79,6 +79,8 @@
 public class AbstractVersionedKey
     implements CompoundKey, Serializable
 {
+    private static final long serialVersionUID = -5389698374243146150L;
+
     /**
      * The Group ID. (JPOX Requires this remain public)
      */

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,7 @@
     extends AbstractArtifactKey
     implements Serializable
 {
+    private static final long serialVersionUID = -2565748477203220905L;
 
     public ArchivaArtifactJavaDetailsKey()
     {

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,8 @@
     extends AbstractArtifactKey
     implements Serializable
 {
+    private static final long serialVersionUID = -6381910527697704289L;
+
     public ArchivaArtifactModelKey()
     {
         super();

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,7 @@
     extends AbstractVersionedKey
     implements Serializable
 {
+    private static final long serialVersionUID = 7789859208617327581L;
 
     public ArchivaProjectModelKey()
     {

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,7 @@
     extends AbstractVersionedKey
     implements Serializable
 {
+    private static final long serialVersionUID = -7288079965200698253L;
 
     public ArchivaRepositoryMetadataKey()
     {

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,7 @@
     extends AbstractArtifactKey
     implements Serializable
 {
+    private static final long serialVersionUID = 2107985498806534183L;
 
     public ArtifactReferenceKey()
     {

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,8 @@
     extends AbstractProjectKey
     implements Serializable
 {
+    private static final long serialVersionUID = 7803774484166902823L;
+
     public ProjectReferenceKey()
     {
         super();

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java
Mon May 21 16:01:36 2007
@@ -33,6 +33,7 @@
     extends AbstractVersionedKey
     implements Serializable
 {
+    private static final long serialVersionUID = -5040195285240958302L;
 
     public VersionedReferenceKey()
     {

Modified: maven/archiva/trunk/archiva-base/archiva-model/src/main/mdo/archiva-base.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-model/src/main/mdo/archiva-base.xml?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-model/src/main/mdo/archiva-base.xml (original)
+++ maven/archiva/trunk/archiva-base/archiva-model/src/main/mdo/archiva-base.xml Mon May 21
16:01:36 2007
@@ -74,6 +74,14 @@
           </association>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 3259707008803111764L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
 
     <!-- _______________________________________________________________
@@ -168,6 +176,14 @@
           <defaultValue>false</defaultValue>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 6823195399928260795L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
 
     <!-- _______________________________________________________________
@@ -362,6 +378,12 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+    private static final long serialVersionUID = -6292417108113887384L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
     /**
      * Identify if this artifact's contents have been processed or not.
      * 
@@ -473,6 +495,12 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+    private static final long serialVersionUID = -4774236779581844880L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
     /**
      * Identify this implementation as a set of java details.
      * 
@@ -639,6 +667,12 @@
       </fields>
       <codeSegments>
         <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 914715358219606100L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
           <version>1.0.0</version>
           <code>
             public void updateTimestamp()
@@ -681,6 +715,14 @@
           <description>The incremental build number of the snapshot.</description>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -1251466956496493405L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     
@@ -727,6 +769,14 @@
           </description>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 8947981859537138991L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     <class stash.storable="true"
@@ -775,6 +825,14 @@
           </description>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -6990353165677563113L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     <class stash.storable="true"
@@ -851,6 +909,12 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+    private static final long serialVersionUID = -6116764846682178732L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
     public static String toKey( ArtifactReference artifactReference )
     {
         StringBuffer key = new StringBuffer();
@@ -1165,6 +1229,12 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+    private static final long serialVersionUID = -4216128775884469616L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
     public Dependency asDependency()
     {
         Dependency dep = new Dependency();
@@ -1227,6 +1297,14 @@
           </association>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 843006855864469245L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     <class stash.storable="true"
@@ -1261,7 +1339,16 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -7782212828768434535L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
+    
     <class stash.storable="true"
            jpox.table="LICENSES">
       <name>License</name>
@@ -1302,7 +1389,16 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 6078130909089038238L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
+    
     <class stash.storable="true"
            jpox.table="ISSUE_MANAGEMENT">
       <name>IssueManagement</name>
@@ -1325,6 +1421,14 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -8881904886381224821L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     <class>
@@ -1347,6 +1451,14 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 7592740408468517476L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
     
     <class stash.storable="true">
@@ -1441,6 +1553,14 @@
           </association>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -3847642264665088605L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
 
     <class stash.storable="true"
@@ -1574,6 +1694,12 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+    private static final long serialVersionUID = -5401218809636164002L;
+          ]]></code>
+        </codeSegment>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
     public String toString()
     {
         return Dependency.toKey( this );
@@ -1636,7 +1762,16 @@
           <required>true</required>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 5655957444245343314L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
+    
     <class stash.storable="true"
            jpox.table="SCM">
       <name>Scm</name>
@@ -1672,7 +1807,16 @@
           <type>String</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 4075086167850885575L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
+    
     <class stash.storable="true"
            jpox.table="PROJECT_REPOSITORIES">
       <name>ProjectRepository</name>
@@ -1738,6 +1882,14 @@
           <type>boolean</type>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = 8906309721278091848L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
 
     <!-- _______________________________________________________________
@@ -1829,6 +1981,14 @@
           </description>
         </field>
       </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -3426958367216659565L;
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
     </class>
 
     <!-- _______________________________________________________________
@@ -1896,6 +2056,12 @@
         </field>
       </fields>
       <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    private static final long serialVersionUID = -7113629916828442780L;
+          ]]></code>
+        </codeSegment>
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
Mon May 21 16:01:36 2007
@@ -113,15 +113,15 @@
         }
     }
 
-    private ArtifactReference getArtifactReference( Element elemPlugin )
+    private ArtifactReference getArtifactReference( Element elemPlugin, String defaultType
)
     {
         ArtifactReference reference = new ArtifactReference();
 
-        reference.setGroupId( elemPlugin.elementTextTrim( "groupId" ) );
+        reference.setGroupId( StringUtils.defaultString( elemPlugin.elementTextTrim( "groupId"
) ) );
         reference.setArtifactId( elemPlugin.elementTextTrim( "artifactId" ) );
-        reference.setVersion( elemPlugin.elementTextTrim( "version" ) );
-        reference.setClassifier( elemPlugin.elementTextTrim( "classifier" ) );
-        reference.setType( elemPlugin.elementTextTrim( "type" ) );
+        reference.setVersion( StringUtils.defaultString( elemPlugin.elementTextTrim( "version"
) ) );
+        reference.setClassifier( StringUtils.defaultString( elemPlugin.elementTextTrim( "classifier"
) ) );
+        reference.setType( StringUtils.defaultIfEmpty( elemPlugin.elementTextTrim( "type"
), defaultType ) );
 
         return reference;
     }
@@ -420,7 +420,7 @@
         {
             Element elemPlugin = (Element) it.next();
 
-            plugins.add( getArtifactReference( elemPlugin ) );
+            plugins.add( getArtifactReference( elemPlugin, "maven-plugin" ) );
         }
 
         return plugins;

Modified: maven/archiva/trunk/archiva-database/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/pom.xml?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-database/pom.xml (original)
+++ maven/archiva/trunk/archiva-database/pom.xml Mon May 21 16:01:36 2007
@@ -104,6 +104,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-repository-layer</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>hsqldb</groupId>
       <artifactId>hsqldb</artifactId>
       <scope>test</scope>

Modified: maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java
(original)
+++ maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java
Mon May 21 16:01:36 2007
@@ -28,10 +28,16 @@
 import org.apache.maven.archiva.database.constraints.AbstractSimpleConstraint;
 import org.apache.maven.archiva.model.CompoundKey;
 import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.jpox.SchemaTool;
 
+import sun.security.action.GetLongAction;
+
+import java.io.File;
 import java.io.PrintStream;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -59,6 +65,7 @@
  * @plexus.component role="org.apache.maven.archiva.database.jdo.JdoAccess" role-hint="archiva"
  */
 public class JdoAccess
+    extends AbstractLogEnabled
     implements Initializable, InstanceLifecycleListener, StoreLifecycleListener
 {
     /**
@@ -72,7 +79,25 @@
         throws InitializationException
     {
         pmf = jdoFactory.getPersistenceManagerFactory();
+        
+        // Create the schema (if needed)
+        URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo"
) };
+
+        File propsFile = null; // intentional
+        boolean verbose = true;
+        
+        try
+        {
+            SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose,
null );
+        }
+        catch ( Exception e )
+        {
+            getLogger().error( "Unable to create schema: " + e.getMessage(), e );
+        }
+        
+        pmf.getPersistenceManager();
 
+        // Add the lifecycle listener.
         pmf.addInstanceLifecycleListener( this, null );
     }
 

Modified: maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java?view=diff&rev=540343&r1=540342&r2=540343
==============================================================================
--- maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java
(original)
+++ maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java
Mon May 21 16:01:36 2007
@@ -23,7 +23,9 @@
 import org.apache.maven.archiva.database.ProjectModelDAO;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.model.jpox.ArchivaProjectModelKey;
+import org.apache.maven.archiva.repository.project.ProjectModelReader;
 
+import java.io.File;
 import java.util.Date;
 import java.util.List;
 
@@ -107,5 +109,36 @@
         // Delete object.
         projectDao.deleteProjectModel( actualModel );
         assertEquals( 0, projectDao.queryProjectModels( null ).size() );
+    }
+
+    public void testSaveGetRealProjectModel()
+        throws Exception
+    {
+        String groupId = "org.apache.maven.shared";
+        String artifactId = "maven-shared-jar";
+        String version = "1.0-SNAPSHOT";
+
+        ProjectModelDAO projectDao = dao.getProjectModelDAO();
+
+        ProjectModelReader modelReader = (ProjectModelReader) lookup( ProjectModelReader.class,
"model400" );
+
+        File pomFile = getTestFile( "src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom"
);
+
+        assertTrue( "pom file should exist: " + pomFile.getAbsolutePath(), pomFile.exists()
&& pomFile.isFile() );
+
+        ArchivaProjectModel model = modelReader.read( pomFile );
+        assertNotNull( "Model should not be null.", model );
+
+        // Fill in missing (mandatory) fields
+        model.setGroupId( groupId );
+        model.setOrigin( "testcase" );
+
+        projectDao.saveProjectModel( model );
+
+        ArchivaProjectModel savedModel = projectDao.getProjectModel( groupId, artifactId,
version );
+        assertNotNull( "Project model should not be null.", savedModel );
+
+        // Test proper detachment of sub-objects.
+        assertNotNull( "model.parent != null", savedModel.getParentProject() );
     }
 }

Added: maven/archiva/trunk/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom?view=auto&rev=540343
==============================================================================
--- maven/archiva/trunk/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom
(added)
+++ maven/archiva/trunk/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom
Mon May 21 16:01:36 2007
@@ -0,0 +1,175 @@
+<?xml version="1.0" ?>
+
+<!--
+  ~ Copyright 2005-2006 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.
+  -->
+
+<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>
+
+  <parent>
+    <groupId>org.apache.maven.shared</groupId>
+    <artifactId>maven-shared-components</artifactId>
+    <version>3</version>
+  </parent>
+
+  <artifactId>maven-shared-jar</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Shared Jar Utils</name>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/maven-shared-jar</url>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>clean</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>changelog-maven-plugin</artifactId>
+        <!--  Changelog has been moved to org.apache.maven.plugins
+              Need to adjust this location in the future to point to
+              the finalized copy of this plugin.
+        <artifactId>maven-changelog-plugin</artifactId> 
+          -->
+      </plugin>
+      <plugin>
+        <artifactId>maven-jxr-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <configuration>
+          <linkXref>true</linkXref>
+          <rulesets>
+            <ruleset>rulesets/basic.xml</ruleset>
+            <ruleset>rulesets/codesize.xml</ruleset>
+            <ruleset>rulesets/controversial.xml</ruleset>
+            <ruleset>rulesets/coupling.xml</ruleset>
+            <ruleset>rulesets/finalizers.xml</ruleset>
+            <ruleset>rulesets/imports.xml</ruleset>
+            <ruleset>rulesets/junit.xml</ruleset>
+            <ruleset>rulesets/logging-jakarta-commons.xml</ruleset>
+            <ruleset>rulesets/naming.xml</ruleset>
+            <ruleset>rulesets/optimizations.xml</ruleset>
+            <ruleset>rulesets/strictexception.xml</ruleset>
+            <ruleset>rulesets/strings.xml</ruleset>
+            <ruleset>rulesets/sunsecure.xml</ruleset>
+            <ruleset>rulesets/unusedcode.xml</ruleset>
+          </rulesets>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <repositories>
+    <repository>
+      <id>snapshots.codehaus</id>
+      <url>http://snapshots.repository.codehaus.org/</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>2.0.2</version>
+      <scope>compile</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+      <version>2.0.2</version>
+      <scope>compile</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+      <version>1.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.bcel</groupId>
+      <artifactId>bcel</artifactId>
+      <version>5.2</version>
+      <scope>compile</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.1</version>
+      <scope>compile</scope>
+    </dependency>
+
+  </dependencies>
+
+</project>



Mime
View raw message