continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ri...@apache.org
Subject svn commit: r490643 - in /maven/continuum/branches/key-based-refactor/continuum-store: ./ src/test/java/org/apache/maven/continuum/store/ src/test/resources/
Date Thu, 28 Dec 2006 04:13:10 GMT
Author: rinku
Date: Wed Dec 27 20:13:10 2006
New Revision: 490643

URL: http://svn.apache.org/viewvc?view=rev&rev=490643
Log:
o  added Continuum DB schema and started putting together test data in a SQL script.
o  added ability to create DB and load data from a SQL file. 

Added:
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/schema.sql
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
Modified:
    maven/continuum/branches/key-based-refactor/continuum-store/pom.xml
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractRefactoredContinuumStoreTestCase.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/RefactoredContinuumStoreTestCase.java

Modified: maven/continuum/branches/key-based-refactor/continuum-store/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/pom.xml?view=diff&rev=490643&r1=490642&r2=490643
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/pom.xml (original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/pom.xml Wed Dec 27 20:13:10
2006
@@ -36,7 +36,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-    </dependency>
+    </dependency> 
   </dependencies>
   <build>
     <plugins>

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractRefactoredContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractRefactoredContinuumStoreTestCase.java?view=diff&rev=490643&r1=490642&r2=490643
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractRefactoredContinuumStoreTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractRefactoredContinuumStoreTestCase.java
Wed Dec 27 20:13:10 2006
@@ -3,11 +3,23 @@
  */
 package org.apache.maven.continuum.store;
 
-import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.JdoFactory;
 
+import javax.jdo.PersistenceManager;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
  * 
@@ -17,6 +29,16 @@
     protected RefactoredContinuumStore store;
 
     /**
+     * DDL for Database creation.
+     */
+    protected File sqlSchema = getTestFile( getBasedir(), "src/test/resources/schema.sql"
);
+
+    /**
+     * Test Data.
+     */
+    protected File sqlTestData = getTestFile( getBasedir(), "src/test/resources/testData.sql"
);
+
+    /**
      * Setup JDO Factory
      * 
      * @todo push down to a Jdo specific test
@@ -25,13 +47,87 @@
     {
         DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup(
JdoFactory.ROLE );
 
-        jdoFactory.setUrl( "jdbc:hsqldb:mem:" + getName() );
+        jdoFactory.setUrl( "jdbc:hsqldb:mem:continuum" );
+
+        jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
+
+        jdoFactory.setUserName( "sa" );
+
+        jdoFactory.setPassword( "" );
 
         return (RefactoredContinuumStore) lookup( RefactoredContinuumStore.ROLE );
     }
 
-    protected void createBuildDatabase()
+    protected void createBuildDatabase() throws Exception
     {
-     
+        DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup(
JdoFactory.ROLE );
+
+        jdoFactory.setUrl( "jdbc:hsqldb:mem:continuum" );
+
+        jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
+
+        jdoFactory.setUserName( "sa" );
+
+        jdoFactory.setPassword( "" );
+
+        PersistenceManager pm = jdoFactory.getPersistenceManagerFactory().getPersistenceManager();
+
+        Connection connection = (Connection) pm.getDataStoreConnection().getNativeConnection();
+
+        createStoreFromSQL( sqlSchema, connection );
+
+        createStoreFromSQL( sqlTestData, connection );
+    }
+
+    public void createStoreFromSQL( File sqlData, Connection connection ) throws Exception
+    {
+        FileInputStream fis = new FileInputStream( sqlData );
+        BufferedReader br = new BufferedReader( new InputStreamReader( fis ) );
+        List sqlList = new ArrayList();
+
+        // build a list of SQL statements to execute here
+        String line = br.readLine();
+        StringBuffer sb = new StringBuffer();
+        while ( null != line )
+        {
+            // only add to sql list if its not empty or not commented
+            if ( !line.trim().equals( "" ) && !line.startsWith( "#" ) &&
!line.startsWith( "--" ) )
+            {
+                sb.append( line );
+                // check if the SQL statement was terminated
+                if ( line.endsWith( ";" ) )
+                {
+                    sqlList.add( sb.toString() );
+                    sb = new StringBuffer();
+                }
+            }
+            line = br.readLine();
+        }
+
+        if ( sb.length() > 0 )
+            sqlList.add( sb.toString() );
+
+        // System.out.println( "Running SQL statements..." );
+
+        // Execute list of SQL statements
+        for ( Iterator it = sqlList.iterator(); it.hasNext(); )
+        {
+            String sql = (String) it.next();
+
+            System.out.println( sql );
+
+            try
+            {
+                Statement stmt = connection.createStatement();
+                stmt.execute( sql );
+                connection.commit();
+            }
+            catch ( SQLException e )
+            {
+                connection.rollback();
+                throw e;
+            }
+        }
+        // System.out.println( "Done!" );
     }
 }

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/RefactoredContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/RefactoredContinuumStoreTestCase.java?view=diff&rev=490643&r1=490642&r2=490643
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/RefactoredContinuumStoreTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/RefactoredContinuumStoreTestCase.java
Wed Dec 27 20:13:10 2006
@@ -16,9 +16,9 @@
         createBuildDatabase();
     }
 
-    public void saveProjectGroup()
+    public void testBasic()
     {
-
+        // TODO: do something
     }
 
 }

Added: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/schema.sql
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/schema.sql?view=auto&rev=490643
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/schema.sql
(added)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/schema.sql
Wed Dec 27 20:13:10 2006
@@ -0,0 +1,408 @@
+# This file was generated from the continuum-model
+
+CREATE TABLE BUILDDEFINITION
+(
+    ID INTEGER NOT NULL,
+    ARGUMENTS VARCHAR(256) NULL,
+    BUILD_FILE VARCHAR(256) NULL,
+    BUILD_FRESH BOOLEAN NOT NULL,
+    DEFAULT_FOR_PROJECT BOOLEAN NOT NULL,
+    GOALS VARCHAR(256) NULL,
+    LATEST_BUILD_ID INTEGER DEFAULT 0 NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    PROFILE_ID_OID INTEGER NULL,
+    SCHEDULE_ID_OID INTEGER NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE BUILDRESULT
+(
+    ID INTEGER NOT NULL,
+    BUILD_NUMBER INTEGER NOT NULL,
+    END_TIME BIGINT NOT NULL,
+    ERROR VARCHAR(8192) NULL,
+    EXIT_CODE INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    PROJECT_ID_OID INTEGER NULL,
+    SCM_RESULT_SCMRESULT_ID_OID BIGINT NULL,
+    START_TIME BIGINT NOT NULL,
+    "STATE" INTEGER NOT NULL,
+    SUCCESS BOOLEAN NOT NULL,
+    TEST_RESULT_TESTRESULT_ID_OID BIGINT NULL,
+    "TRIGGER" INTEGER NOT NULL,
+    BUILDRESULTS_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE BUILDRESULT_MODIFIEDDEPENDENCIES
+(
+    ID_OID INTEGER NOT NULL,
+    PROJECTDEPENDENCY_ID_EID BIGINT NULL,
+    IDX INTEGER NOT NULL,
+    PRIMARY KEY (ID_OID,IDX)
+);
+
+CREATE TABLE CHANGEFILE
+(
+    CHANGEFILE_ID BIGINT NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    REVISION VARCHAR(256) NULL,
+    STATUS VARCHAR(256) NULL,
+    FILES_CHANGESET_ID_OID BIGINT NULL,
+    FILES_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (CHANGEFILE_ID)
+);
+
+CREATE TABLE CHANGESET
+(
+    CHANGESET_ID BIGINT NOT NULL,
+    AUTHOR VARCHAR(256) NULL,
+    COMMENT VARCHAR(8192) NULL,
+    "DATE" BIGINT NOT NULL,
+    ID VARCHAR(256) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    CHANGES_SCMRESULT_ID_OID BIGINT NULL,
+    CHANGES_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (CHANGESET_ID)
+);
+
+CREATE TABLE CONTINUUMMODELLOMETADATA
+(
+    CONTINUUMMODELLOMETADATA_ID BIGINT NOT NULL,
+    MODEL_VERSION VARCHAR(256) DEFAULT '1.1.0' NULL,
+    PRIMARY KEY (CONTINUUMMODELLOMETADATA_ID)
+);
+
+CREATE TABLE INSTALLATION
+(
+    "NAME" VARCHAR(256) NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "PATH" VARCHAR(256) NULL,
+    VERSION VARCHAR(256) NULL,
+    PRIMARY KEY ("NAME")
+);
+
+CREATE TABLE NOTIFICATIONADDRESS
+(
+    NOTIFICATIONADDRESS_ID BIGINT NOT NULL,
+    ADDRESS VARCHAR(256) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "TYPE" VARCHAR(256) NULL,
+    PRIMARY KEY (NOTIFICATIONADDRESS_ID)
+);
+
+CREATE TABLE NOTIFICATIONADDRESS_CONFIGURATION
+(
+    NOTIFICATIONADDRESS_ID_OID BIGINT NOT NULL,
+    STRING_KEY VARCHAR(256) NOT NULL,
+    STRING_VAL VARCHAR(256) NULL,
+    PRIMARY KEY (NOTIFICATIONADDRESS_ID_OID,STRING_KEY)
+);
+
+CREATE TABLE PROFILE
+(
+    ID INTEGER NOT NULL,
+    ACTIVE BOOLEAN NOT NULL,
+    BUILD_WITHOUT_CHANGES BOOLEAN NOT NULL,
+    BUILDER_NAME_OID VARCHAR(256) NULL,
+    DESCRIPTION VARCHAR(256) NULL,
+    JDK_NAME_OID VARCHAR(256) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    SCM_MODE INTEGER NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE PROJECT
+(
+    ID INTEGER NOT NULL,
+    ARTIFACT_ID VARCHAR(256) NULL,
+    BUILD_NUMBER INTEGER NOT NULL,
+    CHECKOUT_RESULT_SCMRESULT_ID_OID BIGINT NULL,
+    DESCRIPTION VARCHAR(8192) NULL,
+    EXECUTOR_ID VARCHAR(256) NULL,
+    GROUP_ID VARCHAR(256) NULL,
+    GROUP_KEY VARCHAR(256) NOT NULL,
+    PROJECTKEY VARCHAR(256) NOT NULL,
+    LATEST_BUILD_ID INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    OLD_STATE INTEGER NOT NULL,
+    PARENT_PROJECTDEPENDENCY_ID_OID BIGINT NULL,
+    PROJECT_GROUP_ID_OID INTEGER NOT NULL,
+    SCM_PASSWORD VARCHAR(256) NULL,
+    SCM_TAG VARCHAR(256) NULL,
+    SCM_URL VARCHAR(256) NULL,
+    SCM_USERNAME VARCHAR(256) NULL,
+    "STATE" INTEGER NOT NULL,
+    URL VARCHAR(256) NULL,
+    VERSION VARCHAR(256) NULL,
+    WORKING_DIRECTORY VARCHAR(256) NULL,
+    PROJECTS_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE PROJECTDEPENDENCY
+(
+    PROJECTDEPENDENCY_ID BIGINT NOT NULL,
+    ARTIFACT_ID VARCHAR(256) NULL,
+    GROUP_ID VARCHAR(256) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    VERSION VARCHAR(256) NULL,
+    DEPENDENCIES_ID_OWN INTEGER NULL,
+    DEPENDENCIES_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (PROJECTDEPENDENCY_ID)
+);
+
+CREATE TABLE PROJECTDEVELOPER
+(
+    PROJECTDEVELOPER_ID BIGINT NOT NULL,
+    CONTINUUM_ID INTEGER NOT NULL,
+    EMAIL VARCHAR(256) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    SCM_ID VARCHAR(256) NULL,
+    DEVELOPERS_ID_OWN INTEGER NULL,
+    DEVELOPERS_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (PROJECTDEVELOPER_ID)
+);
+
+CREATE TABLE PROJECTGROUP
+(
+    ID INTEGER NOT NULL,
+    DESCRIPTION VARCHAR(8192) NULL,
+    GROUP_ID VARCHAR(256) NULL,
+    GROUPKEY VARCHAR(256) NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE PROJECTGROUP_BUILDDEFINITIONS
+(
+    ID_OID INTEGER NOT NULL,
+    ID_EID INTEGER NULL,
+    IDX INTEGER NOT NULL,
+    PRIMARY KEY (ID_OID,IDX)
+);
+
+CREATE TABLE PROJECTGROUP_NOTIFIERS
+(
+    ID_OID INTEGER NOT NULL,
+    ID_EID INTEGER NULL,
+    IDX INTEGER NOT NULL,
+    PRIMARY KEY (ID_OID,IDX)
+);
+
+CREATE TABLE PROJECTNOTIFIER
+(
+    ID INTEGER NOT NULL,
+    ENABLED BOOLEAN NOT NULL,
+    NOTIFIERORIGIN INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    RECIPIENT_TYPE INTEGER NOT NULL,
+    SEND_ON_ERROR BOOLEAN NOT NULL,
+    SEND_ON_FAILURE BOOLEAN NOT NULL,
+    SEND_ON_SUCCESS BOOLEAN NOT NULL,
+    SEND_ON_WARNING BOOLEAN NOT NULL,
+    "TYPE" VARCHAR(256) NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE PROJECTNOTIFIER_CONFIGURATION
+(
+    ID_OID INTEGER NOT NULL,
+    STRING_KEY VARCHAR(256) NOT NULL,
+    STRING_VAL VARCHAR(256) NULL,
+    PRIMARY KEY (ID_OID,STRING_KEY)
+);
+
+CREATE TABLE PROJECT_BUILDDEFINITIONS
+(
+    ID_OID INTEGER NOT NULL,
+    ID_EID INTEGER NULL,
+    IDX INTEGER NOT NULL,
+    PRIMARY KEY (ID_OID,IDX)
+);
+
+CREATE TABLE PROJECT_NOTIFIERS
+(
+    ID_OID INTEGER NOT NULL,
+    ID_EID INTEGER NULL,
+    IDX INTEGER NOT NULL,
+    PRIMARY KEY (ID_OID,IDX)
+);
+
+CREATE TABLE SCHEDULE
+(
+    ID INTEGER NOT NULL,
+    ACTIVE BOOLEAN NOT NULL,
+    CRON_EXPRESSION VARCHAR(256) NULL,
+    DELAY INTEGER NOT NULL,
+    DESCRIPTION VARCHAR(256) NULL,
+    MAX_JOB_EXECUTION_TIME INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    PRIMARY KEY (ID)
+);
+
+CREATE TABLE SCMRESULT
+(
+    SCMRESULT_ID BIGINT NOT NULL,
+    COMMAND_LINE VARCHAR(256) NULL,
+    COMMAND_OUTPUT VARCHAR(1024) NULL,
+    EXCEPTIONSTRING VARCHAR(8192) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    PROVIDER_MESSAGE VARCHAR(1024) NULL,
+    SUCCESS BOOLEAN NOT NULL,
+    PRIMARY KEY (SCMRESULT_ID)
+);
+
+CREATE TABLE SUITERESULT
+(
+    SUITERESULT_ID BIGINT NOT NULL,
+    FAILURE_COUNT INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    TEST_COUNT INTEGER NOT NULL,
+    TOTAL_TIME BIGINT NOT NULL,
+    SUITE_RESULTS_TESTRESULT_ID_OID BIGINT NULL,
+    SUITERESULTS_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (SUITERESULT_ID)
+);
+
+CREATE TABLE SYSTEMCONFIGURATION
+(
+    SYSTEMCONFIGURATION_ID BIGINT NOT NULL,
+    BASE_URL VARCHAR(256) NULL,
+    BUILD_OUTPUT_DIRECTORY VARCHAR(256) NULL,
+    DEFAULT_SCHEDULE_CRON_EXPRESSION VARCHAR(256) NULL,
+    DEFAULT_SCHEDULE_DESCRIPTION VARCHAR(256) NULL,
+    DEPLOYMENT_REPOSITORY_DIRECTORY VARCHAR(256) NULL,
+    GUEST_ACCOUNT_ENABLED BOOLEAN NOT NULL,
+    INITIALIZED BOOLEAN NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    WORKING_DIRECTORY VARCHAR(256) NULL,
+    PRIMARY KEY (SYSTEMCONFIGURATION_ID)
+);
+
+CREATE TABLE TESTCASEFAILURE
+(
+    TESTCASEFAILURE_ID BIGINT NOT NULL,
+    EXCEPTIONSTRING VARCHAR(8192) NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    "NAME" VARCHAR(256) NULL,
+    FAILURES_SUITERESULT_ID_OID BIGINT NULL,
+    FAILURES_INTEGER_IDX INTEGER NULL,
+    PRIMARY KEY (TESTCASEFAILURE_ID)
+);
+
+CREATE TABLE TESTRESULT
+(
+    TESTRESULT_ID BIGINT NOT NULL,
+    FAILURE_COUNT INTEGER NOT NULL,
+    MODEL_ENCODING VARCHAR(256) NULL,
+    TEST_COUNT INTEGER NOT NULL,
+    TOTAL_TIME BIGINT NOT NULL,
+    PRIMARY KEY (TESTRESULT_ID)
+);
+
+ALTER TABLE BUILDDEFINITION ADD CONSTRAINT BUILDDEFINITION_FK1 FOREIGN KEY (PROFILE_ID_OID)
REFERENCES PROFILE (ID) ;
+
+ALTER TABLE BUILDDEFINITION ADD CONSTRAINT BUILDDEFINITION_FK2 FOREIGN KEY (SCHEDULE_ID_OID)
REFERENCES SCHEDULE (ID) ;
+
+CREATE INDEX BUILDDEFINITION_N50 ON BUILDDEFINITION (PROFILE_ID_OID);
+
+CREATE INDEX BUILDDEFINITION_N49 ON BUILDDEFINITION (SCHEDULE_ID_OID);
+
+ALTER TABLE BUILDRESULT ADD CONSTRAINT BUILDRESULT_FK1 FOREIGN KEY (TEST_RESULT_TESTRESULT_ID_OID)
REFERENCES TESTRESULT (TESTRESULT_ID) ;
+
+ALTER TABLE BUILDRESULT ADD CONSTRAINT BUILDRESULT_FK2 FOREIGN KEY (PROJECT_ID_OID) REFERENCES
PROJECT (ID) ;
+
+ALTER TABLE BUILDRESULT ADD CONSTRAINT BUILDRESULT_FK3 FOREIGN KEY (SCM_RESULT_SCMRESULT_ID_OID)
REFERENCES SCMRESULT (SCMRESULT_ID) ;
+
+CREATE INDEX BUILDRESULT_N49 ON BUILDRESULT (PROJECT_ID_OID);
+
+CREATE INDEX BUILDRESULT_N50 ON BUILDRESULT (SCM_RESULT_SCMRESULT_ID_OID);
+
+CREATE INDEX BUILDRESULT_N51 ON BUILDRESULT (TEST_RESULT_TESTRESULT_ID_OID);
+
+ALTER TABLE BUILDRESULT_MODIFIEDDEPENDENCIES ADD CONSTRAINT BUILDRESULT_MODIFIEDDEPENDENCIES_FK1
FOREIGN KEY (ID_OID) REFERENCES BUILDRESULT (ID) ;
+
+ALTER TABLE BUILDRESULT_MODIFIEDDEPENDENCIES ADD CONSTRAINT BUILDRESULT_MODIFIEDDEPENDENCIES_FK2
FOREIGN KEY (PROJECTDEPENDENCY_ID_EID) REFERENCES PROJECTDEPENDENCY (PROJECTDEPENDENCY_ID)
;
+
+CREATE INDEX BUILDRESULT_MODIFIEDDEPENDENCIES_N49 ON BUILDRESULT_MODIFIEDDEPENDENCIES (PROJECTDEPENDENCY_ID_EID);
+
+ALTER TABLE CHANGEFILE ADD CONSTRAINT CHANGEFILE_FK1 FOREIGN KEY (FILES_CHANGESET_ID_OID)
REFERENCES CHANGESET (CHANGESET_ID) ;
+
+CREATE INDEX CHANGEFILE_N49 ON CHANGEFILE (FILES_CHANGESET_ID_OID);
+
+ALTER TABLE CHANGESET ADD CONSTRAINT CHANGESET_FK1 FOREIGN KEY (CHANGES_SCMRESULT_ID_OID)
REFERENCES SCMRESULT (SCMRESULT_ID) ;
+
+CREATE INDEX CHANGESET_N49 ON CHANGESET (CHANGES_SCMRESULT_ID_OID);
+
+ALTER TABLE NOTIFICATIONADDRESS_CONFIGURATION ADD CONSTRAINT NOTIFICATIONADDRESS_CONFIGURATION_FK1
FOREIGN KEY (NOTIFICATIONADDRESS_ID_OID) REFERENCES NOTIFICATIONADDRESS (NOTIFICATIONADDRESS_ID)
;
+
+ALTER TABLE PROFILE ADD CONSTRAINT PROFILE_FK2 FOREIGN KEY (JDK_NAME_OID) REFERENCES INSTALLATION
("NAME") ;
+
+ALTER TABLE PROFILE ADD CONSTRAINT PROFILE_FK1 FOREIGN KEY (BUILDER_NAME_OID) REFERENCES
INSTALLATION ("NAME") ;
+
+CREATE INDEX PROFILE_N50 ON PROFILE (JDK_NAME_OID);
+
+CREATE INDEX PROFILE_N49 ON PROFILE (BUILDER_NAME_OID);
+
+ALTER TABLE PROJECT ADD CONSTRAINT PROJECT_FK2 FOREIGN KEY (PARENT_PROJECTDEPENDENCY_ID_OID)
REFERENCES PROJECTDEPENDENCY (PROJECTDEPENDENCY_ID) ;
+
+ALTER TABLE PROJECT ADD CONSTRAINT PROJECT_FK3 FOREIGN KEY (CHECKOUT_RESULT_SCMRESULT_ID_OID)
REFERENCES SCMRESULT (SCMRESULT_ID) ;
+
+ALTER TABLE PROJECT ADD CONSTRAINT PROJECT_FK1 FOREIGN KEY (PROJECT_GROUP_ID_OID) REFERENCES
PROJECTGROUP (ID) ;
+
+CREATE INDEX PROJECT_N51 ON PROJECT (CHECKOUT_RESULT_SCMRESULT_ID_OID);
+
+CREATE INDEX PROJECT_N50 ON PROJECT (PROJECT_GROUP_ID_OID);
+
+CREATE INDEX PROJECT_N49 ON PROJECT (PARENT_PROJECTDEPENDENCY_ID_OID);
+
+ALTER TABLE PROJECTDEPENDENCY ADD CONSTRAINT PROJECTDEPENDENCY_FK1 FOREIGN KEY (DEPENDENCIES_ID_OWN)
REFERENCES PROJECT (ID) ;
+
+CREATE INDEX PROJECTDEPENDENCY_N49 ON PROJECTDEPENDENCY (DEPENDENCIES_ID_OWN);
+
+ALTER TABLE PROJECTDEVELOPER ADD CONSTRAINT PROJECTDEVELOPER_FK1 FOREIGN KEY (DEVELOPERS_ID_OWN)
REFERENCES PROJECT (ID) ;
+
+CREATE INDEX PROJECTDEVELOPER_N49 ON PROJECTDEVELOPER (DEVELOPERS_ID_OWN);
+
+ALTER TABLE PROJECTGROUP_BUILDDEFINITIONS ADD CONSTRAINT PROJECTGROUP_BUILDDEFINITIONS_FK1
FOREIGN KEY (ID_OID) REFERENCES PROJECTGROUP (ID) ;
+
+ALTER TABLE PROJECTGROUP_BUILDDEFINITIONS ADD CONSTRAINT PROJECTGROUP_BUILDDEFINITIONS_FK2
FOREIGN KEY (ID_EID) REFERENCES BUILDDEFINITION (ID) ;
+
+CREATE INDEX PROJECTGROUP_BUILDDEFINITIONS_N49 ON PROJECTGROUP_BUILDDEFINITIONS (ID_EID);
+
+ALTER TABLE PROJECTGROUP_NOTIFIERS ADD CONSTRAINT PROJECTGROUP_NOTIFIERS_FK1 FOREIGN KEY
(ID_OID) REFERENCES PROJECTGROUP (ID) ;
+
+ALTER TABLE PROJECTGROUP_NOTIFIERS ADD CONSTRAINT PROJECTGROUP_NOTIFIERS_FK2 FOREIGN KEY
(ID_EID) REFERENCES PROJECTNOTIFIER (ID) ;
+
+CREATE INDEX PROJECTGROUP_NOTIFIERS_N49 ON PROJECTGROUP_NOTIFIERS (ID_EID);
+
+ALTER TABLE PROJECTNOTIFIER_CONFIGURATION ADD CONSTRAINT PROJECTNOTIFIER_CONFIGURATION_FK1
FOREIGN KEY (ID_OID) REFERENCES PROJECTNOTIFIER (ID) ;
+
+ALTER TABLE PROJECT_BUILDDEFINITIONS ADD CONSTRAINT PROJECT_BUILDDEFINITIONS_FK1 FOREIGN
KEY (ID_OID) REFERENCES PROJECT (ID) ;
+
+ALTER TABLE PROJECT_BUILDDEFINITIONS ADD CONSTRAINT PROJECT_BUILDDEFINITIONS_FK2 FOREIGN
KEY (ID_EID) REFERENCES BUILDDEFINITION (ID) ;
+
+CREATE INDEX PROJECT_BUILDDEFINITIONS_N49 ON PROJECT_BUILDDEFINITIONS (ID_EID);
+
+ALTER TABLE PROJECT_NOTIFIERS ADD CONSTRAINT PROJECT_NOTIFIERS_FK1 FOREIGN KEY (ID_OID) REFERENCES
PROJECT (ID) ;
+
+ALTER TABLE PROJECT_NOTIFIERS ADD CONSTRAINT PROJECT_NOTIFIERS_FK2 FOREIGN KEY (ID_EID) REFERENCES
PROJECTNOTIFIER (ID) ;
+
+CREATE INDEX PROJECT_NOTIFIERS_N49 ON PROJECT_NOTIFIERS (ID_EID);
+
+ALTER TABLE SUITERESULT ADD CONSTRAINT SUITERESULT_FK1 FOREIGN KEY (SUITE_RESULTS_TESTRESULT_ID_OID)
REFERENCES TESTRESULT (TESTRESULT_ID) ;
+
+CREATE INDEX SUITERESULT_N49 ON SUITERESULT (SUITE_RESULTS_TESTRESULT_ID_OID);
+
+ALTER TABLE TESTCASEFAILURE ADD CONSTRAINT TESTCASEFAILURE_FK1 FOREIGN KEY (FAILURES_SUITERESULT_ID_OID)
REFERENCES SUITERESULT (SUITERESULT_ID) ;
+
+CREATE INDEX TESTCASEFAILURE_N49 ON TESTCASEFAILURE (FAILURES_SUITERESULT_ID_OID);
+

Added: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql?view=auto&rev=490643
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
(added)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
Wed Dec 27 20:13:10 2006
@@ -0,0 +1,24 @@
+# Test data to set up test Continuum database.
+
+# Set up Project Groups
+insert into PROJECTGROUP (ID, DESCRIPTION, GROUP_ID, GROUPKEY, NAME)
+  values (1, 'Group 1' , 'org.apache.maven.continuum', 'Continuum' , 'Continuum Group');
+  
+      
+# Set up projects
+insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
+    PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, OLD_STATE, 
+    PROJECT_GROUP_ID_OID, "STATE")
+  values (1, 'Default Project for Continuum projects',
+    'default-project-artifact',  'org.group.default', 'defaultProject', 
+    'default', 'Default Project', 0, 0, 0, 1, 0);
+insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
+    PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, OLD_STATE, 
+    PROJECT_GROUP_ID_OID, "STATE")
+  values (2, 'Test Project 1', 'project-1',  'org.test.projects', 'project1',
+    'project1', 'Project 1', 0, 0, 0, 1, 0);
+insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
+    PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, 
+    OLD_STATE, PROJECT_GROUP_ID_OID, "STATE")
+  values (3, 'Test Project 2', 'project-2',  'org.test.projects', 'project2',
+    'project2', 'Project 2', 0, 0, 0, 1, 0);



Mime
View raw message