continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r785096 - in /continuum/trunk: continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/ continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/ continuum-d...
Date Tue, 16 Jun 2009 07:22:53 GMT
Author: ctan
Date: Tue Jun 16 07:22:52 2009
New Revision: 785096

URL: http://svn.apache.org/viewvc?rev=785096&view=rev
Log:
[CONTINUUM-2163]
- added command line argument whether to run on strict mode or not during import
- update documentation on upgrading continuum versions
merge -r 785094:785095 from 1.3.x branch

Modified:
    continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
    continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
    continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
    continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
    continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
    continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
    continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
    continuum/trunk/continuum-docs/src/site/apt/installation/upgrade.apt

Modified: continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DataManagementTool.java
Tue Jun 16 07:22:52 2009
@@ -42,10 +42,11 @@
      * Restore the database.
      *
      * @param backupDirectory the directory where the backup to restore from resides
+     * @param strict
      * @throws java.io.IOException     if there is a problem reading the backup file
      * @throws DataManagementException if there is a problem parsing the backup file
      */
-    void restoreDatabase( File backupDirectory )
+    void restoreDatabase( File backupDirectory, boolean strict )
         throws IOException, DataManagementException;
 
     /**

Modified: continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
Tue Jun 16 07:22:52 2009
@@ -179,7 +179,7 @@
             LOGGER.info( "Processing Continuum database..." );
             processDatabase( databaseType, databaseFormat, mode, command.buildsJdbcUrl, command.directory,
                              command.settings, databaseFormat.getContinuumToolRoleHint(),
"data-management-jdo",
-                             "continuum" );
+                             "continuum", command.strict );
         }
 
         if ( command.usersJdbcUrl != null )
@@ -187,13 +187,14 @@
             LOGGER.info( "Processing Redback database..." );
             processDatabase( databaseType, databaseFormat, mode, command.usersJdbcUrl, command.directory,
                              command.settings, databaseFormat.getRedbackToolRoleHint(), "data-management-redback-jdo",
-                             "redback" );
+                             "redback", command.strict );
         }
     }
 
     private static void processDatabase( SupportedDatabase databaseType, DatabaseFormat databaseFormat,
                                          OperationMode mode, String jdbcUrl, File directory,
File setting,
-                                         String toolRoleHint, String managementArtifactId,
String configRoleHint )
+                                         String toolRoleHint, String managementArtifactId,
String configRoleHint,
+                                         boolean strict )
         throws PlexusContainerException, ComponentLookupException, ComponentLifecycleException,
         ArtifactNotFoundException, ArtifactResolutionException, IOException
     {
@@ -285,7 +286,7 @@
         else if ( mode == OperationMode.IMPORT )
         {
             manager.eraseDatabase();
-            manager.restoreDatabase( directory );
+            manager.restoreDatabase( directory, strict );
         }
 
         container.setLookupRealm( oldRealm );
@@ -566,6 +567,9 @@
         
         @Argument( description = "Alternate path for the user settings file", value = "settings",
required = false, alias = "s" )
         private File settings;
+
+        @Argument(description = "Run on strict mode. Default is false.", value="strict")
+        private boolean strict;
     }
 
     private enum OperationMode

Modified: continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
Tue Jun 16 07:22:52 2009
@@ -232,7 +232,7 @@
         daoUtils.eraseDatabase();
     }
 
-    public void restoreDatabase( File backupDirectory )
+    public void restoreDatabase( File backupDirectory, boolean strict )
         throws IOException
     {
         ContinuumStaxReader reader = new ContinuumStaxReader();
@@ -242,7 +242,7 @@
         ContinuumDatabase database;
         try
         {
-            database = reader.read( fileReader );
+            database = reader.read( fileReader, strict );
         }
         catch ( XMLStreamException e )
         {

Modified: continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/LegacyJdoDataManagementTool.java
Tue Jun 16 07:22:52 2009
@@ -189,7 +189,7 @@
         return pm;
     }
 
-    public void restoreDatabase( File backupDirectory )
+    public void restoreDatabase( File backupDirectory, boolean strict )
         throws IOException
     {
         ContinuumStaxReader reader = new ContinuumStaxReader();
@@ -199,7 +199,7 @@
         ContinuumDatabase database;
         try
         {
-            database = reader.read( fileReader );
+            database = reader.read( fileReader, strict );
         }
         catch ( XMLStreamException e )
         {

Modified: continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
Tue Jun 16 07:22:52 2009
@@ -118,7 +118,7 @@
 
         IOUtil.copy( getClass().getResourceAsStream( "/expected.xml" ), new FileWriter( backupFile
) );
 
-        dataManagementTool.restoreDatabase( targetDirectory );
+        dataManagementTool.restoreDatabase( targetDirectory, true );
 /*
         // TODO: why is this wrong?
         assertBuildDatabase();

Modified: continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/JdoDataManagementTool.java
Tue Jun 16 07:22:52 2009
@@ -84,7 +84,7 @@
         toolDelegate.eraseUsersDatabase( userManager );
     }
 
-    public void restoreDatabase( File backupDirectory )
+    public void restoreDatabase( File backupDirectory, boolean strict )
         throws IOException
     {
         try

Modified: continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
(original)
+++ continuum/trunk/continuum-data-management/data-management-redback-jdo/src/main/java/org/apache/maven/continuum/management/redback/LegacyJdoDataManagementTool.java
Tue Jun 16 07:22:52 2009
@@ -101,7 +101,7 @@
         }
     }
 
-    public void restoreDatabase( File backupDirectory )
+    public void restoreDatabase( File backupDirectory, boolean strict )
         throws IOException, DataManagementException
     {
         try

Modified: continuum/trunk/continuum-docs/src/site/apt/installation/upgrade.apt
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-docs/src/site/apt/installation/upgrade.apt?rev=785096&r1=785095&r2=785096&view=diff
==============================================================================
--- continuum/trunk/continuum-docs/src/site/apt/installation/upgrade.apt (original)
+++ continuum/trunk/continuum-docs/src/site/apt/installation/upgrade.apt Tue Jun 16 07:22:52
2009
@@ -59,9 +59,11 @@
         * Execute this command to import the builds data from the xml file you created earlier:
 
 +------------------------------------------+
-java -Xmx512m -jar data-management-cli-1.3.2-app.jar -buildsJdbcUrl jdbc:derby:${new.continuum.home}/data/databases/continuum
-mode IMPORT -directory backups
+java -Xmx512m -jar data-management-cli-1.3.2-app.jar -buildsJdbcUrl jdbc:derby:${new.continuum.home}/data/databases/continuum
-mode IMPORT -directory backups -strict
 +------------------------------------------+
-        
+
+    <<Note:>> Remove <<<-strict>>> when importing data from
1.3.1 to 1.3.x to ignore unrecognized tags due to model changes.
+
         []
  
         Finally, be aware that sometimes the NEXT_VAL values in the SEQUENCE_TABLE need to
be adjusted.



Mime
View raw message