JBoss Portal SVN: r12471 - in modules/cms/trunk/cms-jackrabbit: src/main/java/org/jboss/portal/cms/hibernate and 7 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-01-12 18:13:25 -0500 (Mon, 12 Jan 2009)
New Revision: 12471
Added:
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/CMSFile.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortability.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortabilityTestCase.java
modules/cms/trunk/cms-jackrabbit/src/test/resources/blobs.hbm.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/hibernate.cfg.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-blobs.xml
Modified:
modules/cms/trunk/cms-jackrabbit/pom.xml
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/jackrabbit/JackrabbitJCRService.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java
modules/cms/trunk/cms-jackrabbit/src/test/resources/datasources.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/domain.hbm.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml
Log:
backing up code (stuff may still break right now)
Modified: modules/cms/trunk/cms-jackrabbit/pom.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/pom.xml 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/pom.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -224,7 +224,7 @@
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
- <version>10.0.2.0</version>
+ <version>10.2.0.4</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -237,7 +237,7 @@
</profiles>
<build>
- <plugins>
+ <plugins>
<plugin>
<groupId>
org.jvnet.maven-antrun-extended-plugin
@@ -334,6 +334,18 @@
<compilerArgument>-nowarn</compilerArgument>
</configuration>
</plugin>
+ <!--
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <includes>
+ <include>**/TestBlobPortabilityTestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ -->
</plugins>
</build>
</project>
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -33,7 +33,7 @@
private Integer key;
private String path;
private String name;
- private java.sql.Blob data;
+ private byte[] data;
private long lastmod;
private long length;
@@ -41,7 +41,7 @@
{
}
- public CMSEntry(String path, String name, java.sql.Blob data, long lastmod, long length)
+ public CMSEntry(String path, String name, byte[] data, long lastmod, long length)
{
this.key = null;
this.path = path;
@@ -81,12 +81,12 @@
this.name = name;
}
- public java.sql.Blob getData()
+ public byte[] getData()
{
return data;
}
- public void setData(java.sql.Blob data)
+ public void setData(byte[] data)
{
this.data = data;
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -215,7 +215,7 @@
String parentDir = FileSystemPathUtil.getParentDir(filePath);
String name = FileSystemPathUtil.getName(filePath);
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
@@ -263,33 +263,19 @@
}
}
- tx.commit();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to delete file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
- private void closeSession(Session session)
- {
- if (session != null)
- {
- if (session.isOpen())
- {
- session.close();
- }
- }
- }
-
-
/**
*
*/
@@ -310,7 +296,7 @@
String parentDir = FileSystemPathUtil.getParentDir(folderPath);
String name = FileSystemPathUtil.getName(folderPath);
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
@@ -364,19 +350,17 @@
}
}
- tx.commit();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to delete folder: " + folderPath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -394,8 +378,8 @@
String parentDir = FileSystemPathUtil.getParentDir(path);
String name = FileSystemPathUtil.getName(path);
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectExistStmt)
@@ -411,14 +395,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to check existence of file system entry: " + path;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
return false;
}
@@ -437,8 +421,8 @@
String parentDir = FileSystemPathUtil.getParentDir(path);
String name = FileSystemPathUtil.getName(path);
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectFileExistStmt)
@@ -455,14 +439,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to check existence of file: " + path;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -480,8 +464,8 @@
String parentDir = FileSystemPathUtil.getParentDir(path);
String name = FileSystemPathUtil.getName(path);
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectFolderExistStmt)
@@ -498,14 +482,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to check existence of folder: " + path;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -523,8 +507,8 @@
String parentDir = FileSystemPathUtil.getParentDir(path);
String name = FileSystemPathUtil.getName(path);
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectLastModifiedStmt)
@@ -541,14 +525,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to determine lastModified of file system entry: " + path;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -566,8 +550,8 @@
String parentDir = FileSystemPathUtil.getParentDir(filePath);
String name = FileSystemPathUtil.getName(filePath);
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectLengthStmt)
@@ -584,14 +568,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to determine length of file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -611,8 +595,8 @@
throw new FileSystemException("no such file system entry: " + path);
}
- Session session = hibernateSessionFactory.openSession();
-
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectChildCountStmt)
@@ -634,14 +618,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to determine child count of file system entry: " + path;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -873,7 +857,7 @@
String parentDir = FileSystemPathUtil.getParentDir(filePath);
String name = FileSystemPathUtil.getName(filePath);
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
@@ -891,20 +875,18 @@
Tools.safeClose(is);
*/
BlobInputStream blobIs = new BlobInputStream(blob);
- tx.commit();
return blobIs;
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to retrieve data of file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
@@ -952,7 +934,7 @@
if (isFile(filePath))
{
// update
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
@@ -969,7 +951,7 @@
throw new Exception("No such Entry " + name);
}
- versionEntry.setData(createBlob(in));
+ versionEntry.setData(IOTools.getBytes(in));
versionEntry.setLastmod(System.currentTimeMillis());
versionEntry.setLength(length);
@@ -986,7 +968,7 @@
throw new Exception("No such Entry " + name);
}
- cmsEntry.setData(createBlob(in));
+ cmsEntry.setData(IOTools.getBytes(in));
cmsEntry.setLastmod(System.currentTimeMillis());
cmsEntry.setLength(length);
@@ -1003,30 +985,28 @@
throw new Exception("No such Entry " + name);
}
- repoEntry.setData(createBlob(in));
+ repoEntry.setData(IOTools.getBytes(in));
repoEntry.setLastmod(System.currentTimeMillis());
repoEntry.setLength(length);
session.save(repoEntry);
}
- session.flush();
- tx.commit();
+ //session.flush();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to update existing file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
else // create new
{
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
@@ -1034,33 +1014,31 @@
in = new FileInputStream(f);
if (schemaObjectPrefix.equals(HibernateStoreConstants.versionClassName))
{
- VersionEntry versionEntry = new VersionEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ VersionEntry versionEntry = new VersionEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(versionEntry);
}
else if (schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
- CMSEntry cmsEntry = new CMSEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ CMSEntry cmsEntry = new CMSEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(cmsEntry);
}
else if (schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
- RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(repoEntry);
}
- session.flush();
- tx.commit();
+ //session.flush();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to create new file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
}
catch (Exception e)
@@ -1161,7 +1139,7 @@
if (isFile(filePath))
{
// update
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
@@ -1178,7 +1156,7 @@
throw new Exception("No such Entry " + name);
}
- versionEntry.setData(createBlob(in));
+ versionEntry.setData(IOTools.getBytes(in));
versionEntry.setLastmod(System.currentTimeMillis());
versionEntry.setLength(length);
@@ -1195,7 +1173,7 @@
throw new Exception("No such Entry " + name);
}
- cmsEntry.setData(createBlob(in));
+ cmsEntry.setData(IOTools.getBytes(in));
cmsEntry.setLastmod(System.currentTimeMillis());
cmsEntry.setLength(length);
@@ -1212,30 +1190,28 @@
throw new Exception("No such Entry " + name);
}
- repoEntry.setData(createBlob(in));
+ repoEntry.setData(IOTools.getBytes(in));
repoEntry.setLastmod(System.currentTimeMillis());
repoEntry.setLength(length);
session.save(repoEntry);
}
- session.flush();
- tx.commit();
+ //session.flush();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to update existing file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
else
{
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
@@ -1243,33 +1219,31 @@
in = IOTools.safeBufferedWrapper(new FileInputStream(f));
if (schemaObjectPrefix.equals(HibernateStoreConstants.versionClassName))
{
- VersionEntry versionEntry = new VersionEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ VersionEntry versionEntry = new VersionEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(versionEntry);
}
else if (schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
- CMSEntry cmsEntry = new CMSEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ CMSEntry cmsEntry = new CMSEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(cmsEntry);
}
else if (schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
- RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, createBlob(in), System.currentTimeMillis(), length);
+ RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, IOTools.getBytes(in), System.currentTimeMillis(), length);
session.save(repoEntry);
}
- session.flush();
- tx.commit();
+ //session.flush();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to create new file: " + filePath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
}
catch (Exception e)
@@ -1444,7 +1418,8 @@
protected void verifyRootExists() throws Exception
{
// check if root file system entry exists
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(selectFolderExistStmt)
@@ -1460,14 +1435,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to check existence of file system root entry";
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
// the root entry doesn't exist yet, create it...
createDeepFolder(FileSystem.SEPARATOR);
@@ -1494,7 +1469,7 @@
}
}
- Session session = hibernateSessionFactory.openSession();
+ Session session = hibernateSessionFactory.getCurrentSession();
Transaction tx = session.beginTransaction();
try
{
@@ -1516,20 +1491,18 @@
RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, null, System.currentTimeMillis(), 0);
session.save(repoEntry);
}
- session.flush();
- tx.commit();
+ //session.flush();
}
catch (Exception e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to create folder entry: " + folderPath;
log.error(msg, e);
throw new FileSystemException(msg, e);
- }
- finally
- {
- closeSession(session);
- }
+ }
}
/**
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -33,7 +33,7 @@
private Integer key;
private String path;
private String name;
- private java.sql.Blob data;
+ private byte[] data;
private long lastmod;
private long length;
@@ -41,7 +41,7 @@
{
}
- public RepositoryEntry(String path, String name, java.sql.Blob data, long lastmod, long length)
+ public RepositoryEntry(String path, String name, byte[] data, long lastmod, long length)
{
this.key = null;
this.path = path;
@@ -81,12 +81,12 @@
this.name = name;
}
- public java.sql.Blob getData()
+ public byte[] getData()
{
return data;
}
- public void setData(java.sql.Blob data)
+ public void setData(byte[] data)
{
this.data = data;
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -33,7 +33,7 @@
private Integer key;
private String path;
private String name;
- private java.sql.Blob data;
+ private byte[] data;
private long lastmod;
private long length;
@@ -41,7 +41,7 @@
{
}
- public VersionEntry(String path, String name, java.sql.Blob data, long lastmod, long length)
+ public VersionEntry(String path, String name, byte[] data, long lastmod, long length)
{
this.key = null;
this.path = path;
@@ -81,12 +81,12 @@
this.name = name;
}
- public java.sql.Blob getData()
+ public byte[] getData()
{
return data;
}
- public void setData(java.sql.Blob data)
+ public void setData(byte[] data)
{
this.data = data;
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -372,9 +372,11 @@
public void run()
{
Session session = null;
+ Transaction tx = null;
try
{
session = HibernateUtil.getSessionFactory(this.hibernateJndiName).openSession();
+ tx = session.beginTransaction();
List rs = session.createQuery(this.nodeQuery).list();
if (rs != null)
{
@@ -437,14 +439,22 @@
}
log.info("Pre-loading the PersistenceManager Cache for"
+ this.nodePrefix + " (finished).......");
+ tx.commit();
}
catch (CacheException ce)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
throw new RuntimeException(ce);
}
finally
{
- HibernateUtil.closeSession(session);
+ if(session != null && session.isOpen())
+ {
+ session.close();
+ }
this.done = true;
}
}
@@ -522,10 +532,9 @@
{
Session session = null;
Transaction tx = null;
- boolean success = false;
try
{
- session = HibernateUtil.getSessionFactory(this.jndiName).openSession();
+ session = HibernateUtil.getSessionFactory(this.jndiName).getCurrentSession();
tx = session.beginTransaction();
InputStream in = new ByteArrayInputStream(nodeData);
@@ -534,12 +543,13 @@
nodeState = createNew(node);
Serializer.deserialize(nodeState, in);
IOTools.safeClose(in);
-
- tx.commit();
- success = true;
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
if (e instanceof NoSuchItemStateException)
{
throw (NoSuchItemStateException)e;
@@ -548,15 +558,7 @@
+ node.toString();
log.error(msg, e);
throw new ItemStateException(msg, e);
- }
- finally
- {
- if (!success)
- {
- tx.rollback();
- }
- HibernateUtil.closeSession(session);
- }
+ }
}
return nodeState;
@@ -798,10 +800,9 @@
{
Session session = null;
Transaction tx = null;
- boolean success = false;
try
{
- session = HibernateUtil.getSessionFactory(this.jndiName).openSession();
+ session = HibernateUtil.getSessionFactory(this.jndiName).getCurrentSession();
tx = session.beginTransaction();
InputStream in = new ByteArrayInputStream(propertyData);
@@ -810,12 +811,13 @@
propertyState = createNew(property);
Serializer.deserialize(propertyState, in, blobStore);
IOTools.safeClose(in);
-
- tx.commit();
- success = true;
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
if (e instanceof NoSuchItemStateException)
{
throw (NoSuchItemStateException)e;
@@ -824,15 +826,7 @@
+ property.toString();
log.error(msg, e);
throw new ItemStateException(msg, e);
- }
- finally
- {
- if (!success)
- {
- tx.rollback();
- }
- HibernateUtil.closeSession(session);
- }
+ }
}
return propertyState;
@@ -1112,10 +1106,9 @@
{
Session session = null;
Transaction tx = null;
- boolean success = false;
try
{
- session = HibernateUtil.getSessionFactory(this.jndiName).openSession();
+ session = HibernateUtil.getSessionFactory(this.jndiName).getCurrentSession();
tx = session.beginTransaction();
InputStream in = new ByteArrayInputStream(nodeData);
@@ -1124,12 +1117,13 @@
refs = new NodeReferences(targetId);
Serializer.deserialize(refs, in);
IOTools.safeClose(in);
-
- tx.commit();
- success = true;
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
if (e instanceof NoSuchItemStateException)
{
throw (NoSuchItemStateException)e;
@@ -1138,15 +1132,7 @@
+ targetId.toString();
log.error(msg, e);
throw new ItemStateException(msg, e);
- }
- finally
- {
- if (!success)
- {
- tx.rollback();
- }
- HibernateUtil.closeSession(session);
- }
+ }
}
return refs;
@@ -1309,20 +1295,18 @@
Transaction tx = null;
try
{
- session = HibernateUtil.getSessionFactory(this.jndiName).openSession();
+ session = HibernateUtil.getSessionFactory(this.jndiName).getCurrentSession();
tx = session.beginTransaction();
storeHB(changeLog);
- tx.commit();
}
catch (ItemStateException e)
{
- tx.rollback();
+ if(tx != null)
+ {
+ tx.rollback();
+ }
throw e;
- }
- finally
- {
- HibernateUtil.closeSession(session);
- }
+ }
}
private Blob createBlob(byte[] bytes)
@@ -1409,7 +1393,8 @@
throw new IllegalStateException("not initialized");
}
- Session session = HibernateUtil.getSessionFactory(this.jndiName).openSession();
+ Session session = HibernateUtil.getSessionFactory(this.jndiName).getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(query).setString(0, id).list();
@@ -1418,15 +1403,14 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to check existence of node state: " + id;
log.error(msg, e);
throw new ItemStateException(msg, e);
}
- finally
- {
- HibernateUtil.closeSession(session);
- }
-
}
// -------------------------------------------------< misc. helper methods >
@@ -1465,13 +1449,15 @@
public InputStream get(String blobId) throws Exception
{
Session session = HibernateUtil.getSessionFactory(jndiName).getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
List rs = session.createQuery(blobSelectData).setString(0, blobId)
.list();
Iterator iter = rs.iterator();
- java.sql.Blob blob = (java.sql.Blob)iter.next();
+ byte[] blob = (byte[])iter.next();
+
/**
* This needs to be done this way due to issues with a combination of Postgresql driver handling blobs and Jackrabbit 1.4
*
@@ -1479,7 +1465,7 @@
*/
InputStream is = null;
- InputStream blobStream = blob.getBinaryStream();
+ /*InputStream blobStream = blob.getBinaryStream();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024]; //using a 1K buffer
int bytesRead = -1;
@@ -1489,14 +1475,18 @@
bos.flush();
}
- try{blobStream.close();}catch(Exception e){}
+ try{blobStream.close();}catch(Exception e){}*/
- is = new ByteArrayInputStream(bos.toByteArray());
+ is = new ByteArrayInputStream(blob);
return is;
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
if (e instanceof NoSuchItemStateException)
{
throw (NoSuchItemStateException)e;
@@ -1516,6 +1506,7 @@
boolean update = exists(blobId);
Session session = HibernateUtil.getSessionFactory(jndiName).getCurrentSession();
+ Transaction tx = session.beginTransaction();
if (update)
{
try
@@ -1533,7 +1524,7 @@
throw new Exception("No such Node: " + blobId);
}
versionNode.setId(blobId);
- versionNode.setData(Hibernate.createBlob(in));
+ versionNode.setData(IOTools.getBytes(in));
}
else if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.wspPrefix))
@@ -1545,18 +1536,22 @@
throw new Exception("No such Node: " + blobId);
}
wspNode.setId(blobId);
- wspNode.setData(Hibernate.createBlob(in));
+ wspNode.setData(IOTools.getBytes(in));
}
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to write node state: " + blobId;
log.error(msg, e);
throw new ItemStateException(msg, e);
}
finally
{
- session.flush();
+ //session.flush();
}
}
else
@@ -1569,26 +1564,29 @@
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
{
VersionBinVal versionNode = new VersionBinVal(blobId,
- Hibernate.createBlob(in));
+ IOTools.getBytes(in));
session.save(versionNode);
}
else if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.wspPrefix))
{
- WSPBinVal wspNode = new WSPBinVal(blobId, Hibernate
- .createBlob(in));
+ WSPBinVal wspNode = new WSPBinVal(blobId, IOTools.getBytes(in));
session.save(wspNode);
}
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to write node state: " + blobId;
log.error(msg, e);
throw new ItemStateException(msg, e);
}
finally
{
- session.flush();
+ //session.flush();
}
}
}
@@ -1600,6 +1598,7 @@
public boolean remove(String blobId) throws Exception
{
Session session = HibernateUtil.getSessionFactory(jndiName).getCurrentSession();
+ Transaction tx = session.beginTransaction();
try
{
Query query = session.createQuery(nodeBinValSelect).setString(0,
@@ -1613,13 +1612,17 @@
}
catch (Exception e)
{
+ if(tx != null)
+ {
+ tx.rollback();
+ }
String msg = "failed to delete binval: " + blobId;
log.error(msg, e);
throw new ItemStateException(msg, e);
}
finally
{
- session.flush();
+ //session.flush();
}
}
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -24,6 +24,8 @@
import org.hibernate.Session;
+import org.hibernate.Transaction;
+
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
import org.jboss.cache.TreeCache;
@@ -698,10 +700,11 @@
{
Set children = null;
Session session = null;
+ Transaction tx = null;
try
{
- session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
-
+ session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ tx = session.beginTransaction();
List rs = session.createQuery(query).list();
for (Iterator itr = rs.iterator(); itr.hasNext();)
{
@@ -713,10 +716,14 @@
children.add(PortalCMSCacheLoader.parseNodeName(id));
}
}
- finally
+ catch(Exception e)
{
- HibernateUtil.closeSession(session);
- }
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
+ }
return children;
}
@@ -728,10 +735,12 @@
{
Object node = null;
Session session = null;
+ Transaction tx = null;
try
{
- session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
-
+ session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ tx = session.beginTransaction();
+
//node = session.createQuery(query).setString(0,id).uniqueResult();
List rs = session.createQuery(query).setString(0, id).list();
if (rs != null && !rs.isEmpty())
@@ -739,10 +748,14 @@
node = rs.iterator().next();
}
}
- finally
+ catch(Exception e)
{
- HibernateUtil.closeSession(session);
- }
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
+ }
return node;
}
@@ -753,16 +766,29 @@
private Object loadManagedNode(String query, String id) throws Exception
{
Object node = null;
-
- Session session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- //node = session.createQuery(query).setString(0,id).uniqueResult();
- List rs = session.createQuery(query).setString(0, id).list();
- if (rs != null && !rs.isEmpty())
+ Session session = null;
+ Transaction tx = null;
+ try
{
- node = rs.iterator().next();
+ session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ tx = session.beginTransaction();
+
+ //node = session.createQuery(query).setString(0,id).uniqueResult();
+ List rs = session.createQuery(query).setString(0, id).list();
+ if (rs != null && !rs.isEmpty())
+ {
+ node = rs.iterator().next();
+ }
+ return node;
}
-
- return node;
+ catch(Exception e)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
+ }
}
/**
@@ -770,15 +796,30 @@
*/
private void save(Object object) throws Exception
{
- Session session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- if (((Base)object).getKey() != null)
+ Session session = null;
+ Transaction tx = null;
+ try
+ {
+ session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ tx = session.beginTransaction();
+
+ if (((Base)object).getKey() != null)
+ {
+ session.merge(object);
+ }
+ else
+ {
+ session.save(object);
+ }
+ }
+ catch(Exception e)
{
- session.merge(object);
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
}
- else
- {
- session.save(object);
- }
}
/**
@@ -787,14 +828,29 @@
*/
private Object delete(String loadQuery, String id) throws Exception
{
- Object removedValue = null;
- removedValue = this.loadManagedNode(loadQuery, id);
- if (removedValue != null)
+ Session session = null;
+ Transaction tx = null;
+ try
+ {
+ Object removedValue = null;
+ removedValue = this.loadManagedNode(loadQuery, id);
+ if (removedValue != null)
+ {
+ session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ tx = session.beginTransaction();
+
+ session.delete(removedValue);
+ }
+ return removedValue;
+ }
+ catch(Exception e)
{
- Session session = HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- session.delete(removedValue);
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
}
- return removedValue;
}
//---------------nodeName related methods-------------------------------------------------------------------------------------------------------------
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -23,7 +23,6 @@
package org.jboss.portal.cms.hibernate.state;
import java.io.Serializable;
-import java.sql.Blob;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class VersionBinVal implements Serializable
@@ -33,13 +32,13 @@
private Integer key;
private String id;
- private java.sql.Blob data;
+ private byte[] data;
public VersionBinVal()
{
}
- public VersionBinVal(String id, Blob data)
+ public VersionBinVal(String id, byte[] data)
{
this.key = null;
this.id = id;
@@ -66,12 +65,12 @@
this.id = id;
}
- public Blob getData()
+ public byte[] getData()
{
return data;
}
- public void setData(Blob data)
+ public void setData(byte[] data)
{
this.data = data;
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -23,7 +23,6 @@
package org.jboss.portal.cms.hibernate.state;
import java.io.Serializable;
-import java.sql.Blob;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class WSPBinVal implements Serializable
@@ -33,13 +32,13 @@
private Integer key;
private String id;
- private java.sql.Blob data;
+ private byte[] data;
public WSPBinVal()
{
}
- public WSPBinVal(String id, Blob data)
+ public WSPBinVal(String id, byte[] data)
{
this.key = null;
this.id = id;
@@ -66,12 +65,12 @@
this.id = id;
}
- public Blob getData()
+ public byte[] getData()
{
return data;
}
- public void setData(Blob data)
+ public void setData(byte[] data)
{
this.data = data;
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -69,6 +69,9 @@
import java.util.LinkedList;
import java.util.Locale;
import java.util.Set;
+import javax.transaction.TransactionManager;
+import javax.transaction.Status;
+import javax.naming.InitialContext;
/**
@@ -570,8 +573,17 @@
Object obj = null;
boolean isClusterDelegatedRequest = false; //used to indicate this request is from another cluster node instead of the master node
boolean clusterWorkflowStatus = false;
+ TransactionManager tm = null;
+ boolean isStartedHere = false;
try
{
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
+
xares.start(xid, XAResource.TMNOFLAGS);
//Check and make sure in the case of a clustered call, the Identity propagated
@@ -635,6 +647,11 @@
xares.prepare(xid);
session.save();
xares.commit(xid, false);
+
+ if(isStartedHere)
+ {
+ tm.getTransaction().commit();
+ }
}
catch (Exception e)
{
@@ -648,6 +665,11 @@
//we tried to roll it back...not sure what more we can do here
throw new CMSException(ex);
}
+
+ if(tm != null)
+ {
+ try{tm.getTransaction().rollback();}catch(Exception tme){}
+ }
if (e instanceof CMSException)
{
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/jackrabbit/JackrabbitJCRService.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/jackrabbit/JackrabbitJCRService.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/jackrabbit/JackrabbitJCRService.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -50,6 +50,11 @@
import javax.jcr.version.OnParentVersionAction;
import java.io.StringReader;
+import javax.transaction.TransactionManager;
+import javax.transaction.Status;
+import javax.naming.InitialContext;
+
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6469 $
@@ -99,39 +104,82 @@
public void start() throws Exception
{
- log.debug("JackRabbit configuration: " + config);
- // Create repository
- StringReader reader = new StringReader(config);
- InputSource src = new InputSource(reader);
- RepositoryConfig cfg = RepositoryConfig.create(src, homeDir);
- repository = RepositoryImpl.create(cfg);
- log.info("Repository '" + repositoryName + "' created");
-
- // Check portalcms-namespace nodetypes exist
- if (!nodeTypesExist())
- {
- log.info("The repository does not know about CMS node types");
- registerCustomNodeTypes(repository);
- }
- else
- {
- log.info("The repository has already the CMS node types registered");
- }
+ TransactionManager tm = null;
+ boolean isStartedHere = false;
+ try
+ {
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
+
+ log.debug("JackRabbit configuration: " + config);
+ // Create repository
+ StringReader reader = new StringReader(config);
+ InputSource src = new InputSource(reader);
+ RepositoryConfig cfg = RepositoryConfig.create(src, homeDir);
+ repository = RepositoryImpl.create(cfg);
+ log.info("Repository '" + repositoryName + "' created");
+
+ // Check portalcms-namespace nodetypes exist
+ if (!nodeTypesExist())
+ {
+ log.info("The repository does not know about CMS node types");
+ registerCustomNodeTypes(repository);
+ }
+ else
+ {
+ log.info("The repository has already the CMS node types registered");
+ }
+
+ if(isStartedHere)
+ {
+ tm.getTransaction().commit();
+ }
+ }
+ catch(Exception e)
+ {
+ if(tm != null)
+ {
+ tm.getTransaction().rollback();
+ }
+ throw e;
+ }
}
public void stop()
{
+ TransactionManager tm = null;
+ boolean isStartedHere = false;
try
{
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
+
log.info("Shutting down repository");
repository.shutdown();
log.info("Repository shut down successfully");
+
+ if(isStartedHere)
+ {
+ tm.getTransaction().commit();
+ }
}
catch (Exception e)
- {
+ {
+ if(tm != null)
+ {
+ try{tm.getTransaction().rollback();}catch(Exception ex){}
+ }
e.printStackTrace();
- log.error("Failed to unregister repository. Some locks may persist!", e);
- }
+ log.error("Failed to unregister repository. Some locks may persist!", e);
+ }
}
/** Check for existence of namespace nodetypes. */
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -49,18 +49,18 @@
}
/** @return */
- public static Session getCurrentSession(SessionFactory sessionFactory)
+ /*public static Session getCurrentSession(SessionFactory sessionFactory)
{
Session session = sessionFactory.getCurrentSession();
return session;
- }
+ }*/
/** @return */
- public static Session getOpenSession(SessionFactory sessionFactory)
+ /*public static Session getOpenSession(SessionFactory sessionFactory)
{
Session session = sessionFactory.openSession();
return session;
- }
+ }*/
/** @param session */
public static void closeSession(Session session)
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -43,9 +43,10 @@
import javax.jcr.Session;
import javax.jcr.Workspace;
import javax.jcr.nodetype.NodeTypeManager;
+import javax.transaction.TransactionManager;
+import javax.naming.InitialContext;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6653 $
@@ -53,7 +54,6 @@
@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestJackrabbit extends AbstractCMSTestCase
{
-
public TestJackrabbit()
{
}
@@ -62,7 +62,7 @@
@Create
public void setUp() throws Exception
- {
+ {
// Load config
LoaderResource res = new CLResourceLoader().getResource("jcr/repository.xml");
String config = res.asString();
@@ -70,27 +70,34 @@
jcr = new JackrabbitJCRService();
jcr.setRepositoryName("repo");
jcr.setConfig(config);
- jcr.setHomeDir("repotest");
+ jcr.setHomeDir("repotest-" + getDataSourceName());
jcr.start();
}
@Destroy
public void tearDown() throws Exception
{
+ TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ tm.commit();
+
jcr.stop();
jcr = null;
}
@Test
public void testRepository() throws Exception
- {
+ {
Repository repo = jcr.getRepository();
assertNotNull(repo);
//
Session session = null;
+ TransactionManager tm = null;
try
{
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ tm.begin();
+
session = jcr.login("anonid", "");
Workspace wosp = session.getWorkspace();
NodeTypeManager mgr = wosp.getNodeTypeManager();
@@ -102,7 +109,13 @@
//
Node node = session.getRootNode();
assertNotNull(node);
+
+ tm.commit();
}
+ catch(Exception e)
+ {
+ tm.rollback();
+ }
finally
{
RepositoryUtil.safeLogout(session);
@@ -111,6 +124,9 @@
//
try
{
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ tm.begin();
+
session = jcr.login("anonid", "");
//
@@ -120,7 +136,13 @@
//
node.setProperty("abc", "abc");
session.save();
+
+ tm.commit();
}
+ catch(Exception e)
+ {
+ tm.rollback();
+ }
finally
{
RepositoryUtil.safeLogout(session);
@@ -129,15 +151,24 @@
//
try
{
+ tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
+ tm.begin();
+
session = jcr.login("anonid", "");
//
Node node = session.getRootNode();
assertEquals("abc", node.getProperty("abc").getString());
+
+ tm.commit();
}
+ catch(Exception e)
+ {
+ tm.rollback();
+ }
finally
{
RepositoryUtil.safeLogout(session);
- }
+ }
}
}
Added: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/CMSFile.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/CMSFile.java (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/CMSFile.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,69 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.portal.cms.test.blobs;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class CMSFile implements Serializable
+{
+ private int id;
+ private String name;
+ private byte[] content;
+
+ public CMSFile()
+ {
+
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public byte[] getContent()
+ {
+ return content;
+ }
+
+ public void setContent(byte[] content)
+ {
+ this.content = content;
+ }
+}
Added: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortability.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortability.java (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortability.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,84 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.portal.cms.test.blobs;
+
+import java.io.Serializable;
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+import org.jboss.portal.cms.test.AbstractCMSTestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-blobs.xml")
+public class TestBlobPortability extends AbstractCMSTestCase
+{
+ private static Logger log = Logger.getLogger(TestBlobPortability.class);
+
+ @Test
+ public void testCreateFile() throws Exception
+ {
+ Session session = null;
+ Transaction tx = null;
+ try
+ {
+ SessionFactory sessionFactory = (SessionFactory)new InitialContext().lookup("java:/SessionFactory");
+ session = sessionFactory.openSession();
+ tx = session.beginTransaction();
+
+ CMSFile cmsFile = new CMSFile();
+ cmsFile.setName("testName");
+ cmsFile.setContent("123456789".getBytes());
+
+ Serializable uid = session.save(cmsFile);
+
+ log.info("-------------------------------------------");
+ log.info("New File Id="+uid);
+
+ tx.commit();
+ }
+ catch(Exception e)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
+ }
+ finally
+ {
+ if(session != null)
+ {
+ session.close();
+ }
+ }
+ }
+}
Added: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortabilityTestCase.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortabilityTestCase.java (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/blobs/TestBlobPortabilityTestCase.java 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,89 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.portal.cms.test.blobs;
+
+import java.io.Serializable;
+
+import javax.naming.InitialContext;
+
+import junit.framework.TestCase;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Session;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.Transaction;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class TestBlobPortabilityTestCase extends TestCase
+{
+ private SessionFactory sessionFactory;
+
+ public void setUp()
+ {
+ this.sessionFactory = new Configuration().configure().buildSessionFactory();
+ }
+
+ public void tearDown()
+ {
+ this.sessionFactory.close();
+ this.sessionFactory = null;
+ }
+
+ public void testCreateFile() throws Exception
+ {
+ Session session = null;
+ Transaction tx = null;
+ try
+ {
+ CMSFile cmsFile = new CMSFile();
+ cmsFile.setName("testName");
+ cmsFile.setContent("123456789".getBytes());
+
+ session = this.sessionFactory.openSession();
+ tx = session.beginTransaction();
+
+ Serializable uid = session.save(cmsFile);
+
+ System.out.println("-------------------------------------------");
+ System.out.println("New File Id="+uid);
+
+ tx.commit();
+ }
+ catch(Exception e)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ throw e;
+ }
+ finally
+ {
+ if(session != null)
+ {
+ session.close();
+ }
+ }
+ }
+}
Added: modules/cms/trunk/cms-jackrabbit/src/test/resources/blobs.hbm.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/blobs.hbm.xml (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/blobs.hbm.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.jboss.portal.cms.test.blobs.CMSFile" table="test_blobs_cmsfile" lazy="true">
+ <id
+ name="id"
+ column="PK"
+ type="java.lang.Integer">
+ <generator class="native"/>
+ </id>
+ <property
+ name="name"
+ column="name"
+ type="string"
+ not-null="true"
+ />
+ <property
+ name="content"
+ column="content"
+ type="binary"
+ not-null="true"
+ length="1000000000"
+ />
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/datasources.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/datasources.xml 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/datasources.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -30,7 +30,6 @@
<user-name>sa</user-name>
<password></password>
</datasource>
-<!--
<datasource>
<datasource-name>mysql5</datasource-name>
<connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
@@ -38,23 +37,18 @@
<user-name>portal</user-name>
<password>portalpassword</password>
</datasource>
--->
-<!--
- <datasource>
- <datasource-name>oracle10g</datasource-name>
- <connection-url>jdbc:oracle:thin:jbossportal/portalpassword@192.168.0.124:1521:orcl</connection-url>
- <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
- <user-name>jbossportal</user-name>
- <password>portalpassword</password>
- </datasource>
--->
-<!--
- <datasource>
- <datasource-name>postgresql8</datasource-name>
- <connection-url>jdbc:postgresql:jbossportal</connection-url>
- <driver-class>org.postgresql.Driver</driver-class>
- <user-name>portal</user-name>
- <password>portalpassword</password>
- </datasource>
--->
+ <datasource>
+ <datasource-name>oracle10g</datasource-name>
+ <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
+ <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </datasource>
+ <datasource>
+ <datasource-name>postgresql8</datasource-name>
+ <connection-url>jdbc:postgresql:jbossportal</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </datasource>
</datasources>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/domain.hbm.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/domain.hbm.xml 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/domain.hbm.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -41,7 +41,7 @@
<property
name="data"
column="BINVAL_DATA"
- type="blob"
+ type="binary"
length="100000000"
not-null="true"/>
</class>
@@ -117,7 +117,7 @@
<property
name="data"
column="BINVAL_DATA"
- type="blob"
+ type="binary"
length="100000000"
not-null="true"/>
</class>
@@ -198,7 +198,7 @@
length="245"/>
<property name="data"
column="FSENTRY_DATA"
- type="blob"
+ type="binary"
length="100000000"
not-null="false"/>
<property name="lastmod"
@@ -230,7 +230,7 @@
length="245"/>
<property name="data"
column="FSENTRY_DATA"
- type="blob"
+ type="binary"
length="100000000"
not-null="false"/>
<property name="lastmod"
@@ -262,7 +262,7 @@
length="245"/>
<property name="data"
column="FSENTRY_DATA"
- type="blob"
+ type="binary"
length="100000000"
not-null="false"/>
<property name="lastmod"
Added: modules/cms/trunk/cms-jackrabbit/src/test/resources/hibernate.cfg.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/hibernate.cfg.xml (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/hibernate.cfg.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- jdbc connection properties -->
+ <!--
+ <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+ <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</property>
+ <property name="hibernate.connection.username">portal</property>
+ <property name="hibernate.connection.password">portalpassword</property>
+ -->
+
+
+ <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
+ <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
+ <property name="hibernate.connection.username">portal</property>
+ <property name="hibernate.connection.password">portalpassword</property>
+
+ <!--
+ <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
+ <property name="hibernate.connection.url">jdbc:postgresql:jbossportal</property>
+ <property name="hibernate.connection.username">portal</property>
+ <property name="hibernate.connection.password">portalpassword</property>
+ -->
+
+ <!-- other hibernate properties -->
+ <property name="show_sql">true</property>
+ <property name="hbm2ddl.auto">update</property>
+
+
+ <mapping resource="blobs.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
Added: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-blobs.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-blobs.xml (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-blobs.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="DataSourceConfig" class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <constructor factoryMethod="obtainConfig" factoryClass="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <parameter><inject bean="TestCase" property="datasources" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="hibernateConfig" state="Instantiated"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
+ </bean>
+
+ <bean name="TransactionManagerSupport" class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+ </bean>
+
+ <bean name="ConnectionManagerSupport" class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ </bean>
+
+ <bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
+ <property name="config"><inject bean="DataSourceConfig"/></property>
+ </bean>
+
+ <bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <property name="config"><inject bean="HibernateConfig"/></property>
+ <property name="JNDIName">java:/SessionFactory</property>
+ <property name="mappings">
+ <list elementClass="java.lang.String">
+ <value>blobs.hbm.xml</value>
+ </list>
+ </property>
+ </bean>
+</deployment>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml 2009-01-12 23:03:29 UTC (rev 12470)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml 2009-01-12 23:13:25 UTC (rev 12471)
@@ -5,24 +5,15 @@
xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
<pojo>
<parameter name="datasources" value="datasources.xml"/>
- <parameter name="dataSourceName">
- <value>hsqldb</value>
- <!--
+ <parameter name="dataSourceName">
+ <value>hsqldb</value>
+ <value>oracle10g</value>
<value>mysql5</value>
- <value>postgresql8</value>
- -->
+ <value>postgresql8</value>
</parameter>
- <parameter name="hibernateConfig" value="hibernates.xml"/>
+ <parameter name="hibernateConfig" value="hibernates.xml"/>
+ <!--
<test >
- <class name="org.jboss.portal.cms.test.TestJackrabbit"/>
- </test>
- <test >
- <class name="org.jboss.portal.cms.test.TestRegEx"/>
- </test>
- <test >
- <class name="org.jboss.portal.cms.test.TestRepositoryUtil"/>
- </test>
- <test >
<class name="org.jboss.portal.cms.test.commands.TestFileArchiveUpload"/>
</test>
<test >
@@ -68,25 +59,37 @@
<class name="org.jboss.portal.cms.test.commands.TestFolderUpdate"/>
</test>
<test >
- <class name="org.jboss.portal.cms.test.commands.TestRepositoryBootStrap"/>
+ <class name="org.jboss.portal.cms.test.commands.TestSearch"/>
</test>
+ -->
<test >
- <class name="org.jboss.portal.cms.test.commands.TestSearch"/>
+ <class name="org.jboss.portal.cms.test.TestJackrabbit"/>
</test>
+ <!--
+ <test >
+ <class name="org.jboss.portal.cms.test.TestRegEx"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.TestRepositoryUtil"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestRepositoryBootStrap"/>
+ </test>
+ -->
</pojo>
<pojo>
<parameter name="datasources" value="datasources.xml"/>
- <parameter name="dataSourceName">
- <value>hsqldb</value>
- <!--
+ <parameter name="dataSourceName">
+ <value>hsqldb</value>
+ <value>oracle10g</value>
<value>mysql5</value>
- <value>postgresql8</value>
- -->
+ <value>postgresql8</value>
</parameter>
<parameter name="hibernateConfig" value="hibernates.xml"/>
<parameter name="standardIdentityConfig" value="standardidentity-config.xml"/>
<parameter name="identityConfig" value="db-config.xml"/>
+ <!--
<test >
<class name="org.jboss.portal.cms.test.security.TestManageAccess"/>
</test>
@@ -99,20 +102,21 @@
<test >
<class name="org.jboss.portal.cms.test.security.TestNewReadCommand"/>
</test>
+ -->
</pojo>
<pojo>
<parameter name="datasources" value="datasources.xml"/>
- <parameter name="dataSourceName">
+ <parameter name="dataSourceName">
<value>hsqldb</value>
- <!--
+ <value>oracle10g</value>
<value>mysql5</value>
- <value>postgresql8</value>
- -->
+ <value>postgresql8</value>
</parameter>
<parameter name="hibernateConfig" value="hibernates.xml"/>
<parameter name="standardIdentityConfig" value="standardidentity-config.xml"/>
<parameter name="identityConfig" value="db-config.xml"/>
+ <!--
<test >
<class name="org.jboss.portal.cms.test.workflow.TestApprovedPublish"/>
</test>
@@ -122,5 +126,21 @@
<test >
<class name="org.jboss.portal.cms.test.workflow.TestWorkflowEnvironment"/>
</test>
+ -->
</pojo>
+
+ <!--
+ <pojo>
+ <parameter name="datasources" value="datasources.xml"/>
+ <parameter name="dataSourceName">
+ <value>hsqldb</value>
+ <value>oracle10g</value>
+ <value>mysql5</value>
+ </parameter>
+ <parameter name="hibernateConfig" value="hibernates.xml"/>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileArchiveUpload"/>
+ </test>
+ </pojo>
+ -->
</jboss-unit>
17 years, 3 months
JBoss Portal SVN: r12470 - modules/test/trunk/build.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-12 18:03:29 -0500 (Mon, 12 Jan 2009)
New Revision: 12470
Modified:
modules/test/trunk/build/pom.xml
Log:
Updated parent to version 1.0.0
Modified: modules/test/trunk/build/pom.xml
===================================================================
--- modules/test/trunk/build/pom.xml 2009-01-12 22:22:31 UTC (rev 12469)
+++ modules/test/trunk/build/pom.xml 2009-01-12 23:03:29 UTC (rev 12470)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.unit</groupId>
17 years, 3 months
JBoss Portal SVN: r12469 - modules/metadata/trunk/build.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-12 17:22:31 -0500 (Mon, 12 Jan 2009)
New Revision: 12469
Modified:
modules/metadata/trunk/build/pom.xml
Log:
Updated to use version 1.0.0 of parent instead of inexisting 1-SNAPSHOT.
Modified: modules/metadata/trunk/build/pom.xml
===================================================================
--- modules/metadata/trunk/build/pom.xml 2009-01-12 22:21:44 UTC (rev 12468)
+++ modules/metadata/trunk/build/pom.xml 2009-01-12 22:22:31 UTC (rev 12469)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.metadata</groupId>
17 years, 3 months
JBoss Portal SVN: r12468 - modules/deployer/trunk/build.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-12 17:21:44 -0500 (Mon, 12 Jan 2009)
New Revision: 12468
Modified:
modules/deployer/trunk/build/pom.xml
Log:
Updated to use version 1.0.0 of parent instead of inexisting 1-SNAPSHOT.
Modified: modules/deployer/trunk/build/pom.xml
===================================================================
--- modules/deployer/trunk/build/pom.xml 2009-01-12 22:10:25 UTC (rev 12467)
+++ modules/deployer/trunk/build/pom.xml 2009-01-12 22:21:44 UTC (rev 12468)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.deployer</groupId>
17 years, 3 months
JBoss Portal SVN: r12467 - in modules/web/trunk: web/src/test and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-12 17:10:25 -0500 (Mon, 12 Jan 2009)
New Revision: 12467
Modified:
modules/web/trunk/build/pom.xml
modules/web/trunk/web/src/test/build.xml
Log:
Updated web to be built with 1.0.0 version of parent instead of 1-SNAPSHOT, which doesn't exist in repository...
Modified: modules/web/trunk/build/pom.xml
===================================================================
--- modules/web/trunk/build/pom.xml 2009-01-12 18:23:49 UTC (rev 12466)
+++ modules/web/trunk/build/pom.xml 2009-01-12 22:10:25 UTC (rev 12467)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.portal</groupId>
<artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.web</groupId>
Modified: modules/web/trunk/web/src/test/build.xml
===================================================================
--- modules/web/trunk/web/src/test/build.xml 2009-01-12 18:23:49 UTC (rev 12466)
+++ modules/web/trunk/web/src/test/build.xml 2009-01-12 22:10:25 UTC (rev 12467)
@@ -125,7 +125,7 @@
</and>
</condition>
- <fail message="Please set the environment variable JBOSS_4_2_0_HOME or JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME">
+ <fail message="Please set the environment variable JBOSS_4_2_0_HOME or JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
<condition>
<and>
<not>
@@ -147,7 +147,7 @@
</condition>
</fail>
- <fail message="Please set the environment variable JBOSS_5_0_HOME">
+ <fail message="Please set the environment variable JBOSS_5_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
<condition>
<and>
<not>
@@ -160,7 +160,7 @@
</condition>
</fail>
- <fail message="Please set the environment variable TOMCAT_6_0_HOME">
+ <fail message="Please set the environment variable TOMCAT_6_0_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
<condition>
<and>
<not>
@@ -173,7 +173,7 @@
</condition>
</fail>
-<!-- <fail message="Please set the environment variable JETTY_6_1_HOME">
+<!-- <fail message="Please set the environment variable JETTY_6_1_HOME or use -Dtest.specified.containers to only run tests for containers specified with a HOME variable">
<condition>
<and>
<not>
17 years, 3 months