Index: src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java (revision 1176665) +++ src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java (working copy) @@ -16,12 +16,12 @@ */ package org.apache.jackrabbit.core.fs.db; +import javax.sql.DataSource; + import org.apache.jackrabbit.core.util.db.CheckSchemaOperation; import org.apache.jackrabbit.core.util.db.ConnectionHelper; import org.apache.jackrabbit.core.util.db.OracleConnectionHelper; -import javax.sql.DataSource; - /** * OracleFileSystem is a JDBC-based FileSystem * implementation for Jackrabbit that persists file system entries in an @@ -38,7 +38,8 @@ *
  • user: the database user
  • *
  • password: the user's password
  • *
  • schemaObjectPrefix: prefix to be prepended to schema objects
  • - *
  • tableSpace: the tablespace to use
  • + *
  • tablespace: the tablespace to use for tables (also used for indexes if indexTablespace is omitted)
  • + *
  • indexTablespace: the tablespace to use for indexes
  • * * See also {@link DbFileSystem}. *

    @@ -49,15 +50,34 @@ * <param name="user" value="scott"/> * <param name="password" value="tiger"/> * <param name="schemaObjectPrefix" value="rep_"/> - * <param name="tableSpace" value="default"/> + * <param name="tablespace" value="user"/> + * <param name="indexTablespace" value="user"/> * </FileSystem> * */ public class OracleFileSystem extends DbFileSystem { + /** + * The default tablespace clause used when {@link #tablespace} or {@link #indexTablespace} + * are not specified. + */ + protected static final String DEFAULT_TABLESPACE_CLAUSE = ""; + + /** + * Name of the replacement variable in the DDL for {@link #tablespace}. + */ + protected static final String TABLESPACE_VARIABLE = "${tablespace}"; + + /** + * Name of the replacement variable in the DDL for {@link #indexTablespace}. + */ + protected static final String INDEX_TABLESPACE_VARIABLE = "${indexTablespace}"; - /** the Oracle table space to use */ - protected String tableSpace = ""; + /** The Oracle tablespace to use for tables */ + protected String tablespace; + /** The Oracle tablespace to use for indexes */ + protected String indexTablespace; + /** * Creates a new OracleFileSystem instance. */ @@ -66,26 +86,57 @@ schema = "oracle"; driver = "oracle.jdbc.OracleDriver"; schemaObjectPrefix = ""; + tablespace = DEFAULT_TABLESPACE_CLAUSE; + indexTablespace = DEFAULT_TABLESPACE_CLAUSE; initialized = false; } /** - * Returns the configured Oracle table space. - * @return the configured Oracle table space. + * Returns the configured Oracle tablespace for tables. + * @return the configured Oracle tablespace for tables. */ - public String getTableSpace() { - return tableSpace; + public String getTablespace() { + return tablespace; } /** - * Sets the Oracle table space. - * @param tableSpace the Oracle table space. + * Sets the Oracle tablespace for tables. + * @param tablespaceName the Oracle tablespace for tables. */ - public void setTableSpace(String tableSpace) { - if (tableSpace != null && tableSpace.trim().length() > 0) { - this.tableSpace = "tablespace " + tableSpace.trim(); + public void setTablespace(String tablespaceName) { + this.tablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Returns the configured Oracle tablespace for indexes. + * @return the configured Oracle tablespace for indexes. + */ + public String getIndexTablespace() { + return indexTablespace; + } + + /** + * Sets the Oracle tablespace for indexes. + * @param tablespace the Oracle tablespace for indexes. + */ + public void setIndexTablespace(String tablespaceName) { + this.indexTablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Constructs the tablespace <tbs name> clause from + * the supplied tablespace name. If the name is empty, {@link #DEFAULT_TABLESPACE_CLAUSE} + * is returned instead. + * + * @param tablespaceName A tablespace name + * @return A tablespace clause using the supplied name or + * {@value #DEFAULT_TABLESPACE_CLAUSE} if the name is empty + */ + private String buildTablespaceClause(String tablespaceName) { + if (tablespaceName == null || tablespaceName.trim().length() == 0) { + return DEFAULT_TABLESPACE_CLAUSE; } else { - this.tableSpace = ""; + return "tablespace " + tablespaceName.trim(); } } @@ -106,8 +157,13 @@ */ @Override protected CheckSchemaOperation createCheckSchemaOperation() { - return super.createCheckSchemaOperation().addVariableReplacement( - CheckSchemaOperation.TABLE_SPACE_VARIABLE, tableSpace); + if (DEFAULT_TABLESPACE_CLAUSE.equals(indexTablespace) && !DEFAULT_TABLESPACE_CLAUSE.equals(tablespace)) { + // tablespace was set but not indexTablespace : use the same for both + indexTablespace = tablespace; + } + return super.createCheckSchemaOperation() + .addVariableReplacement(TABLESPACE_VARIABLE, tablespace) + .addVariableReplacement(INDEX_TABLESPACE_VARIABLE, indexTablespace); } //-----------------------------------------< DatabaseFileSystem overrides > Index: src/main/java/org/apache/jackrabbit/core/journal/OracleDatabaseJournal.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/journal/OracleDatabaseJournal.java (revision 1176665) +++ src/main/java/org/apache/jackrabbit/core/journal/OracleDatabaseJournal.java (working copy) @@ -25,25 +25,91 @@ /** * It has the following property in addition to those of the DatabaseJournal: *

    */ public class OracleDatabaseJournal extends DatabaseJournal { + /** + * The default tablespace clause used when {@link #tablespace} or {@link #indexTablespace} + * are not specified. + */ + protected static final String DEFAULT_TABLESPACE_CLAUSE = ""; + + /** + * Name of the replacement variable in the DDL for {@link #tablespace}. + */ + protected static final String TABLESPACE_VARIABLE = "${tablespace}"; + + /** + * Name of the replacement variable in the DDL for {@link #indexTablespace}. + */ + protected static final String INDEX_TABLESPACE_VARIABLE = "${indexTablespace}"; - /** the variable for the Oracle table space */ - public static final String TABLE_SPACE_VARIABLE = - "${tableSpace}"; + /** The Oracle tablespace to use for tables */ + protected String tablespace; - /** the Oracle table space to use */ - protected String tableSpace = ""; + /** The Oracle tablespace to use for indexes */ + protected String indexTablespace; public OracleDatabaseJournal() { setDatabaseType("oracle"); setDriver("oracle.jdbc.OracleDriver"); setSchemaObjectPrefix(""); + tablespace = DEFAULT_TABLESPACE_CLAUSE; + indexTablespace = DEFAULT_TABLESPACE_CLAUSE; } /** + * Returns the configured Oracle tablespace for tables. + * @return the configured Oracle tablespace for tables. + */ + public String getTablespace() { + return tablespace; + } + + /** + * Sets the Oracle tablespace for tables. + * @param tablespaceName the Oracle tablespace for tables. + */ + public void setTablespace(String tablespaceName) { + this.tablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Returns the configured Oracle tablespace for indexes. + * @return the configured Oracle tablespace for indexes. + */ + public String getIndexTablespace() { + return indexTablespace; + } + + /** + * Sets the Oracle tablespace for indexes. + * @param tablespace the Oracle tablespace for indexes. + */ + public void setIndexTablespace(String tablespaceName) { + this.indexTablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Constructs the tablespace <tbs name> clause from + * the supplied tablespace name. If the name is empty, {@link #DEFAULT_TABLESPACE_CLAUSE} + * is returned instead. + * + * @param tablespaceName A tablespace name + * @return A tablespace clause using the supplied name or + * {@value #DEFAULT_TABLESPACE_CLAUSE} if the name is empty + */ + private String buildTablespaceClause(String tablespaceName) { + if (tablespaceName == null || tablespaceName.trim().length() == 0) { + return DEFAULT_TABLESPACE_CLAUSE; + } else { + return "tablespace " + tablespaceName.trim(); + } + } + + /** * {@inheritDoc} */ @Override @@ -58,27 +124,12 @@ */ @Override protected CheckSchemaOperation createCheckSchemaOperation() { - return super.createCheckSchemaOperation().addVariableReplacement( - CheckSchemaOperation.TABLE_SPACE_VARIABLE, tableSpace); - } - - /** - * Returns the configured Oracle table space. - * @return the configured Oracle table space. - */ - public String getTableSpace() { - return tableSpace; - } - - /** - * Sets the Oracle table space. - * @param tableSpace the Oracle table space. - */ - public void setTableSpace(String tableSpace) { - if (tableSpace != null && tableSpace.trim().length() > 0) { - this.tableSpace = "tablespace " + tableSpace.trim(); - } else { - this.tableSpace = ""; + if (DEFAULT_TABLESPACE_CLAUSE.equals(indexTablespace) && !DEFAULT_TABLESPACE_CLAUSE.equals(tablespace)) { + // tablespace was set but not indexTablespace : use the same for both + indexTablespace = tablespace; } + return super.createCheckSchemaOperation() + .addVariableReplacement(TABLESPACE_VARIABLE, tablespace) + .addVariableReplacement(INDEX_TABLESPACE_VARIABLE, indexTablespace); } } Index: src/main/java/org/apache/jackrabbit/core/persistence/pool/OraclePersistenceManager.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/persistence/pool/OraclePersistenceManager.java (revision 1176665) +++ src/main/java/org/apache/jackrabbit/core/persistence/pool/OraclePersistenceManager.java (working copy) @@ -38,42 +38,90 @@ *
  • <param name="{@link #setPassword(String) password}" value=""/> *
  • <param name="{@link #setSchema(String) schema}" value="oracle"/> *
  • <param name="{@link #setSchemaObjectPrefix(String) schemaObjectPrefix}" value="${wsp.name}_"/> - *
  • <param name="{@link #setTableSpace(String) tableSpace}" value=""/> + *
  • <param name="{@link #setTablespace(String) tableSpace}" value="user"/> + *
  • <param name="{@link #setIndexTablespace(String) tableSpace}" value="user"/> *
  • <param name="{@link #setErrorHandling(String) errorHandling}" value=""/> * */ public class OraclePersistenceManager extends BundleDbPersistenceManager { + /** + * The default tablespace clause used when {@link #tablespace} or {@link #indexTablespace} + * are not specified. + */ + protected static final String DEFAULT_TABLESPACE_CLAUSE = ""; + + /** + * Name of the replacement variable in the DDL for {@link #tablespace}. + */ + protected static final String TABLESPACE_VARIABLE = "${tablespace}"; + + /** + * Name of the replacement variable in the DDL for {@link #indexTablespace}. + */ + protected static final String INDEX_TABLESPACE_VARIABLE = "${indexTablespace}"; - /** the Oracle table space to use */ - protected String tableSpace = ""; + /** The Oracle tablespace to use for tables */ + protected String tablespace; + /** The Oracle tablespace to use for indexes */ + protected String indexTablespace; + /** * Creates a new oracle persistence manager */ public OraclePersistenceManager() { + tablespace = DEFAULT_TABLESPACE_CLAUSE; + indexTablespace = DEFAULT_TABLESPACE_CLAUSE; // enable db blob support setExternalBLOBs(false); } /** - * Returns the configured Oracle table space. - * - * @return the configured Oracle table space. + * Returns the configured Oracle tablespace for tables. + * @return the configured Oracle tablespace for tables. */ - public String getTableSpace() { - return tableSpace; + public String getTablespace() { + return tablespace; } /** - * Sets the Oracle table space. + * Sets the Oracle tablespace for tables. + * @param tablespaceName the Oracle tablespace for tables. + */ + public void setTablespace(String tablespaceName) { + this.tablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Returns the configured Oracle tablespace for indexes. + * @return the configured Oracle tablespace for indexes. + */ + public String getIndexTablespace() { + return indexTablespace; + } + + /** + * Sets the Oracle tablespace for indexes. + * @param tablespace the Oracle tablespace for indexes. + */ + public void setIndexTablespace(String tablespaceName) { + this.indexTablespace = this.buildTablespaceClause(tablespaceName); + } + + /** + * Constructs the tablespace <tbs name> clause from + * the supplied tablespace name. If the name is empty, {@link #DEFAULT_TABLESPACE_CLAUSE} + * is returned instead. * - * @param tableSpace the Oracle table space. + * @param tablespaceName A tablespace name + * @return A tablespace clause using the supplied name or + * {@value #DEFAULT_TABLESPACE_CLAUSE} if the name is empty */ - public void setTableSpace(String tableSpace) { - if (tableSpace != null && tableSpace.trim().length() > 0) { - this.tableSpace = "tablespace " + tableSpace.trim(); + private String buildTablespaceClause(String tablespaceName) { + if (tablespaceName == null || tablespaceName.trim().length() == 0) { + return DEFAULT_TABLESPACE_CLAUSE; } else { - this.tableSpace = ""; + return "tablespace " + tablespaceName.trim(); } } @@ -119,7 +167,12 @@ */ @Override protected CheckSchemaOperation createCheckSchemaOperation() { - return super.createCheckSchemaOperation().addVariableReplacement( - CheckSchemaOperation.TABLE_SPACE_VARIABLE, tableSpace); + if (DEFAULT_TABLESPACE_CLAUSE.equals(indexTablespace) && !DEFAULT_TABLESPACE_CLAUSE.equals(tablespace)) { + // tablespace was set but not indexTablespace : use the same for both + indexTablespace = tablespace; + } + return super.createCheckSchemaOperation() + .addVariableReplacement(TABLESPACE_VARIABLE, tablespace) + .addVariableReplacement(INDEX_TABLESPACE_VARIABLE, indexTablespace); } } Index: src/main/resources/org/apache/jackrabbit/core/fs/db/oracle.ddl =================================================================== --- src/main/resources/org/apache/jackrabbit/core/fs/db/oracle.ddl (revision 1176665) +++ src/main/resources/org/apache/jackrabbit/core/fs/db/oracle.ddl (working copy) @@ -12,5 +12,5 @@ # 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. -create table ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH varchar2(2048) not null, FSENTRY_NAME varchar2(255) not null, FSENTRY_DATA blob null, FSENTRY_LASTMOD number(38,0) not null, FSENTRY_LENGTH number(38,0) null) ${tableSpace} -create unique index ${schemaObjectPrefix}FSENTRY_IDX on ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH, FSENTRY_NAME) ${tableSpace} +create table ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH varchar2(2048) not null, FSENTRY_NAME varchar2(255) not null, FSENTRY_DATA blob null, FSENTRY_LASTMOD number(38,0) not null, FSENTRY_LENGTH number(38,0) null) ${tablespace} +create unique index ${schemaObjectPrefix}FSENTRY_IDX on ${schemaObjectPrefix}FSENTRY (FSENTRY_PATH, FSENTRY_NAME) ${indexTablespace} Index: src/main/resources/org/apache/jackrabbit/core/journal/oracle.ddl =================================================================== --- src/main/resources/org/apache/jackrabbit/core/journal/oracle.ddl (revision 1176665) +++ src/main/resources/org/apache/jackrabbit/core/journal/oracle.ddl (working copy) @@ -12,11 +12,13 @@ # 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. -create table ${schemaObjectPrefix}JOURNAL (REVISION_ID number(20,0) NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA blob) ${tableSpace} -create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID) ${tableSpace} -create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID number(20,0) NOT NULL) ${tableSpace} -create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID) ${tableSpace} -create table ${schemaObjectPrefix}LOCAL_REVISIONS (JOURNAL_ID varchar(255) NOT NULL, REVISION_ID number(20,0) NOT NULL) +create table ${schemaObjectPrefix}JOURNAL (REVISION_ID number(20,0) NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA blob) ${tablespace} +create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID) ${indexTablespace} +create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID number(20,0) NOT NULL) ${tablespace} +create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID) ${indexTablespace} + +create table ${schemaObjectPrefix}LOCAL_REVISIONS (JOURNAL_ID varchar(255) NOT NULL, REVISION_ID number(20,0) NOT NULL) ${tablespace} + # Inserting the one and only revision counter record now helps avoiding race conditions insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0) Index: src/main/resources/org/apache/jackrabbit/core/persistence/bundle/oracle.ddl =================================================================== --- src/main/resources/org/apache/jackrabbit/core/persistence/bundle/oracle.ddl (revision 1176665) +++ src/main/resources/org/apache/jackrabbit/core/persistence/bundle/oracle.ddl (working copy) @@ -12,16 +12,17 @@ # 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. -create table ${schemaObjectPrefix}BUNDLE (NODE_ID raw(16) not null, BUNDLE_DATA blob not null) ${tableSpace} -create unique index ${schemaObjectPrefix}BUNDLE_IDX on ${schemaObjectPrefix}BUNDLE (NODE_ID) ${tableSpace} +create table ${schemaObjectPrefix}BUNDLE (NODE_ID raw(16) not null, BUNDLE_DATA blob not null) ${tablespace} +create unique index ${schemaObjectPrefix}BUNDLE_IDX on ${schemaObjectPrefix}BUNDLE (NODE_ID) ${indexTablespace} -create table ${schemaObjectPrefix}REFS (NODE_ID raw(16) not null, REFS_DATA blob not null) ${tableSpace} -create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID) ${tableSpace} +create table ${schemaObjectPrefix}REFS (NODE_ID raw(16) not null, REFS_DATA blob not null) ${tablespace} +create unique index ${schemaObjectPrefix}REFS_IDX on ${schemaObjectPrefix}REFS (NODE_ID) ${indexTablespace} -create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar2(64) not null, BINVAL_DATA blob null) ${tableSpace} -create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID) ${tableSpace} +create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar2(64) not null, BINVAL_DATA blob null) ${tablespace} +create unique index ${schemaObjectPrefix}BINVAL_IDX on ${schemaObjectPrefix}BINVAL (BINVAL_ID) ${indexTablespace} -create table ${schemaObjectPrefix}NAMES (ID INTEGER primary key, NAME varchar2(255) not null) ${tableSpace} -create unique index ${schemaObjectPrefix}NAMES_IDX on ${schemaObjectPrefix}NAMES (NAME) ${tableSpace} +create table ${schemaObjectPrefix}NAMES (ID INTEGER primary key using index ${indexTablespace}, NAME varchar2(255) not null) ${tablespace} +create unique index ${schemaObjectPrefix}NAMES_IDX on ${schemaObjectPrefix}NAMES (NAME) ${indexTablespace} + create sequence ${schemaObjectPrefix}seq_names_id create trigger ${schemaObjectPrefix}t1 before insert on ${schemaObjectPrefix}NAMES for each row begin select ${schemaObjectPrefix}seq_names_id.nextval into :new.id from dual; end; \ No newline at end of file Index: src/test/java/org/apache/jackrabbit/core/OracleRepositoryTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/OracleRepositoryTest.java (revision 0) +++ src/test/java/org/apache/jackrabbit/core/OracleRepositoryTest.java (revision 0) @@ -0,0 +1,60 @@ +package org.apache.jackrabbit.core; + +import java.io.File; +import java.io.InputStream; +import java.util.Properties; + +import javax.jcr.Session; + +import junit.framework.TestCase; + +import org.apache.commons.io.FileUtils; +import org.apache.jackrabbit.core.config.RepositoryConfig; + +/** + * Tests the creation of a repository using Oracle persistence and different table and index tablespaces. + * + * @author Edouard Hue + */ +public class OracleRepositoryTest extends TestCase { + private File dir; + + private RepositoryConfig config; + + protected void setUp() throws Exception { + final Properties sysProps = System.getProperties(); + if (!sysProps.containsKey("tests.oracle.url") + || !sysProps.containsKey("tests.oracle.user") + || !sysProps.containsKey("tests.oracle.password") + || !sysProps.containsKey("tests.oracle.tablespace") + || !sysProps.containsKey("tests.oracle.indexTablespace")) { + throw new IllegalStateException("Missing system property for test"); + } + dir = File.createTempFile("jackrabbit_", null, new File("target")); + dir.delete(); + dir.mkdir(); + final InputStream in = getClass().getResourceAsStream( + "/org/apache/jackrabbit/core/repository-oracle.xml"); + config = RepositoryConfig.create(in, dir.getPath()); + } + + /** + * Attempt to start a {@link TransientRepository} using {@link #config}, open + * a new session with default credentials and workspace, then shutdown the repo. + */ + public void testConfiguration() throws Exception { + final TransientRepository repo = new TransientRepository(config); + try { + final Session session = repo.login(); + session.logout(); + } finally { + repo.shutdown(); + } + } + + protected void tearDown() throws Exception { + if (dir != null) { + FileUtils.deleteQuietly(dir); + } + } +} Index: src/test/java/org/apache/jackrabbit/core/OracleRetrocompatibleRepositoryTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/OracleRetrocompatibleRepositoryTest.java (revision 0) +++ src/test/java/org/apache/jackrabbit/core/OracleRetrocompatibleRepositoryTest.java (revision 0) @@ -0,0 +1,59 @@ +package org.apache.jackrabbit.core; + +import java.io.File; +import java.io.InputStream; +import java.util.Properties; + +import javax.jcr.Session; + +import junit.framework.TestCase; + +import org.apache.commons.io.FileUtils; +import org.apache.jackrabbit.core.config.RepositoryConfig; + +/** + * Tests the creation of a repository using Oracle persistence and no index tablespace specified. + * + * @author Edouard Hue + */ +public class OracleRetrocompatibleRepositoryTest extends TestCase { + private File dir; + + private RepositoryConfig config; + + protected void setUp() throws Exception { + final Properties sysProps = System.getProperties(); + if (!sysProps.containsKey("tests.oracle.url") + || !sysProps.containsKey("tests.oracle.user") + || !sysProps.containsKey("tests.oracle.password") + || !sysProps.containsKey("tests.oracle.tablespace")) { + throw new IllegalStateException("Missing system property for test"); + } + dir = File.createTempFile("jackrabbit_", null, new File("target")); + dir.delete(); + dir.mkdir(); + final InputStream in = getClass().getResourceAsStream( + "/org/apache/jackrabbit/core/repository-oracle-compat.xml"); + config = RepositoryConfig.create(in, dir.getPath()); + } + + /** + * Attempt to start a {@link TransientRepository} using {@link #config}, open + * a new session with default credentials and workspace, then shutdown the repo. + */ + public void testConfiguration() throws Exception { + final TransientRepository repo = new TransientRepository(config); + try { + final Session session = repo.login(); + session.logout(); + } finally { + repo.shutdown(); + } + } + + protected void tearDown() throws Exception { + if (dir != null) { + FileUtils.deleteQuietly(dir); + } + } +} Index: src/test/java/org/apache/jackrabbit/core/fs/db/OracleFileSystemTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/fs/db/OracleFileSystemTest.java (revision 0) +++ src/test/java/org/apache/jackrabbit/core/fs/db/OracleFileSystemTest.java (revision 0) @@ -0,0 +1,30 @@ +package org.apache.jackrabbit.core.fs.db; + +import org.apache.jackrabbit.core.fs.AbstractFileSystemTest; +import org.apache.jackrabbit.core.fs.FileSystem; +import org.apache.jackrabbit.core.util.db.ConnectionFactory; + +/** + * Tests the creation of an Oracle file system with different tablespace and index tablespace. + * + * @author Edouard Hue + */ +public class OracleFileSystemTest extends AbstractFileSystemTest { + private ConnectionFactory connectionFactory; + + @Override + protected FileSystem getFileSystem() throws Exception { + connectionFactory = new ConnectionFactory(); + final OracleFileSystem fs = new OracleFileSystem(); + fs.setConnectionFactory(connectionFactory); + fs.setUrl(System.getProperty("tests.oracle.url")); + fs.setUser(System.getProperty("tests.oracle.user")); + fs.setPassword(System.getProperty("tests.oracle.password")); + fs.setDriver(System.getProperty("tests.oracle.driver", "oracle.jdbc.driver.OracleDriver")); + fs.setSchemaObjectPrefix(System.getProperty("tests.oracle.schemaObjectPrefix", "")); + fs.setTablespace(System.getProperty("tests.oracle.tablespace")); + fs.setIndexTablespace(System.getProperty("tests.oracle.indexTablespace")); + fs.setSchema("oracle"); + return fs; + } +} Index: src/test/java/org/apache/jackrabbit/core/fs/db/OracleRetrocompatibleFileSystemTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/fs/db/OracleRetrocompatibleFileSystemTest.java (revision 0) +++ src/test/java/org/apache/jackrabbit/core/fs/db/OracleRetrocompatibleFileSystemTest.java (revision 0) @@ -0,0 +1,29 @@ +package org.apache.jackrabbit.core.fs.db; + +import org.apache.jackrabbit.core.fs.AbstractFileSystemTest; +import org.apache.jackrabbit.core.fs.FileSystem; +import org.apache.jackrabbit.core.util.db.ConnectionFactory; + +/** + * Tests the creation of an Oracle file system with no index tablespace specified. + * + * @author Edouard Hue + */ +public class OracleRetrocompatibleFileSystemTest extends AbstractFileSystemTest { + private ConnectionFactory connectionFactory; + + @Override + protected FileSystem getFileSystem() throws Exception { + connectionFactory = new ConnectionFactory(); + final OracleFileSystem fs = new OracleFileSystem(); + fs.setConnectionFactory(connectionFactory); + fs.setUrl(System.getProperty("tests.oracle.url")); + fs.setUser(System.getProperty("tests.oracle.user")); + fs.setPassword(System.getProperty("tests.oracle.password")); + fs.setDriver(System.getProperty("tests.oracle.driver", "oracle.jdbc.driver.OracleDriver")); + fs.setSchemaObjectPrefix(System.getProperty("tests.oracle.schemaObjectPrefix", "")); + fs.setTablespace(System.getProperty("tests.oracle.tablespace")); + fs.setSchema("oracle"); + return fs; + } +} Index: src/test/resources/org/apache/jackrabbit/core/repository-oracle-compat.xml =================================================================== --- src/test/resources/org/apache/jackrabbit/core/repository-oracle-compat.xml (revision 0) +++ src/test/resources/org/apache/jackrabbit/core/repository-oracle-compat.xml (revision 0) @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: src/test/resources/org/apache/jackrabbit/core/repository-oracle.xml =================================================================== --- src/test/resources/org/apache/jackrabbit/core/repository-oracle.xml (revision 0) +++ src/test/resources/org/apache/jackrabbit/core/repository-oracle.xml (revision 0) @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +