Hibernate SVN: r15527 - in search/trunk: src/java/org/hibernate/search/reader and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2008-11-06 11:44:55 -0500 (Thu, 06 Nov 2008)
New Revision: 15527
Modified:
search/trunk/doc/reference/en/modules/lucene-native.xml
search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java
Log:
doc updates for HSEARCH-274
Modified: search/trunk/doc/reference/en/modules/lucene-native.xml
===================================================================
--- search/trunk/doc/reference/en/modules/lucene-native.xml 2008-11-06 15:09:00 UTC (rev 15526)
+++ search/trunk/doc/reference/en/modules/lucene-native.xml 2008-11-06 16:44:55 UTC (rev 15527)
@@ -99,8 +99,8 @@
</listitem>
<listitem>
- <para>This indexReader must not be used for modification operations
- (especially delete), if you want to use an read/write index reader,
+ <para>This indexReader can't be used for modification operations
+ (you would get an exception). If you want to use a read/write index reader,
open one from the Lucene Directory object.</para>
</listitem>
</itemizedlist>
Modified: search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java 2008-11-06 15:09:00 UTC (rev 15526)
+++ search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java 2008-11-06 16:44:55 UTC (rev 15527)
@@ -17,7 +17,7 @@
*/
public interface ReaderProvider {
/**
- * Open a reader on all the listed directory providers.
+ * Open a read-only reader on all the listed directory providers.
* The opened reader has to be closed through {@link #closeReader(IndexReader)}.
* The opening can be virtual.
*/
16 years, 2 months
Hibernate SVN: r15526 - search/trunk/src/java/org/hibernate/search/reader.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2008-11-06 10:09:00 -0500 (Thu, 06 Nov 2008)
New Revision: 15526
Modified:
search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
Log:
HSEARCH-250 avoid calling directoryProvider.getDirectory()
more than once in openReader as the result may change.
Modified: search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-06 03:38:52 UTC (rev 15525)
+++ search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-06 15:09:00 UTC (rev 15526)
@@ -34,7 +34,7 @@
private static final Logger log = LoggerFactory.make();
/**
- * contains all Readers (most current per DP and all unclosed old)
+ * contains all Readers (most current per Directory and all unclosed old readers)
*/
//TODO ConcurrentHashMap's constructor could benefit from some hints as arguments.
protected final Map<IndexReader, ReaderUsagePair> allReaders = new ConcurrentHashMap<IndexReader, ReaderUsagePair>();
@@ -67,7 +67,7 @@
Set<DirectoryProvider<?>> providers = searchFactoryImplementor.getDirectoryProviders();
// create the readers for the known providers. Unfortunately, it is not possible to
- // create all readers in initalize since some providers have more than one directory (eg
+ // create all readers in initialize since some providers have more than one directory (eg
// FSSlaveDirectoryProvider). See also HSEARCH-250.
for ( DirectoryProvider provider : providers ) {
createReader( provider.getDirectory() );
@@ -114,13 +114,11 @@
IndexReader[] readers = new IndexReader[length];
log.debug( "Opening IndexReader for directoryProviders: {}", length );
for ( int index = 0; index < length; index++ ) {
- DirectoryProvider directoryProvider = directoryProviders[index];
- if ( log.isTraceEnabled() ) {
- log.trace( "Opening IndexReader from {}", directoryProvider.getDirectory() );
- }
- PerDirectoryLatestReader directoryLatestReader = currentReaders.get( directoryProvider.getDirectory() );
+ Directory directory = directoryProviders[index].getDirectory();
+ log.trace( "Opening IndexReader from {}", directory );
+ PerDirectoryLatestReader directoryLatestReader = currentReaders.get( directory );
if ( directoryLatestReader == null ) { // might eg happen for FSSlaveDirectoryProvider
- directoryLatestReader = createReader( directoryProvider.getDirectory() );
+ directoryLatestReader = createReader( directory );
}
readers[index] = directoryLatestReader.refreshAndGet();
}
@@ -144,7 +142,7 @@
}
//overridable method for testability:
- protected IndexReader readerFactory(Directory directory) throws IOException {
+ protected IndexReader readerFactory(final Directory directory) throws IOException {
return IndexReader.open( directory, true );
}
@@ -229,7 +227,7 @@
}
/**
- * Gets an updated IndexReader for the current DirectoryProvider;
+ * Gets an updated IndexReader for the current Directory;
* the index status will be checked.
*
* @return the current IndexReader if it's in sync with underlying index, a new one otherwise.
16 years, 2 months
Hibernate SVN: r15525 - core/branches/Branch_3_2/test/org/hibernate/test/legacy.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-11-05 22:38:52 -0500 (Wed, 05 Nov 2008)
New Revision: 15525
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
Log:
HHH-3214 : Remove parens from sysdate() in HQL to fix oracle failure
Modified: core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2008-11-05 20:44:30 UTC (rev 15524)
+++ core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2008-11-06 03:38:52 UTC (rev 15525)
@@ -81,7 +81,7 @@
if ( getDialect() instanceof Oracle9iDialect ) {
// Check Oracle Dialect mix of dialect functions - no args (no parenthesis and single arg functions
- java.util.List rset = s.find("select s.name, sysdate(), trunc(s.pay), round(s.pay) from Simple s");
+ java.util.List rset = s.find("select s.name, sysdate, trunc(s.pay), round(s.pay) from Simple s");
assertNotNull("Name string should have been returned",(((Object[])rset.get(0))[0]));
assertNotNull("Todays Date should have been returned",(((Object[])rset.get(0))[1]));
assertEquals("trunc(45.8) result was incorrect ", new Float(45), ( (Object[]) rset.get(0) )[2] );
@@ -96,7 +96,7 @@
// Test a larger depth 3 function example - Not a useful combo other than for testing
assertTrue(
- s.find("select trunc(round(sysdate())) from Simple s").size() == 1
+ s.find("select trunc(round(sysdate)) from Simple s").size() == 1
);
// Test the oracle standard NVL funtion as a test of multi-param functions...
16 years, 2 months
Hibernate SVN: r15524 - in search/trunk/src: java/org/hibernate/search/reader and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-11-05 15:44:30 -0500 (Wed, 05 Nov 2008)
New Revision: 15524
Modified:
search/trunk/src/java/org/hibernate/search/backend/Workspace.java
search/trunk/src/java/org/hibernate/search/reader/NotSharedReaderProvider.java
search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java
search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
search/trunk/src/test/org/hibernate/search/test/RamDirectoryTest.java
search/trunk/src/test/org/hibernate/search/test/TransactionTest.java
search/trunk/src/test/org/hibernate/search/test/indexingStrategy/ManualIndexingStrategyTest.java
Log:
HSEARCH-274 Use Lucene's new readonly IndexReader (2.4)
Modified: search/trunk/src/java/org/hibernate/search/backend/Workspace.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/Workspace.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/java/org/hibernate/search/backend/Workspace.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -122,7 +122,7 @@
return reader;
Directory directory = directoryProvider.getDirectory();
try {
- reader = IndexReader.open( directory );
+ reader = IndexReader.open( directory, false );
log.trace( "IndexReader opened" );
}
catch ( IOException e ) {
Modified: search/trunk/src/java/org/hibernate/search/reader/NotSharedReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/NotSharedReaderProvider.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/java/org/hibernate/search/reader/NotSharedReaderProvider.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -23,7 +23,7 @@
IndexReader[] readers = new IndexReader[length];
try {
for (int index = 0; index < length; index++) {
- readers[index] = IndexReader.open( directoryProviders[index].getDirectory() );
+ readers[index] = IndexReader.open( directoryProviders[index].getDirectory(), true );
}
}
catch (IOException e) {
Modified: search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -147,7 +147,7 @@
* not worse than NotShared and limit the locking time, hence scalability
*/
try {
- reader = IndexReader.open( directoryProvider.getDirectory() );
+ reader = IndexReader.open( directoryProvider.getDirectory(), true );
}
catch ( IOException e ) {
throw new SearchException( "Unable to open Lucene IndexReader", e );
Modified: search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -145,7 +145,7 @@
//overridable method for testability:
protected IndexReader readerFactory(Directory directory) throws IOException {
- return IndexReader.open( directory );
+ return IndexReader.open( directory, true );
}
/**
Modified: search/trunk/src/test/org/hibernate/search/test/RamDirectoryTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/RamDirectoryTest.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/test/org/hibernate/search/test/RamDirectoryTest.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -50,7 +50,7 @@
}
private int getDocumentNbr() throws Exception {
- IndexReader reader = IndexReader.open( getDirectory( Document.class ) );
+ IndexReader reader = IndexReader.open( getDirectory( Document.class ), false );
try {
return reader.numDocs();
}
Modified: search/trunk/src/test/org/hibernate/search/test/TransactionTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/TransactionTest.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/test/org/hibernate/search/test/TransactionTest.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -51,7 +51,7 @@
}
private int getDocumentNumber() throws IOException {
- IndexReader reader = IndexReader.open( getDirectory( Document.class ) );
+ IndexReader reader = IndexReader.open( getDirectory( Document.class ), false );
try {
return reader.numDocs();
}
Modified: search/trunk/src/test/org/hibernate/search/test/indexingStrategy/ManualIndexingStrategyTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/indexingStrategy/ManualIndexingStrategyTest.java 2008-11-05 20:14:41 UTC (rev 15523)
+++ search/trunk/src/test/org/hibernate/search/test/indexingStrategy/ManualIndexingStrategyTest.java 2008-11-05 20:44:30 UTC (rev 15524)
@@ -40,7 +40,7 @@
}
private int getDocumentNbr() throws Exception {
- IndexReader reader = IndexReader.open( getDirectory( Document.class ) );
+ IndexReader reader = IndexReader.open( getDirectory( Document.class ), false );
try {
return reader.numDocs();
}
16 years, 2 months
Hibernate SVN: r15523 - in search/trunk/src: test/org/hibernate/search/test/reader/functionality and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2008-11-05 15:14:41 -0500 (Wed, 05 Nov 2008)
New Revision: 15523
Modified:
search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
search/trunk/src/test/org/hibernate/search/test/reader/functionality/SharingBufferIndexProviderTest.java
search/trunk/src/test/org/hibernate/search/test/reader/functionality/TestableSharingBufferReaderProvider.java
Log:
HSEARCH-250
* Refactored SharingBufferReaderprovider to cache reader per directory not per direcory provider since some providers have more than one directory (eg FSSlaveDirectoryProvider). The refactoring ment that now not all directories/readers can be initalised in the initialize() mehod. Some readers can only be initilized when the provider switched to a new directory.
* Updated tests
Modified: search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-05 20:06:43 UTC (rev 15522)
+++ search/trunk/src/java/org/hibernate/search/reader/SharingBufferReaderProvider.java 2008-11-05 20:14:41 UTC (rev 15523)
@@ -2,8 +2,6 @@
package org.hibernate.search.reader;
import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -14,6 +12,7 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiReader;
+import org.apache.lucene.store.Directory;
import org.slf4j.Logger;
import org.hibernate.annotations.common.AssertionFailure;
@@ -23,33 +22,35 @@
import org.hibernate.search.util.LoggerFactory;
/**
- * This ReaderProvider shares IndexReaders as long as they are "current";
+ * This <code>ReaderProvider</code> shares IndexReaders as long as they are "current";
* main difference with SharedReaderProvider is the way to update the Readers when needed:
* this uses IndexReader.reopen() which should improve performance on larger indexes
* as it shares buffers with previous IndexReader generation for the segments which didn't change.
- *
+ *
* @author Sanne Grinovero
*/
public class SharingBufferReaderProvider implements ReaderProvider {
- private static final Logger log = LoggerFactory.make();
+ private static final Logger log = LoggerFactory.make();
/**
- * contains all Readers (most current per DP and all unclosed old)
+ * contains all Readers (most current per DP and all unclosed old)
*/
//TODO ConcurrentHashMap's constructor could benefit from some hints as arguments.
- protected final Map<IndexReader,ReaderUsagePair> allReaders = new ConcurrentHashMap<IndexReader,ReaderUsagePair>();
-
+ protected final Map<IndexReader, ReaderUsagePair> allReaders = new ConcurrentHashMap<IndexReader, ReaderUsagePair>();
+
/**
* contains last updated Reader; protected by lockOnOpenLatest (in the values)
*/
- protected Map<DirectoryProvider,PerDirectoryLatestReader> currentReaders;
+ protected final Map<Directory, PerDirectoryLatestReader> currentReaders = new ConcurrentHashMap<Directory, PerDirectoryLatestReader>();
public void closeReader(IndexReader multiReader) {
- if ( multiReader == null ) return;
+ if ( multiReader == null ) {
+ return;
+ }
IndexReader[] readers;
if ( multiReader instanceof MultiReader ) {
- readers = ReaderProviderHelper.getSubReadersFromMultiReader( (MultiReader) multiReader );
+ readers = ReaderProviderHelper.getSubReadersFromMultiReader( ( MultiReader ) multiReader );
}
else {
throw new AssertionFailure( "Everything should be wrapped in a MultiReader" );
@@ -57,33 +58,55 @@
log.debug( "Closing MultiReader: {}", multiReader );
for ( IndexReader reader : readers ) {
ReaderUsagePair container = allReaders.get( reader );
- container.close();//virtual
+ container.close(); //virtual
}
log.trace( "IndexReader closed." );
}
public void initialize(Properties props, SearchFactoryImplementor searchFactoryImplementor) {
- Map<DirectoryProvider,PerDirectoryLatestReader> map = new HashMap<DirectoryProvider,PerDirectoryLatestReader>();
Set<DirectoryProvider<?>> providers = searchFactoryImplementor.getDirectoryProviders();
+
+ // create the readers for the known providers. Unfortunately, it is not possible to
+ // create all readers in initalize since some providers have more than one directory (eg
+ // FSSlaveDirectoryProvider). See also HSEARCH-250.
for ( DirectoryProvider provider : providers ) {
- try {
- map.put( provider, new PerDirectoryLatestReader( provider ) );
- } catch (IOException e) {
- throw new SearchException( "Unable to open Lucene IndexReader", e );
- }
+ createReader( provider.getDirectory() );
}
- //FIXME I'm not convinced this non-final fields are safe without locks, but I may be wrong.
- currentReaders = Collections.unmodifiableMap( map );
}
+ /**
+ * Thread safe creation of <code>PerDirectoryLatestReader</code>.
+ *
+ * @param directory The Lucene directory for which to create the reader.
+ * @return either the cached instance for the specified <code>Directory</code> or a newly created one.
+ * @see <a href="http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-250">HSEARCH-250</a>
+ */
+ private synchronized PerDirectoryLatestReader createReader(Directory directory) {
+ PerDirectoryLatestReader reader = currentReaders.get( directory );
+ if ( reader != null ) {
+ return reader;
+ }
+
+ try {
+ reader = new PerDirectoryLatestReader( directory );
+ currentReaders.put( directory, reader );
+ return reader;
+ }
+ catch ( IOException e ) {
+ throw new SearchException( "Unable to open Lucene IndexReader", e );
+ }
+ }
+
public void destroy() {
IndexReader[] readers = allReaders.keySet().toArray( new IndexReader[allReaders.size()] );
- for (IndexReader reader : readers) {
- ReaderUsagePair usage = allReaders.get( reader );
+ for ( IndexReader reader : readers ) {
+ ReaderUsagePair usage = allReaders.get( reader );
usage.close();
}
- if ( allReaders.size() != 0 ) log.warn( "ReaderProvider contains readers not properly closed at destroy time" );
+ if ( allReaders.size() != 0 ) {
+ log.warn( "ReaderProvider contains readers not properly closed at destroy time" );
+ }
}
public IndexReader openReader(DirectoryProvider... directoryProviders) {
@@ -95,7 +118,10 @@
if ( log.isTraceEnabled() ) {
log.trace( "Opening IndexReader from {}", directoryProvider.getDirectory() );
}
- PerDirectoryLatestReader directoryLatestReader = currentReaders.get( directoryProvider );
+ PerDirectoryLatestReader directoryLatestReader = currentReaders.get( directoryProvider.getDirectory() );
+ if ( directoryLatestReader == null ) { // might eg happen for FSSlaveDirectoryProvider
+ directoryLatestReader = createReader( directoryProvider.getDirectory() );
+ }
readers[index] = directoryLatestReader.refreshAndGet();
}
// don't use ReaderProviderHelper.buildMultiReader as we need our own cleanup.
@@ -106,7 +132,7 @@
try {
return new CacheableMultiReader( readers );
}
- catch (Exception e) {
+ catch ( Exception e ) {
//Lucene 2.2 used to throw IOExceptions here
for ( IndexReader ir : readers ) {
ReaderUsagePair readerUsagePair = allReaders.get( ir );
@@ -116,17 +142,17 @@
}
}
}
-
+
//overridable method for testability:
- protected IndexReader readerFactory(DirectoryProvider provider) throws IOException {
- return IndexReader.open( provider.getDirectory() );
+ protected IndexReader readerFactory(Directory directory) throws IOException {
+ return IndexReader.open( directory );
}
/**
* Container for the couple IndexReader,UsageCounter.
*/
protected final class ReaderUsagePair {
-
+
public final IndexReader reader;
/**
* When reaching 0 (always test on change) the reader should be really
@@ -136,60 +162,64 @@
* additionally when creating it will be used (+1)
*/
protected final AtomicInteger usageCounter = new AtomicInteger( 2 );
-
+
ReaderUsagePair(IndexReader r) {
reader = r;
}
-
+
/**
- * closes the IndexReader if no other resource is using it;
- * in this case the reference to this container will also be removed.
+ * Closes the <code>IndexReader</code> if no other resource is using it
+ * in which case the reference to this container will also be removed.
*/
public void close() {
int refCount = usageCounter.decrementAndGet();
- if ( refCount==0 ) {
+ if ( refCount == 0 ) {
//TODO I've been experimenting with the idea of an async-close: didn't appear to have an interesting benefit,
//so discarded the code. should try with bigger indexes to see if the effect gets more impressive.
ReaderUsagePair removed = allReaders.remove( reader );//remove ourself
try {
reader.close();
- } catch (IOException e) {
+ }
+ catch ( IOException e ) {
log.warn( "Unable to close Lucene IndexReader", e );
}
assert removed != null;
}
- else if ( refCount<0 ) {
+ else if ( refCount < 0 ) {
//doesn't happen with current code, could help spotting future bugs?
- throw new AssertionFailure( "Closing an IndexReader for which you didn't own a lock-token, or somebody else which didn't own closed already." );
+ throw new AssertionFailure(
+ "Closing an IndexReader for which you didn't own a lock-token, or somebody else which didn't own closed already."
+ );
}
}
-
- public String toString(){
+
+ public String toString() {
return "Reader:" + this.hashCode() + " ref.count=" + usageCounter.get();
}
-
+
}
-
+
/**
* An instance for each DirectoryProvider,
* establishing the association between "current" ReaderUsagePair
* for a DirectoryProvider and it's lock.
*/
protected final class PerDirectoryLatestReader {
-
+
/**
* Reference to the most current IndexReader for a DirectoryProvider;
* guarded by lockOnReplaceCurrent;
*/
public ReaderUsagePair current; //guarded by lockOnReplaceCurrent
private final Lock lockOnReplaceCurrent = new ReentrantLock();
-
+
/**
- * @param provider The DirectoryProvider for which we manage the IndexReader.
+ * @param directory The <code>Directory</code> for which we manage the <code>IndexReader</code>.
+ *
* @throws IOException when the index initialization fails.
*/
- public PerDirectoryLatestReader(DirectoryProvider provider) throws IOException {
- IndexReader reader = readerFactory( provider );
+ public PerDirectoryLatestReader(Directory directory) throws IOException {
+ IndexReader reader = readerFactory( directory );
ReaderUsagePair initialPair = new ReaderUsagePair( reader );
initialPair.usageCounter.set( 1 );//a token to mark as active (preventing real close).
lockOnReplaceCurrent.lock();//no harm, just ensuring safe publishing.
@@ -201,6 +231,7 @@
/**
* Gets an updated IndexReader for the current DirectoryProvider;
* the index status will be checked.
+ *
* @return the current IndexReader if it's in sync with underlying index, a new one otherwise.
*/
public IndexReader refreshAndGet() {
@@ -211,7 +242,8 @@
IndexReader beforeUpdateReader = current.reader;
try {
updatedReader = beforeUpdateReader.reopen();
- } catch (IOException e) {
+ }
+ catch ( IOException e ) {
throw new SearchException( "Unable to reopen IndexReader", e );
}
if ( beforeUpdateReader == updatedReader ) {
@@ -226,7 +258,8 @@
current = newPair;
allReaders.put( updatedReader, newPair );//unfortunately still needs lock
}
- } finally {
+ }
+ finally {
lockOnReplaceCurrent.unlock();
}
// doesn't need lock:
@@ -235,7 +268,5 @@
}
return updatedReader;
}
-
}
-
}
Modified: search/trunk/src/test/org/hibernate/search/test/reader/functionality/SharingBufferIndexProviderTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/reader/functionality/SharingBufferIndexProviderTest.java 2008-11-05 20:06:43 UTC (rev 15522)
+++ search/trunk/src/test/org/hibernate/search/test/reader/functionality/SharingBufferIndexProviderTest.java 2008-11-05 20:14:41 UTC (rev 15523)
@@ -62,10 +62,10 @@
}
}
- private DirectoryProvider[] getRandomEvailableDPs() {
+ private DirectoryProvider[] getRandomAvailableDPs() {
int arraySize = random.nextInt( readerProvider.manipulators.size() - 1 ) + 1;
DirectoryProvider[] array = new DirectoryProvider[arraySize];
- List<DirectoryProvider> availableDPs = new ArrayList<DirectoryProvider>( readerProvider.manipulators.keySet() );
+ List<DirectoryProvider> availableDPs = new ArrayList<DirectoryProvider>( readerProvider.directoryProviders );
for (int i=0; i<arraySize; i++){
int chosenDpIndex = random.nextInt( availableDPs.size() );
array[i] = availableDPs.get( chosenDpIndex );
@@ -82,7 +82,7 @@
//manage termination:
return;
}
- IndexReader fakeOpenReader = readerProvider.openReader( getRandomEvailableDPs() );
+ IndexReader fakeOpenReader = readerProvider.openReader( getRandomAvailableDPs() );
Thread.yield();
readerProvider.closeReader( fakeOpenReader );
countDoneSearches.incrementAndGet();
@@ -93,9 +93,9 @@
public void run() {
super.run();
Thread.yield();
- DirectoryProvider[] randomEvailableDPs = getRandomEvailableDPs();
+ DirectoryProvider[] randomEvailableDPs = getRandomAvailableDPs();
for ( DirectoryProvider dp : randomEvailableDPs ) {
- TestManipulatorPerDP testManipulatorPerDP = readerProvider.manipulators.get( dp );
+ TestManipulatorPerDP testManipulatorPerDP = readerProvider.manipulators.get( dp.getDirectory() );
testManipulatorPerDP.setIndexChanged();
}
countDoneIndexmods.incrementAndGet();
Modified: search/trunk/src/test/org/hibernate/search/test/reader/functionality/TestableSharingBufferReaderProvider.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/reader/functionality/TestableSharingBufferReaderProvider.java 2008-11-05 20:06:43 UTC (rev 15522)
+++ search/trunk/src/test/org/hibernate/search/test/reader/functionality/TestableSharingBufferReaderProvider.java 2008-11-05 20:14:41 UTC (rev 15523)
@@ -3,12 +3,12 @@
import java.io.IOException;
import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -22,6 +22,8 @@
import org.apache.lucene.index.TermFreqVector;
import org.apache.lucene.index.TermPositions;
import org.apache.lucene.index.TermVectorMapper;
+import org.apache.lucene.store.Directory;
+
import org.hibernate.search.SearchException;
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.hibernate.search.reader.ReaderProviderHelper;
@@ -33,127 +35,133 @@
* @author Sanne Grinovero
*/
public class TestableSharingBufferReaderProvider extends SharingBufferReaderProvider {
-
+
private static final int NUM_DIRECTORY_PROVIDERS = 4;
private final Vector<MockIndexReader> createdReadersHistory = new Vector<MockIndexReader>( 500 );
- final Map<DirectoryProvider,TestManipulatorPerDP> manipulators = new ConcurrentHashMap<DirectoryProvider,TestManipulatorPerDP>();
+ final Map<Directory, TestManipulatorPerDP> manipulators = new ConcurrentHashMap<Directory, TestManipulatorPerDP>();
+ final List<DirectoryProvider> directoryProviders = Collections.synchronizedList(new ArrayList<DirectoryProvider>());
public TestableSharingBufferReaderProvider() {
- for (int i=0; i<NUM_DIRECTORY_PROVIDERS; i++) {
+ for ( int i = 0; i < NUM_DIRECTORY_PROVIDERS; i++ ) {
TestManipulatorPerDP tm = new TestManipulatorPerDP( i );
- manipulators.put( tm.dp, tm );
+ manipulators.put( tm.dp.getDirectory(), tm );
+ directoryProviders.add( tm.dp );
}
}
-
+
public static class TestManipulatorPerDP {
private final AtomicBoolean isIndexReaderCurrent = new AtomicBoolean( false );//starts at true, see MockIndexReader contructor
private final AtomicBoolean isReaderCreated = new AtomicBoolean( false );
private final DirectoryProvider dp = new RAMDirectoryProvider();
-
- public TestManipulatorPerDP( int seed ) {
+
+ public TestManipulatorPerDP(int seed) {
dp.initialize( "dp" + seed, null, null );
dp.start();
}
-
+
public void setIndexChanged() {
isIndexReaderCurrent.set( false );
}
-
+
}
-
+
public boolean isReaderCurrent(MockIndexReader reader) {
//avoid usage of allReaders or test would be useless
- for (PerDirectoryLatestReader latest : super.currentReaders.values() ) {
+ for ( PerDirectoryLatestReader latest : currentReaders.values() ) {
IndexReader latestReader = latest.current.reader;
- if ( latestReader == reader) {
+ if ( latestReader == reader ) {
return true;
}
}
return false;
}
-
+
@Override
- protected IndexReader readerFactory(DirectoryProvider provider) {
- TestManipulatorPerDP manipulatorPerDP = manipulators.get( provider );
- if ( ! manipulatorPerDP.isReaderCreated.compareAndSet( false, true ) ) {
+ protected IndexReader readerFactory(Directory directory) {
+ TestManipulatorPerDP manipulatorPerDP = manipulators.get( directory );
+ if ( !manipulatorPerDP.isReaderCreated.compareAndSet( false, true ) ) {
throw new IllegalStateException( "IndexReader1 created twice" );
}
else {
return new MockIndexReader( manipulatorPerDP.isIndexReaderCurrent );
}
}
-
+
@Override
public void initialize(Properties props, SearchFactoryImplementor searchFactoryImplementor) {
- Map<DirectoryProvider,PerDirectoryLatestReader> map = new HashMap<DirectoryProvider,PerDirectoryLatestReader>();
try {
- for ( DirectoryProvider dp : manipulators.keySet() ) {
- map.put( dp, new PerDirectoryLatestReader( dp ) );
+ for ( Directory directory : manipulators.keySet() ) {
+ currentReaders.put( directory, new PerDirectoryLatestReader( directory ) );
}
- } catch (IOException e) {
+ }
+ catch ( IOException e ) {
throw new SearchException( "Unable to open Lucene IndexReader", e );
}
- currentReaders = Collections.unmodifiableMap( map );
}
-
+
public boolean areAllOldReferencesGone() {
- int numReferencesReaders = super.allReaders.size();
+ int numReferencesReaders = allReaders.size();
int numExpectedActiveReaders = manipulators.size();
return numReferencesReaders == numExpectedActiveReaders;
}
-
- public List<MockIndexReader> getCreatedIndexReaders(){
+
+ public List<MockIndexReader> getCreatedIndexReaders() {
return createdReadersHistory;
}
-
+
public MockIndexReader getCurrentMockReaderPerDP(DirectoryProvider dp) {
- IndexReader[] indexReaders = ReaderProviderHelper.getSubReadersFromMultiReader( (MultiReader) super.openReader( new DirectoryProvider[]{ dp } ) );
- if ( indexReaders.length != 1 ){
+ IndexReader[] indexReaders = ReaderProviderHelper.getSubReadersFromMultiReader(
+ ( MultiReader ) super.openReader(
+ new DirectoryProvider[] { dp }
+ )
+ );
+ if ( indexReaders.length != 1 ) {
throw new IllegalStateException( "Expecting one reader" );
}
- return (MockIndexReader) indexReaders[0];
+ return ( MockIndexReader ) indexReaders[0];
}
-
+
public class MockIndexReader extends IndexReader {
-
+
private final AtomicBoolean closed = new AtomicBoolean( false );
private final AtomicBoolean hasAlreadyBeenReOpened = new AtomicBoolean( false );
private final AtomicBoolean isIndexReaderCurrent;
-
+
MockIndexReader(AtomicBoolean isIndexReaderCurrent) {
this.isIndexReaderCurrent = isIndexReaderCurrent;
- if ( ! isIndexReaderCurrent.compareAndSet(false, true) ) {
+ if ( !isIndexReaderCurrent.compareAndSet( false, true ) ) {
throw new IllegalStateException( "Unnecessarily reopened" );
}
createdReadersHistory.add( this );
}
-
+
public final boolean isClosed() {
return closed.get();
}
-
+
@Override
protected void doClose() throws IOException {
boolean okToClose = closed.compareAndSet( false, true );
- if ( ! okToClose ) {
+ if ( !okToClose ) {
throw new IllegalStateException( "Attempt to close a closed IndexReader" );
}
- if ( ! hasAlreadyBeenReOpened.get() ) {
+ if ( !hasAlreadyBeenReOpened.get() ) {
throw new IllegalStateException( "Attempt to close the most current IndexReader" );
}
}
-
+
@Override
- public synchronized IndexReader reopen(){
+ public synchronized IndexReader reopen() {
if ( isIndexReaderCurrent.get() ) {
return this;
}
else {
- if ( hasAlreadyBeenReOpened.compareAndSet( false, true) ) {
+ if ( hasAlreadyBeenReOpened.compareAndSet( false, true ) ) {
return new MockIndexReader( isIndexReaderCurrent );
}
- else
+ else {
throw new IllegalStateException( "Attempt to reopen an old IndexReader more than once" );
+ }
}
}
@@ -169,7 +177,7 @@
@Override
protected void doSetNorm(int doc, String field, byte value) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException();
}
@Override
@@ -261,7 +269,7 @@
public TermEnum terms(Term t) throws IOException {
throw new UnsupportedOperationException();
}
-
+
}
}
16 years, 2 months
Hibernate SVN: r15522 - in search/trunk/src: java/org/hibernate/search/util and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2008-11-05 15:06:43 -0500 (Wed, 05 Nov 2008)
New Revision: 15522
Modified:
search/trunk/src/java/org/hibernate/search/store/FSSlaveDirectoryProvider.java
search/trunk/src/java/org/hibernate/search/util/FileHelper.java
search/trunk/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
search/trunk/src/test/org/hibernate/search/test/directoryProvider/MultipleSFTestCase.java
search/trunk/src/test/org/hibernate/search/test/util/FileHelperTest.java
Log:
HSEARCH-266
* Added new method areInSync(File, File) to FileHelper
* Modified FSSlaveDirectoryProvider to not copy if the source and destination are still in sync
* Updated tests
Modified: search/trunk/src/java/org/hibernate/search/store/FSSlaveDirectoryProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/store/FSSlaveDirectoryProvider.java 2008-11-05 20:03:42 UTC (rev 15521)
+++ search/trunk/src/java/org/hibernate/search/store/FSSlaveDirectoryProvider.java 2008-11-05 20:06:43 UTC (rev 15522)
@@ -25,25 +25,25 @@
* The base directory is represented by hibernate.search.<index>.indexBase
* The index is created in <base directory>/<index name>
* The source (aka copy) directory is built from <sourceBase>/<index name>
- *
+ * <p/>
* A copy is triggered every refresh seconds
*
* @author Emmanuel Bernard
* @author Sanne Grinovero
*/
public class FSSlaveDirectoryProvider implements DirectoryProvider<FSDirectory> {
-
+
private static final Logger log = LoggerFactory.make();
private final Timer timer = new Timer( true ); //daemon thread, the copy algorithm is robust
-
+
private volatile int current; //used also as memory barrier of all other values, which are set once.
-
+
//variables having visibility granted by a read of "current"
private FSDirectory directory1;
private FSDirectory directory2;
private String indexName;
private long copyChunkSize;
-
+
//variables needed between initialize and start (used by same thread: no special care needed)
private File sourceIndexDir;
private File indexDir;
@@ -55,7 +55,7 @@
this.directoryProviderName = directoryProviderName;
//source guessing
sourceIndexDir = DirectoryProviderHelper.getSourceDirectory( directoryProviderName, properties, false );
- if ( ! new File( sourceIndexDir, "current1" ).exists() && ! new File( sourceIndexDir, "current2" ).exists() ) {
+ if ( !new File( sourceIndexDir, "current1" ).exists() && !new File( sourceIndexDir, "current2" ).exists() ) {
throw new IllegalStateException( "No current marker in source directory" );
}
log.debug( "Source directory: {}", sourceIndexDir.getPath() );
@@ -64,7 +64,7 @@
try {
indexName = indexDir.getCanonicalPath();
}
- catch (IOException e) {
+ catch ( IOException e ) {
throw new SearchException( "Unable to initialize index: " + directoryProviderName, e );
}
copyChunkSize = DirectoryProviderHelper.getCopyBufferSize( directoryProviderName, properties );
@@ -90,33 +90,35 @@
}
else {
//no default
- log.debug( "Setting directory 1 as current");
+ log.debug( "Setting directory 1 as current" );
currentToBe = 1;
File destinationFile = new File( indexDir, Integer.valueOf( readCurrentState ).toString() );
int sourceCurrent;
- if ( new File( sourceIndexDir, "current1").exists() ) {
+ if ( new File( sourceIndexDir, "current1" ).exists() ) {
sourceCurrent = 1;
}
- else if ( new File( sourceIndexDir, "current2").exists() ) {
+ else if ( new File( sourceIndexDir, "current2" ).exists() ) {
sourceCurrent = 2;
}
else {
throw new AssertionFailure( "No current file marker found in source directory: " + sourceIndexDir.getPath() );
}
try {
- FileHelper.synchronize( new File( sourceIndexDir, String.valueOf( sourceCurrent ) ),
- destinationFile, true, copyChunkSize );
+ FileHelper.synchronize(
+ new File( sourceIndexDir, String.valueOf( sourceCurrent ) ),
+ destinationFile, true, copyChunkSize
+ );
}
- catch (IOException e) {
+ catch ( IOException e ) {
throw new SearchException( "Unable to synchronize directory: " + indexName, e );
}
- if ( ! currentMarker.createNewFile() ) {
+ if ( !currentMarker.createNewFile() ) {
throw new SearchException( "Unable to create the directory marker file: " + indexName );
}
}
- log.debug( "Current directory: {}", currentToBe);
+ log.debug( "Current directory: {}", currentToBe );
}
- catch (IOException e) {
+ catch ( IOException e ) {
throw new SearchException( "Unable to initialize index: " + directoryProviderName, e );
}
TimerTask task = new TriggerTask( sourceIndexDir, indexDir );
@@ -127,10 +129,10 @@
public FSDirectory getDirectory() {
int readState = current;// to have the read consistent in the next two "if"s.
- if (readState == 1) {
+ if ( readState == 1 ) {
return directory1;
}
- else if (readState == 2) {
+ else if ( readState == 2 ) {
return directory2;
}
else {
@@ -143,9 +145,13 @@
// this code is actually broken since the value change after initialize call
// but from a practical POV this is fine since we only call this method
// after initialize call
- if ( obj == this ) return true;
- if ( obj == null || !( obj instanceof FSSlaveDirectoryProvider ) ) return false;
- FSSlaveDirectoryProvider other = (FSSlaveDirectoryProvider)obj;
+ if ( obj == this ) {
+ return true;
+ }
+ if ( obj == null || !( obj instanceof FSSlaveDirectoryProvider ) ) {
+ return false;
+ }
+ FSSlaveDirectoryProvider other = ( FSSlaveDirectoryProvider ) obj;
//need to break memory barriers on both instances:
@SuppressWarnings("unused")
int readCurrentState = this.current; //unneded value, but ensure visibility of indexName
@@ -171,7 +177,7 @@
public TriggerTask(File sourceIndexDir, File destination) {
executor = Executors.newSingleThreadExecutor();
- copyTask = new CopyDirectory( sourceIndexDir, destination );
+ copyTask = new CopyDirectory( sourceIndexDir, destination );
}
public void run() {
@@ -179,10 +185,10 @@
executor.execute( copyTask );
}
else {
- if (log.isTraceEnabled()) {
+ if ( log.isTraceEnabled() ) {
@SuppressWarnings("unused")
int unneeded = current;//ensure visibility of indexName in Timer threads.
- log.trace( "Skipping directory synchronization, previous work still in progress: {}", indexName);
+ log.trace( "Skipping directory synchronization, previous work still in progress: {}", indexName );
}
}
}
@@ -201,45 +207,71 @@
public void run() {
long start = System.currentTimeMillis();
try {
- int oldIndex = current;
- int index = oldIndex == 1 ? 2 : 1;
- File sourceFile;
- if ( new File( source, "current1" ).exists() ) {
- sourceFile = new File(source, "1");
- }
- else if ( new File( source, "current2" ).exists() ) {
- sourceFile = new File(source, "2");
- }
- else {
+ File sourceFile = determineCurrentSourceFile();
+ if ( sourceFile == null ) {
log.error( "Unable to determine current in source directory" );
return;
}
+
+ // check whether a copy is needed at all
+ File currentDestinationFile = new File( destination, Integer.valueOf( current ).toString() );
+ try {
+ if ( FileHelper.areInSync( sourceFile, currentDestinationFile ) ) {
+ if ( log.isTraceEnabled() ) {
+ log.trace( "Source and destination directory are in sync. No copying required." );
+ }
+ return;
+ }
+ }
+ catch ( IOException ioe ) {
+ log.warn( "Unable to compare {} with {}.", sourceFile.getName(), currentDestinationFile.getName() );
+ }
+
+ // copy is required
+ int oldIndex = current;
+ int index = oldIndex == 1 ? 2 : 1;
File destinationFile = new File( destination, Integer.valueOf( index ).toString() );
try {
log.trace( "Copying {} into {}", sourceFile, destinationFile );
FileHelper.synchronize( sourceFile, destinationFile, true, copyChunkSize );
current = index;
+ log.trace( "Copy for {} took {} ms", indexName, ( System.currentTimeMillis() - start ) );
}
- catch (IOException e) {
+ catch ( IOException e ) {
//don't change current
- log.error( "Unable to synchronize " + indexName, e);
+ log.error( "Unable to synchronize " + indexName, e );
return;
}
- if ( ! new File( indexName, "current" + oldIndex ).delete() ) {
+ if ( !new File( indexName, "current" + oldIndex ).delete() ) {
log.warn( "Unable to remove previous marker file in " + indexName );
}
try {
new File( indexName, "current" + index ).createNewFile();
}
- catch( IOException e ) {
+ catch ( IOException e ) {
log.warn( "Unable to create current marker file in " + indexName, e );
}
}
finally {
inProgress.set( false );
}
- log.trace( "Copy for {} took {} ms", indexName, (System.currentTimeMillis() - start) );
}
+
+ /**
+ * @return Return a file to the currently active source directory. Tests for the files "current1" and
+ * "current2" in order to determine which is the current directory. If there marker file does not exists
+ * <code>null</code> is returned.
+ */
+ private File determineCurrentSourceFile() {
+ File sourceFile = null;
+ if ( new File( source, "current1" ).exists() ) {
+ sourceFile = new File( source, "1" );
+ }
+ else if ( new File( source, "current2" ).exists() ) {
+ sourceFile = new File( source, "2" );
+ }
+ return sourceFile;
+ }
}
public void stop() {
@@ -249,13 +281,13 @@
try {
directory1.close();
}
- catch (Exception e) {
+ catch ( Exception e ) {
log.error( "Unable to properly close Lucene directory {}" + directory1.getFile(), e );
}
try {
directory2.close();
}
- catch (Exception e) {
+ catch ( Exception e ) {
log.error( "Unable to properly close Lucene directory {}" + directory2.getFile(), e );
}
}
Modified: search/trunk/src/java/org/hibernate/search/util/FileHelper.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/util/FileHelper.java 2008-11-05 20:03:42 UTC (rev 15521)
+++ search/trunk/src/java/org/hibernate/search/util/FileHelper.java 2008-11-05 20:06:43 UTC (rev 15522)
@@ -2,27 +2,75 @@
package org.hibernate.search.util;
import java.io.File;
-import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.Set;
-import java.util.HashSet;
-import java.util.Arrays;
-import java.nio.channels.FileChannel;
import org.slf4j.Logger;
/**
+ * Utility class for synchronizing files/directories.
+ *
* @author Emmanuel Bernard
* @author Sanne Grinovero
+ * @author Hardy Ferentschik
*/
public abstract class FileHelper {
- private static final Logger log = LoggerFactory.make();
+ private static final Logger log = LoggerFactory.make();
private static final int FAT_PRECISION = 2000;
public static final long DEFAULT_COPY_BUFFER_SIZE = 16 * 1024 * 1024; // 16 MB
-
+
+ public static boolean areInSync(File source, File destination) throws IOException {
+ if ( source.isDirectory() ) {
+ if ( !destination.exists() ) {
+ return false;
+ }
+ else if ( !destination.isDirectory() ) {
+ throw new IOException(
+ "Source and Destination not of the same type:"
+ + source.getCanonicalPath() + " , " + destination.getCanonicalPath()
+ );
+ }
+ String[] sources = source.list();
+ Set<String> srcNames = new HashSet<String>( Arrays.asList( sources ) );
+ String[] dests = destination.list();
+
+ // check for files in destination and not in source
+ for ( String fileName : dests ) {
+ if ( !srcNames.contains( fileName ) ) {
+ return false;
+ }
+ }
+
+ boolean inSync = true;
+ for ( String fileName : sources ) {
+ File srcFile = new File( source, fileName );
+ File destFile = new File( destination, fileName );
+ if ( !areInSync( srcFile, destFile ) ) {
+ inSync = false;
+ break;
+ }
+ }
+ return inSync;
+ }
+ else {
+ if ( destination.exists() && destination.isFile() ) {
+ long sts = source.lastModified() / FAT_PRECISION;
+ long dts = destination.lastModified() / FAT_PRECISION;
+ return sts == dts;
+ }
+ else {
+ return false;
+ }
+ }
+ }
+
public static void synchronize(File source, File destination, boolean smart) throws IOException {
synchronize( source, destination, smart, DEFAULT_COPY_BUFFER_SIZE );
}
@@ -33,29 +81,31 @@
chunkSize = DEFAULT_COPY_BUFFER_SIZE;
}
if ( source.isDirectory() ) {
- if ( ! destination.exists() ) {
- if ( ! destination.mkdirs() ){
- throw new IOException("Could not create path " + destination);
+ if ( !destination.exists() ) {
+ if ( !destination.mkdirs() ) {
+ throw new IOException( "Could not create path " + destination );
}
}
- else if ( ! destination.isDirectory() ) {
- throw new IOException("Source and Destination not of the same type:"
- + source.getCanonicalPath() + " , " + destination.getCanonicalPath() );
+ else if ( !destination.isDirectory() ) {
+ throw new IOException(
+ "Source and Destination not of the same type:"
+ + source.getCanonicalPath() + " , " + destination.getCanonicalPath()
+ );
}
String[] sources = source.list();
Set<String> srcNames = new HashSet<String>( Arrays.asList( sources ) );
String[] dests = destination.list();
//delete files not present in source
- for (String fileName : dests) {
- if ( ! srcNames.contains( fileName ) ) {
- delete( new File(destination, fileName) );
+ for ( String fileName : dests ) {
+ if ( !srcNames.contains( fileName ) ) {
+ delete( new File( destination, fileName ) );
}
}
//copy each file from source
- for (String fileName : sources) {
- File srcFile = new File(source, fileName);
- File destFile = new File(destination, fileName);
+ for ( String fileName : sources ) {
+ File srcFile = new File( source, fileName );
+ File destFile = new File( destination, fileName );
synchronize( srcFile, destFile, smart, chunkSize );
}
}
@@ -68,11 +118,11 @@
long dts = destination.lastModified() / FAT_PRECISION;
//do not copy if smart and same timestamp and same length
if ( !smart || sts == 0 || sts != dts || source.length() != destination.length() ) {
- copyFile(source, destination, chunkSize);
+ copyFile( source, destination, chunkSize );
}
}
else {
- copyFile(source, destination, chunkSize);
+ copyFile( source, destination, chunkSize );
}
}
}
@@ -81,7 +131,7 @@
FileInputStream is = null;
FileOutputStream os = null;
try {
- is = new FileInputStream(srcFile);
+ is = new FileInputStream( srcFile );
FileChannel iChannel = is.getChannel();
os = new FileOutputStream( destFile, false );
FileChannel oChannel = os.getChannel();
@@ -91,21 +141,26 @@
long iterationBytes = Math.min( todoBytes, chunkSize );
long transferredLength = oChannel.transferFrom( iChannel, doneBytes, iterationBytes );
if ( iterationBytes != transferredLength ) {
- throw new IOException( "Error during file transfer: expected "
- + iterationBytes + " bytes, only "+ transferredLength + " bytes copied." );
+ throw new IOException(
+ "Error during file transfer: expected "
+ + iterationBytes + " bytes, only " + transferredLength + " bytes copied."
+ );
}
doneBytes += transferredLength;
todoBytes -= transferredLength;
}
}
finally {
- if (is != null) is.close();
- if (os != null) os.close();
+ if ( is != null ) {
+ is.close();
+ }
+ if ( os != null ) {
+ os.close();
+ }
}
boolean successTimestampOp = destFile.setLastModified( srcFile.lastModified() );
- if ( ! successTimestampOp ) {
- log.warn( "Could not change timestamp for " + destFile +
- ". Index synchronization may be slow." );
+ if ( !successTimestampOp ) {
+ log.warn( "Could not change timestamp for {}. Index synchronization may be slow.", destFile );
}
}
@@ -116,10 +171,9 @@
}
}
if ( file.exists() ) {
- if ( ! file.delete() ) {
- log.error( "Could not delete " + file );
+ if ( !file.delete() ) {
+ log.error( "Could not delete {}", file );
}
}
}
-
}
Modified: search/trunk/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2008-11-05 20:03:42 UTC (rev 15521)
+++ search/trunk/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2008-11-05 20:06:43 UTC (rev 15522)
@@ -7,114 +7,155 @@
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.queryParser.QueryParser;
+import org.slf4j.Logger;
+
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
import org.hibernate.search.util.FileHelper;
+import org.hibernate.search.util.LoggerFactory;
/**
+ * Test case for master/slave directories.
+ *
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class FSSlaveAndMasterDPTest extends MultipleSFTestCase {
-
+
+ private static final Logger log = LoggerFactory.make();
+
private static File root;
+
static {
- String buildDir = System.getProperty("build.dir");
- if (buildDir == null) {
+ String buildDir = System.getProperty( "build.dir" );
+ if ( buildDir == null ) {
buildDir = ".";
}
- root = new File(buildDir, "lucenedirs");
+ root = new File( buildDir, "lucenedirs" );
+ log.info( "Using {} as test directory.", root.getAbsolutePath() );
}
- @SuppressWarnings( { "PointlessArithmeticExpression" } )
+ /**
+ * The lucene index directory which is shared bewtween master and slave.
+ */
+ private String masterCopy = "/master/copy";
+
+ /**
+ * The lucene index directory which is specific to the master node.
+ */
+ private String masterMain = "/master/main";
+
+ /**
+ * The lucene index directory which is specific to the slave node.
+ */
+ private String slave = "/slave";
+
+ /**
+ * Verifies that copies of the master get properly copied to the slaves.
+ *
+ * @throws Exception in case the test fails.
+ */
public void testProperCopy() throws Exception {
- Session s1 = getSessionFactories()[0].openSession( );
- SnowStorm sn = new SnowStorm();
- sn.setDate( new Date() );
- sn.setLocation( "Dallas, TX, USA");
- FullTextSession fts2 = Search.getFullTextSession( getSessionFactories()[1].openSession( ) );
- QueryParser parser = new QueryParser("id", new StopAnalyzer() );
- List result = fts2.createFullTextQuery( parser.parse( "location:texas" ) ).list();
+ // assert that the salve index is empty
+ FullTextSession fullTextSession = Search.getFullTextSession( getSlaveSession() );
+ QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
+ List result = fullTextSession.createFullTextQuery( parser.parse( "location:texas" ) ).list();
assertEquals( "No copy yet, fresh index expected", 0, result.size() );
+ fullTextSession.close();
+
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
+ // create an entity on the master and persist it in order to index it
+ Session session = getMasterSession();
+ SnowStorm sn = new SnowStorm();
+ sn.setDate( new Date() );
+ sn.setLocation( "Dallas, TX, USA" );
+ session.persist( sn );
+ session.flush(); //we don' commit so we need to flush manually
+ session.close();
- fts2.close();
- s1.close();
+ int waitPeriodMilli = 2010; // wait a bit more than 2 refresh periods (one master / one slave) - 2 * 1 * 1000 + 10
+ Thread.sleep( waitPeriodMilli );
- int waitPeroid = 2 * 1 * 1000 + 10; //wait a bit more than 2 refresh (one master / one slave)
- Thread.sleep( waitPeroid );
-
- //temp test original
- fts2 = Search.getFullTextSession( getSessionFactories()[0].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
+ // assert that the master hass indexed the snowstorm
+ fullTextSession = Search.getFullTextSession( getMasterSession() );
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
assertEquals( "Original should get one", 1, result.size() );
+ fullTextSession.close();
- fts2 = Search.getFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
- assertEquals("First copy did not work out", 1, result.size() );
+ // assert that index got copied to the salve as well
+ log.info("Searching slave");
+ fullTextSession = Search.getFullTextSession( getSlaveSession() );
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
+ assertEquals( "First copy did not work out", 1, result.size() );
+ fullTextSession.close();
- s1 = getSessionFactories()[0].openSession( );
+ // add a new snowstorm to the master
+ session = getMasterSession();
sn = new SnowStorm();
sn.setDate( new Date() );
- sn.setLocation( "Chennai, India");
+ sn.setLocation( "Chennai, India" );
+ session.persist( sn );
+ session.flush(); //we don' commit so we need to flush manually
+ session.close();
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
+ Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
- fts2.close();
- s1.close();
+ // assert that the new snowstorm made it into the slave
+ fullTextSession = Search.getFullTextSession( getSlaveSession() );
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:chennai" ) ).list();
+ assertEquals( "Second copy did not work out", 1, result.size() );
+ fullTextSession.close();
- Thread.sleep( waitPeroid ); //wait a bit more than 2 refresh (one master / one slave)
-
- fts2 = Search.getFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:chennai" ) ).list();
- assertEquals("Second copy did not work out", 1, result.size() );
-
- s1 = getSessionFactories()[0].openSession( );
+ session = getMasterSession();
sn = new SnowStorm();
sn.setDate( new Date() );
- sn.setLocation( "Melbourne, Australia");
+ sn.setLocation( "Melbourne, Australia" );
+ session.persist( sn );
+ session.flush(); //we don' commit so we need to flush manually
+ session.close();
- s1.persist( sn );
- s1.flush(); //we don' commit so we need to flush manually
+ Thread.sleep( waitPeriodMilli ); //wait a bit more than 2 refresh (one master / one slave)
- fts2.close();
- s1.close();
+ // once more - assert that the new snowstorm made it into the slave
+ fullTextSession = Search.getFullTextSession( getSessionFactories()[1].openSession() );
+ result = fullTextSession.createFullTextQuery( parser.parse( "location:melbourne" ) ).list();
+ assertEquals( "Third copy did not work out", 1, result.size() );
- Thread.sleep( waitPeroid ); //wait a bit more than 2 refresh (one master / one slave)
-
- fts2 = Search.getFullTextSession( getSessionFactories()[1].openSession( ) );
- result = fts2.createFullTextQuery( parser.parse( "location:melbourne" ) ).list();
- assertEquals("Third copy did not work out", 1, result.size() );
-
- fts2.close();
- //run the searchfactory.close() operations
+ fullTextSession.close();
for ( SessionFactory sf : getSessionFactories() ) {
sf.close();
}
}
+ private Session getMasterSession() {
+ return getSessionFactories()[0].openSession();
+ }
+
+ private Session getSlaveSession() {
+ return getSessionFactories()[1].openSession();
+ }
+
protected void setUp() throws Exception {
root.mkdir();
- File master = new File(root, "master/main");
+ File master = new File( root, masterMain );
master.mkdirs();
- master = new File(root, "master/copy");
+ master = new File( root, masterCopy );
master.mkdirs();
- File slave = new File(root, "slave");
- slave.mkdir();
-
+ File slaveFile = new File( root, slave );
+ slaveFile.mkdir();
+
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
+ log.info( "Deleting test directory {} ", root.getAbsolutePath() );
FileHelper.delete( root );
}
@@ -122,7 +163,6 @@
return 2;
}
- @SuppressWarnings("unchecked")
protected Class[] getMappings() {
return new Class[] {
SnowStorm.class
@@ -131,15 +171,19 @@
protected void configure(Configuration[] cfg) {
//master
- cfg[0].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + "/master/copy");
- cfg[0].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + "/master/main");
- cfg[0].setProperty( "hibernate.search.default.refresh", "1"); //every minute
- cfg[0].setProperty( "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSMasterDirectoryProvider");
+ cfg[0].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + masterCopy );
+ cfg[0].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + masterMain );
+ cfg[0].setProperty( "hibernate.search.default.refresh", "1" ); //every second
+ cfg[0].setProperty(
+ "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSMasterDirectoryProvider"
+ );
//slave(s)
- cfg[1].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + "/master/copy");
- cfg[1].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + "/slave");
- cfg[1].setProperty( "hibernate.search.default.refresh", "1"); //every minute
- cfg[1].setProperty( "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSSlaveDirectoryProvider");
+ cfg[1].setProperty( "hibernate.search.default.sourceBase", root.getAbsolutePath() + masterCopy );
+ cfg[1].setProperty( "hibernate.search.default.indexBase", root.getAbsolutePath() + slave );
+ cfg[1].setProperty( "hibernate.search.default.refresh", "1" ); //every second
+ cfg[1].setProperty(
+ "hibernate.search.default.directory_provider", "org.hibernate.search.store.FSSlaveDirectoryProvider"
+ );
}
}
Modified: search/trunk/src/test/org/hibernate/search/test/directoryProvider/MultipleSFTestCase.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/directoryProvider/MultipleSFTestCase.java 2008-11-05 20:03:42 UTC (rev 15521)
+++ search/trunk/src/test/org/hibernate/search/test/directoryProvider/MultipleSFTestCase.java 2008-11-05 20:06:43 UTC (rev 15522)
@@ -4,6 +4,7 @@
import java.io.InputStream;
import junit.framework.TestCase;
+
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
@@ -12,7 +13,7 @@
/**
* Build multiple session factories from the same set of classes
- * The configuration can be altered overriding the #configure() method
+ * The configuration can be altered overriding {@link #configure}.
*
* @author Emmanuel Bernard
*/
@@ -26,32 +27,40 @@
protected abstract int getSFNbrs();
protected void buildSessionFactories(Class[] classes, String[] packages, String[] xmlFiles) throws Exception {
- if (sessionFactories == null) sessionFactories = new SessionFactory[ getSFNbrs() ];
- if (cfgs == null) cfgs = new AnnotationConfiguration[ getSFNbrs() ];
- for (SessionFactory sf : sessionFactories ) if ( sf != null ) sf.close();
- for (int sfIndex = 0 ; sfIndex < getSFNbrs() ; sfIndex++ ) {
+ if ( sessionFactories == null ) {
+ sessionFactories = new SessionFactory[getSFNbrs()];
+ }
+ if ( cfgs == null ) {
+ cfgs = new AnnotationConfiguration[getSFNbrs()];
+ }
+ for ( SessionFactory sf : sessionFactories ) {
+ if ( sf != null ) {
+ sf.close();
+ }
+ }
+ for ( int sfIndex = 0; sfIndex < getSFNbrs(); sfIndex++ ) {
cfgs[sfIndex] = new AnnotationConfiguration();
}
configure( cfgs );
- for (int sfIndex = 0 ; sfIndex < getSFNbrs() ; sfIndex++ ) {
+ for ( int sfIndex = 0; sfIndex < getSFNbrs(); sfIndex++ ) {
try {
if ( recreateSchema() ) {
cfgs[sfIndex].setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
}
- for ( int i = 0; i < packages.length; i++ ) {
- cfgs[sfIndex].addPackage( packages[i] );
+ for ( String aPackage : packages ) {
+ cfgs[sfIndex].addPackage( aPackage );
}
- for ( int i = 0; i < classes.length; i++ ) {
- cfgs[sfIndex].addAnnotatedClass( classes[i] );
+ for ( Class aClass : classes ) {
+ cfgs[sfIndex].addAnnotatedClass( aClass );
}
- for ( int i = 0; i < xmlFiles.length; i++ ) {
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( xmlFiles[i] );
+ for ( String xmlFile : xmlFiles ) {
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( xmlFile );
cfgs[sfIndex].addInputStream( is );
}
setDialect( Dialect.getDialect() );
sessionFactories[sfIndex] = cfgs[sfIndex].buildSessionFactory( /*new TestInterceptor()*/ );
}
- catch (Exception e) {
+ catch ( Exception e ) {
e.printStackTrace();
throw e;
}
@@ -68,11 +77,11 @@
protected abstract Class[] getMappings();
protected String[] getAnnotatedPackages() {
- return new String[]{};
+ return new String[] { };
}
protected String[] getXmlFiles() {
- return new String[]{};
+ return new String[] { };
}
private void setDialect(Dialect dialect) {
@@ -83,7 +92,7 @@
return dialect;
}
- protected abstract void configure(Configuration[] cfg) ;
+ protected abstract void configure(Configuration[] cfg);
protected boolean recreateSchema() {
return true;
Modified: search/trunk/src/test/org/hibernate/search/test/util/FileHelperTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/util/FileHelperTest.java 2008-11-05 20:03:42 UTC (rev 15521)
+++ search/trunk/src/test/org/hibernate/search/test/util/FileHelperTest.java 2008-11-05 20:06:43 UTC (rev 15522)
@@ -6,35 +6,49 @@
import java.io.IOException;
import junit.framework.TestCase;
+import org.slf4j.Logger;
+
import org.hibernate.search.util.FileHelper;
+import org.hibernate.search.util.LoggerFactory;
/**
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class FileHelperTest extends TestCase {
- public void testTiti() throws Exception {
- File titi = new File("file:/c:/titi", "file:/d:/toito");
- assertFalse ( titi.exists() );
+ private static final Logger log = LoggerFactory.make();
+
+ private static File root;
+
+ static {
+ String buildDir = System.getProperty( "build.dir" );
+ if ( buildDir == null ) {
+ buildDir = ".";
+ }
+ root = new File( buildDir, "filehelper" );
+ log.info( "Using {} as test directory.", root.getAbsolutePath() );
}
- protected void setUp() throws Exception {
- super.setUp();
- File dir = new File("./filehelpersrc");
- dir.mkdir();
- String name = "a";
- createFile( dir, name );
- name = "b";
- createFile( dir, name );
- dir = new File(dir, "subdir");
- dir.mkdir();
- name = "c";
- createFile( dir, name );
+ /**
+ * Source directory
+ */
+ private String srcDir = "filehelpersrc";
+
+ /**
+ * Destination directory
+ */
+ private String destDir = "filehelperdest";
+
+
+ private File createFile(File dir, String name) throws IOException {
+ File file = new File( dir, name );
+ file.createNewFile();
+ writeDummyDataToFile( file );
+ return file;
}
- private void createFile(File dir, String name) throws IOException {
- File a = new File(dir, name);
- a.createNewFile();
- FileOutputStream os = new FileOutputStream( a, false );
+ private void writeDummyDataToFile(File file) throws IOException {
+ FileOutputStream os = new FileOutputStream( file, true );
os.write( 1 );
os.write( 2 );
os.write( 3 );
@@ -44,39 +58,58 @@
protected void tearDown() throws Exception {
super.setUp();
- File dir = new File("./filehelpersrc");
+ File dir = new File( root, srcDir );
FileHelper.delete( dir );
- dir = new File("./filehelperdest");
+ dir = new File( root, destDir );
FileHelper.delete( dir );
}
public void testSynchronize() throws Exception {
- File src = new File("./filehelpersrc");
- File dest = new File("./filehelperdest");
+ // create a src directory structure
+ File src = new File( root, srcDir );
+ src.mkdirs();
+ String name = "a";
+ createFile( src, name );
+ name = "b";
+ createFile( src, name );
+ File subDir = new File( src, "subdir" );
+ subDir.mkdirs();
+ name = "c";
+ createFile( subDir, name );
+
+ // create destination and sync
+ File dest = new File( root, destDir );
+ assertFalse( "Directories should be out of sync", FileHelper.areInSync( src, dest ) );
FileHelper.synchronize( src, dest, true );
- File test = new File(dest, "b");
- assertTrue( test.exists() );
- test = new File( new File(dest, "subdir"), "c");
- assertTrue( test.exists() );
+ assertTrue( "Directories should be in sync", FileHelper.areInSync( src, dest ) );
+ File destTestFile1 = new File( dest, "b" );
+ assertTrue( destTestFile1.exists() );
+ File destTestFile2 = new File( new File( dest, "subdir" ), "c" );
+ assertTrue( destTestFile2.exists() );
- //change
- Thread.sleep( 2*2000 );
- test = new File( src, "c");
- FileOutputStream os = new FileOutputStream( test, true );
- os.write( 1 );
- os.write( 2 );
- os.write( 3 );
- os.flush();
- os.close();
- File destTest = new File(dest, "c");
- assertNotSame( test.lastModified(), destTest.lastModified() );
+ // create a new file in destination which does not exists in src. should be deleted after next sync
+ File destTestFile3 = createFile( dest, "foo" );
+
+ // create a file in the src directory and write some data to it
+ File srcTestFile = new File( src, "c" );
+ writeDummyDataToFile( srcTestFile );
+ File destTestFile = new File( dest, "c" );
+ assertNotSame( srcTestFile.lastModified(), destTestFile.lastModified() );
+ assertFalse( "Directories should be out of sync", FileHelper.areInSync( src, dest ) );
+
FileHelper.synchronize( src, dest, true );
- assertEquals( test.lastModified(), destTest.lastModified() );
- assertEquals( test.length(), destTest.length() );
- //delete file
- test.delete();
+ assertTrue("Directories should be in sync", FileHelper.areInSync( src, dest ));
+ assertEquals( srcTestFile.lastModified(), destTestFile.lastModified() );
+ assertEquals( srcTestFile.length(), destTestFile.length() );
+ assertTrue( destTestFile1.exists() );
+ assertTrue( destTestFile2.exists() );
+ assertTrue( !destTestFile3.exists() );
+
+ // delete src test file
+ srcTestFile.delete();
FileHelper.synchronize( src, dest, true );
- assertTrue( ! destTest.exists() );
+ assertTrue( !destTestFile.exists() );
+ assertTrue("Directories should be in sync", FileHelper.areInSync( src, dest ));
}
}
16 years, 2 months
Hibernate SVN: r15521 - search/trunk/src/java/org/hibernate/search/reader.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2008-11-05 15:03:42 -0500 (Wed, 05 Nov 2008)
New Revision: 15521
Modified:
search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java
search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java
Log:
Javadoc updates
Modified: search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java 2008-11-05 19:20:28 UTC (rev 15520)
+++ search/trunk/src/java/org/hibernate/search/reader/ReaderProvider.java 2008-11-05 20:03:42 UTC (rev 15521)
@@ -8,36 +8,35 @@
import org.hibernate.search.engine.SearchFactoryImplementor;
/**
- * Responsible for providing and managing the lifecycle of a read only reader
+ * Responsible for providing and managing the lifecycle of a read only reader. The implementation must have a
+ * no-arg constructor.
* <p/>
- * Not that the reader must be closed once opened.
+ * Note that the reader must be closed once opened.
*
- * The ReaderProvider implementation must have a no-arg constructor
- *
* @author Emmanuel Bernard
*/
public interface ReaderProvider {
/**
- * Open a reader on all the listed directory providers
- * the opened reader has to be closed through #closeReader()
- * The opening can be virtual
+ * Open a reader on all the listed directory providers.
+ * The opened reader has to be closed through {@link #closeReader(IndexReader)}.
+ * The opening can be virtual.
*/
IndexReader openReader(DirectoryProvider... directoryProviders);
/**
- * close a reader previously opened by #openReader
- * The closing can be virtual
+ * Close a reader previously opened by {@link #openReader}.
+ * The closing can be virtual.
*/
void closeReader(IndexReader reader);
/**
- * inialize the reader provider before its use
+ * Inialize the reader provider before its use.
*/
void initialize(Properties props, SearchFactoryImplementor searchFactoryImplementor);
/**
- * called when a SearchFactory is destroyed. This method typically releases resources
- * This method is guaranteed to be executed after readers are released by queries (assuming no user error).
+ * Called when a <code>SearchFactory</code> is destroyed. This method typically releases resources.
+ * It is guaranteed to be executed after readers are released by queries (assuming no user error).
*/
void destroy();
}
Modified: search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java 2008-11-05 19:20:28 UTC (rev 15520)
+++ search/trunk/src/java/org/hibernate/search/reader/SharedReaderProvider.java 2008-11-05 20:03:42 UTC (rev 15521)
@@ -23,7 +23,8 @@
import org.hibernate.search.util.LoggerFactory;
/**
- * Share readers per SearchFactory, reusing them iff they are still valid.
+ * Share readers per <code>SearchFactory</code>, reusing them if they are still valid.
+ *
* @Deprecated replaced by SharingBufferReaderProvider
* @author Emmanuel Bernard
*/
16 years, 2 months
Hibernate SVN: r15520 - validator/trunk/validation-api/src/main/java/javax/validation.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-11-05 14:20:28 -0500 (Wed, 05 Nov 2008)
New Revision: 15520
Modified:
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
validator/trunk/validation-api/src/main/java/javax/validation/ValidatorFactoryBuilder.java
Log:
BVAL-23 Validator<T> is thread-safe
BVAL-49 *Descriptor returned marked as immutable
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-11-05 09:23:49 UTC (rev 15519)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-11-05 19:20:28 UTC (rev 15520)
@@ -74,7 +74,9 @@
Set<String> getGroups();
/**
- * Constraint metadata reported to fail
+ * Constraint metadata reported to fail.
+ * The returned instance is immutable.
+ *
* @return constraint metadata
*/
ConstraintDescriptor getConstraintDescriptor();
Modified: validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-11-05 09:23:49 UTC (rev 15519)
+++ validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-11-05 19:20:28 UTC (rev 15520)
@@ -22,6 +22,7 @@
/**
* Validate a given object type.
+ * Implementations of this interface must be thread-safe
*
* @author Emmanuel Bernard
* @author Hardy Ferentschik
@@ -77,13 +78,17 @@
boolean hasConstraints();
/**
- * return the class level constraints
+ * Return the class level constraints
+ * The returned object (and associated objects including ConstraintDescriptors)
+ * are immutable.
*/
BeanDescriptor getConstraintsForClass();
/**
- * return the property level constraints for a given propertyName
+ * Return the property level constraints for a given propertyName
* or null if either the property does not exist or has no constraint
+ * The returned object (and associated objects including ConstraintDescriptors)
+ * are immutable.
*/
PropertyDescriptor getConstraintsForProperty(String propertyName);
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ValidatorFactoryBuilder.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ValidatorFactoryBuilder.java 2008-11-05 09:23:49 UTC (rev 15519)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ValidatorFactoryBuilder.java 2008-11-05 19:20:28 UTC (rev 15520)
@@ -43,7 +43,7 @@
* find the first provider matching it
* - otherwise, use the first provider returned by the ValidationProviderResolver
* <p/>
- * Implementations are not meant to be thread safe
+ * Implementations are not meant to be thread-safe
*
* @author Emmanuel Bernard
*/
16 years, 2 months
Hibernate SVN: r15519 - in core/trunk/envers/src/main/java/org/hibernate/envers: entities/mapper/relation/query and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2008-11-05 04:23:49 -0500 (Wed, 05 Nov 2008)
New Revision: 15519
Removed:
core/trunk/envers/src/main/java/org/hibernate/envers/entities/mapper/relation/query/OneVersionsEntityQueryGenerator.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/AggregatedFieldVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/BetweenVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/IdentifierEqVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/InVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/LogicalVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotNullVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NullVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/PropertyVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RelatedVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RevisionVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/SimpleVersionsExpression.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/order/RevisionVersionsOrder.java
core/trunk/envers/src/main/java/org/hibernate/envers/query/projection/RevisionVersionsProjection.java
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/MetadataTools.java
Log:
HHH-3568: all audit entites are mapped with update="false"
Modified: core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/MetadataTools.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/MetadataTools.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/MetadataTools.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -59,6 +59,7 @@
prop_mapping.addAttribute("name", name);
prop_mapping.addAttribute("insert", Boolean.toString(insertable));
+ prop_mapping.addAttribute("update", "false");
if (type != null) {
prop_mapping.addAttribute("type", type);
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/entities/mapper/relation/query/OneVersionsEntityQueryGenerator.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/entities/mapper/relation/query/OneVersionsEntityQueryGenerator.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/entities/mapper/relation/query/OneVersionsEntityQueryGenerator.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,110 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.entities.mapper.relation.query;
-
-import java.util.Collections;
-
-import org.hibernate.envers.RevisionType;
-import org.hibernate.envers.configuration.GlobalConfiguration;
-import org.hibernate.envers.configuration.AuditEntitiesConfiguration;
-import org.hibernate.envers.entities.mapper.id.IdMapper;
-import org.hibernate.envers.entities.mapper.id.QueryParameterData;
-import org.hibernate.envers.entities.mapper.relation.MiddleIdData;
-import org.hibernate.envers.reader.AuditReaderImplementor;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-import org.hibernate.Query;
-
-/**
- * Selects data from a versions entity.
- * @author Adam Warski (adam at warski dot org)
- */
-public final class OneVersionsEntityQueryGenerator implements RelationQueryGenerator {
- private final String queryString;
- private final MiddleIdData referencingIdData;
-
- public OneVersionsEntityQueryGenerator(GlobalConfiguration globalCfg, AuditEntitiesConfiguration verEntCfg,
- MiddleIdData referencingIdData, String referencedEntityName,
- IdMapper referencedIdMapper) {
- this.referencingIdData = referencingIdData;
-
- /*
- * The query that we need to create:
- * SELECT new list(e) FROM versionsReferencedEntity e
- * WHERE
- * (only entities referenced by the association; id_ref_ing = id of the referencing entity)
- * e.id_ref_ing = :id_ref_ing AND
- * (selecting e entities at revision :revision)
- * e.revision = (SELECT max(e2.revision) FROM versionsReferencedEntity e2
- * WHERE e2.revision <= :revision AND e2.id = e.id) AND
- * (only non-deleted entities)
- * e.revision_type != DEL
- */
- String revisionPropertyPath = verEntCfg.getRevisionPropPath();
- String originalIdPropertyName = verEntCfg.getOriginalIdPropName();
-
- String versionsReferencedEntityName = verEntCfg.getVersionsEntityName(referencedEntityName);
-
- // SELECT new list(e) FROM versionsEntity e
- QueryBuilder qb = new QueryBuilder(versionsReferencedEntityName, "e");
- qb.addProjection("new list", "e", false, false);
- // WHERE
- Parameters rootParameters = qb.getRootParameters();
- // e.id_ref_ed = :id_ref_ed
- referencingIdData.getPrefixedMapper().addNamedIdEqualsToQuery(rootParameters, null, true);
-
- // SELECT max(e.revision) FROM versionsReferencedEntity e2
- QueryBuilder maxERevQb = qb.newSubQueryBuilder(versionsReferencedEntityName, "e2");
- maxERevQb.addProjection("max", revisionPropertyPath, false);
- // WHERE
- Parameters maxERevQbParameters = maxERevQb.getRootParameters();
- // e2.revision <= :revision
- maxERevQbParameters.addWhereWithNamedParam(revisionPropertyPath, "<=", "revision");
- // e2.id = e.id
- referencedIdMapper.addIdsEqualToQuery(maxERevQbParameters,
- "e." + originalIdPropertyName, "e2." + originalIdPropertyName);
-
- // e.revision = (SELECT max(...) ...)
- rootParameters.addWhere(revisionPropertyPath, false, globalCfg.getCorrelatedSubqueryOperator(), maxERevQb);
-
- // e.revision_type != DEL
- rootParameters.addWhereWithNamedParam(verEntCfg.getRevisionTypePropName(), false, "!=", "delrevisiontype");
-
- StringBuilder sb = new StringBuilder();
- qb.build(sb, Collections.<String, Object>emptyMap());
- queryString = sb.toString();
- }
-
- public Query getQuery(AuditReaderImplementor versionsReader, Object primaryKey, Number revision) {
- Query query = versionsReader.getSession().createQuery(queryString);
- query.setParameter("revision", revision);
- query.setParameter("delrevisiontype", RevisionType.DEL);
- for (QueryParameterData paramData: referencingIdData.getPrefixedMapper().mapToQueryParametersFromId(primaryKey)) {
- paramData.setParameterValue(query);
- }
-
- return query;
- }
-}
\ No newline at end of file
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/AggregatedFieldVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/AggregatedFieldVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/AggregatedFieldVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,82 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class AggregatedFieldVersionsExpression implements AuditCriterion, ExtendableCriterion {
- public static enum AggregatedMode {
- MAX,
- MIN
- }
-
- private String propertyName;
- private AggregatedMode mode;
- private List<AuditCriterion> criterions;
-
- public AggregatedFieldVersionsExpression(String propertyName, AggregatedMode mode) {
- this.propertyName = propertyName;
- this.mode = mode;
- criterions = new ArrayList<AuditCriterion>();
- }
-
- public AggregatedFieldVersionsExpression add(AuditCriterion criterion) {
- criterions.add(criterion);
- return this;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
-
- // This will be the aggregated query, containing all the specified conditions
- QueryBuilder subQb = qb.newSubQueryBuilder();
-
- // Adding all specified conditions both to the main query, as well as to the
- // aggregated one.
- for (AuditCriterion versionsCriteria : criterions) {
- versionsCriteria.addToQuery(verCfg, entityName, qb, parameters);
- versionsCriteria.addToQuery(verCfg, entityName, subQb, subQb.getRootParameters());
- }
-
- // Setting the desired projection of the aggregated query
- switch (mode) {
- case MIN:
- subQb.addProjection("min", propertyName, false);
- break;
- case MAX:
- subQb.addProjection("max", propertyName, false);
- }
-
- // Adding the constrain on the result of the aggregated criteria
- parameters.addWhere(propertyName, "=", subQb);
- }
-}
\ No newline at end of file
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/BetweenVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/BetweenVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/BetweenVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,49 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class BetweenVersionsExpression implements AuditCriterion {
- private String propertyName;
- private Object lo;
- private Object hi;
-
- public BetweenVersionsExpression(String propertyName, Object lo, Object hi) {
- this.propertyName = propertyName;
- this.lo = lo;
- this.hi = hi;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
- parameters.addWhereWithParam(propertyName, ">=", lo);
- parameters.addWhereWithParam(propertyName, "<=", hi);
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/IdentifierEqVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/IdentifierEqVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/IdentifierEqVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,44 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class IdentifierEqVersionsExpression implements AuditCriterion {
- private Object id;
-
- public IdentifierEqVersionsExpression(Object id) {
- this.id = id;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- verCfg.getEntCfg().get(entityName).getIdMapper()
- .addIdEqualsToQuery(parameters, id, verCfg.getAuditEntCfg().getOriginalIdPropName(), true);
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/InVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/InVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/InVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,46 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class InVersionsExpression implements AuditCriterion {
- private String propertyName;
- private Object[] values;
-
- public InVersionsExpression(String propertyName, Object[] values) {
- this.propertyName = propertyName;
- this.values = values;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
- parameters.addWhereWithParams(propertyName, "in (", values, ")");
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/LogicalVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/LogicalVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/LogicalVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,50 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class LogicalVersionsExpression implements AuditCriterion {
- private AuditCriterion lhs;
- private AuditCriterion rhs;
- private String op;
-
- public LogicalVersionsExpression(AuditCriterion lhs, AuditCriterion rhs, String op) {
- this.lhs = lhs;
- this.rhs = rhs;
- this.op = op;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- Parameters opParameters = parameters.addSubParameters(op);
-
- lhs.addToQuery(verCfg, entityName, qb, opParameters.addSubParameters("and"));
- rhs.addToQuery(verCfg, entityName, qb, opParameters.addSubParameters("and"));
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotNullVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotNullVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotNullVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,50 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.entities.RelationDescription;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class NotNullVersionsExpression implements AuditCriterion {
- private String propertyName;
-
- public NotNullVersionsExpression(String propertyName) {
- this.propertyName = propertyName;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg, entityName, propertyName);
-
- if (relatedEntity == null) {
- parameters.addWhereWithParam(propertyName, "<>", null);
- } else {
- relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, null, propertyName, false);
- }
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NotVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,43 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class NotVersionsExpression implements AuditCriterion {
- private AuditCriterion criterion;
-
- public NotVersionsExpression(AuditCriterion criterion) {
- this.criterion = criterion;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- criterion.addToQuery(verCfg, entityName, qb, parameters.addNegatedParameters());
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NullVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NullVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/NullVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,50 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.entities.RelationDescription;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class NullVersionsExpression implements AuditCriterion {
- private String propertyName;
-
- public NullVersionsExpression(String propertyName) {
- this.propertyName = propertyName;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg, entityName, propertyName);
-
- if (relatedEntity == null) {
- parameters.addWhereWithParam(propertyName, "=", null);
- } else {
- relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, null, propertyName, true);
- }
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/PropertyVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/PropertyVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/PropertyVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,49 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class PropertyVersionsExpression implements AuditCriterion {
- private String propertyName;
- private String otherPropertyName;
- private String op;
-
- public PropertyVersionsExpression(String propertyName, String otherPropertyName, String op) {
- this.propertyName = propertyName;
- this.otherPropertyName = otherPropertyName;
- this.op = op;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
- CriteriaTools.checkPropertyNotARelation(verCfg, entityName, otherPropertyName);
- parameters.addWhere(propertyName, op, otherPropertyName);
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RelatedVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RelatedVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RelatedVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,56 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.entities.RelationDescription;
-import org.hibernate.envers.exception.AuditException;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class RelatedVersionsExpression implements AuditCriterion {
- private String propertyName;
- private Object id;
- private boolean equals;
-
- public RelatedVersionsExpression(String propertyName, Object id, boolean equals) {
- this.propertyName = propertyName;
- this.id = id;
- this.equals = equals;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg, entityName, propertyName);
-
- if (relatedEntity == null) {
- throw new AuditException("This criterion can only be used on a property that is " +
- "a relation to another property.");
- } else {
- relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, id, propertyName, equals);
- }
- }
-}
\ No newline at end of file
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RevisionVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RevisionVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/RevisionVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,45 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class RevisionVersionsExpression implements AuditCriterion {
- private Object value;
- private String op;
-
- public RevisionVersionsExpression(Object value, String op) {
- this.value = value;
- this.op = op;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- parameters.addWhereWithParam(verCfg.getAuditEntCfg().getRevisionPropPath(), op, value);
- }
-}
\ No newline at end of file
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/SimpleVersionsExpression.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/SimpleVersionsExpression.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/criteria/SimpleVersionsExpression.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,62 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.criteria;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.entities.RelationDescription;
-import org.hibernate.envers.exception.AuditException;
-import org.hibernate.envers.tools.query.Parameters;
-import org.hibernate.envers.tools.query.QueryBuilder;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class SimpleVersionsExpression implements AuditCriterion {
- private String propertyName;
- private Object value;
- private String op;
-
- public SimpleVersionsExpression(String propertyName, Object value, String op) {
- this.propertyName = propertyName;
- this.value = value;
- this.op = op;
- }
-
- public void addToQuery(AuditConfiguration verCfg, String entityName, QueryBuilder qb, Parameters parameters) {
- RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg, entityName, propertyName);
-
- if (relatedEntity == null) {
- parameters.addWhereWithParam(propertyName, op, value);
- } else {
- if (!"=".equals(op) && !"<>".equals(op)) {
- throw new AuditException("This type of operation: " + op + " (" + entityName + "." + propertyName +
- ") isn't supported and can't be used in queries.");
- }
-
- Object id = relatedEntity.getIdMapper().mapToIdFromEntity(value);
-
- relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, id, propertyName, "=".equals(op));
- }
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/order/RevisionVersionsOrder.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/order/RevisionVersionsOrder.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/order/RevisionVersionsOrder.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,43 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.order;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.Pair;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class RevisionVersionsOrder implements AuditOrder {
- private final boolean asc;
-
- public RevisionVersionsOrder(boolean asc) {
- this.asc = asc;
- }
-
- public Pair<String, Boolean> getData(AuditConfiguration verCfg) {
- String revisionPropPath = verCfg.getAuditEntCfg().getRevisionPropPath();
- return Pair.make(revisionPropPath, asc);
- }
-}
Deleted: core/trunk/envers/src/main/java/org/hibernate/envers/query/projection/RevisionVersionsProjection.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/query/projection/RevisionVersionsProjection.java 2008-11-05 09:17:10 UTC (rev 15518)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/query/projection/RevisionVersionsProjection.java 2008-11-05 09:23:49 UTC (rev 15519)
@@ -1,60 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.envers.query.projection;
-
-import org.hibernate.envers.configuration.AuditConfiguration;
-import org.hibernate.envers.tools.Triple;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class RevisionVersionsProjection implements AuditProjection {
- public static enum ProjectionType {
- MAX,
- MIN,
- COUNT,
- COUNT_DISTINCT,
- DISTINCT
- }
-
- private final ProjectionType type;
-
- public RevisionVersionsProjection(ProjectionType type) {
- this.type = type;
- }
-
- public Triple<String, String, Boolean> getData(AuditConfiguration verCfg) {
- String revisionPropPath = verCfg.getAuditEntCfg().getRevisionPropPath();
-
- switch (type) {
- case MAX: return Triple.make("max", revisionPropPath, false);
- case MIN: return Triple.make("min", revisionPropPath, false);
- case COUNT: return Triple.make("count", revisionPropPath, false);
- case COUNT_DISTINCT: return Triple.make("count", revisionPropPath, true);
- case DISTINCT: return Triple.make(null, revisionPropPath, true);
- }
-
- throw new IllegalArgumentException("Unknown type " + type + ".");
- }
-}
16 years, 2 months
Hibernate SVN: r15518 - in core/trunk/envers/src/test/java/org/hibernate/envers/test: integration/accesstype and 32 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2008-11-05 04:17:10 -0500 (Wed, 05 Nov 2008)
New Revision: 15518
Modified:
core/trunk/envers/src/test/java/org/hibernate/envers/test/AbstractEntityTest.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Delete.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NotVersioned.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NullProperties.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Simple.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/QueryCache.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/EnumSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringList.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringMap.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/components/Components.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Dates.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Enums.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Serializables.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddDel.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddMod.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModDel.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModMod.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/ManualFlush.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ChildVersioning.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ParentVersioning.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicList.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/BasicNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/JoinNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicList.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/AggregateQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/CustomRevEntityQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/DeletedEntities.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/SimpleQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Custom.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Inherited.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Listener.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/sameids/SameIds.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/superclass/MappedSubclassing.java
Log:
HHH-3570: more renaming
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/AbstractEntityTest.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/AbstractEntityTest.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/AbstractEntityTest.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -40,7 +40,7 @@
public abstract class AbstractEntityTest {
private EntityManagerFactory emf;
private EntityManager entityManager;
- private AuditReader versionsReader;
+ private AuditReader auditReader;
private Ejb3Configuration cfg;
public abstract void configure(Ejb3Configuration cfg);
@@ -52,7 +52,7 @@
}
entityManager = emf.createEntityManager();
- versionsReader = AuditReaderFactory.get(entityManager);
+ auditReader = AuditReaderFactory.get(entityManager);
}
@BeforeClass
@@ -69,8 +69,8 @@
return entityManager;
}
- public AuditReader getVersionsReader() {
- return versionsReader;
+ public AuditReader getAuditReader() {
+ return auditReader;
}
public Ejb3Configuration getCfg() {
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/FieldAccessType.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -60,7 +60,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(FieldAccessTypeEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(FieldAccessTypeEntity.class, id1));
}
@Test
@@ -68,7 +68,7 @@
FieldAccessTypeEntity ver1 = new FieldAccessTypeEntity(id1, "data");
FieldAccessTypeEntity ver2 = new FieldAccessTypeEntity(id1, "data2");
- assert getVersionsReader().find(FieldAccessTypeEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(FieldAccessTypeEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(FieldAccessTypeEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/MixedAccessType.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -59,7 +59,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(MixedAccessTypeEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(MixedAccessTypeEntity.class, id1));
}
@Test
@@ -67,8 +67,8 @@
MixedAccessTypeEntity ver1 = new MixedAccessTypeEntity(id1, "data");
MixedAccessTypeEntity ver2 = new MixedAccessTypeEntity(id1, "data2");
- MixedAccessTypeEntity rev1 = getVersionsReader().find(MixedAccessTypeEntity.class, id1, 1);
- MixedAccessTypeEntity rev2 = getVersionsReader().find(MixedAccessTypeEntity.class, id1, 2);
+ MixedAccessTypeEntity rev1 = getAuditReader().find(MixedAccessTypeEntity.class, id1, 1);
+ MixedAccessTypeEntity rev2 = getAuditReader().find(MixedAccessTypeEntity.class, id1, 2);
assert rev1.isDataSet();
assert rev2.isDataSet();
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/accesstype/PropertyAccessType.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -59,7 +59,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(PropertyAccessTypeEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(PropertyAccessTypeEntity.class, id1));
}
@Test
@@ -67,8 +67,8 @@
PropertyAccessTypeEntity ver1 = new PropertyAccessTypeEntity(id1, "data");
PropertyAccessTypeEntity ver2 = new PropertyAccessTypeEntity(id1, "data2");
- PropertyAccessTypeEntity rev1 = getVersionsReader().find(PropertyAccessTypeEntity.class, id1, 1);
- PropertyAccessTypeEntity rev2 = getVersionsReader().find(PropertyAccessTypeEntity.class, id1, 2);
+ PropertyAccessTypeEntity rev1 = getAuditReader().find(PropertyAccessTypeEntity.class, id1, 1);
+ PropertyAccessTypeEntity rev2 = getAuditReader().find(PropertyAccessTypeEntity.class, id1, 2);
assert rev1.isIdSet();
assert rev2.isIdSet();
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Delete.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Delete.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Delete.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -97,11 +97,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id1));
+ assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id1));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id2));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id2));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id3));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id3));
}
@Test
@@ -109,29 +109,29 @@
BasicTestEntity2 ver1 = new BasicTestEntity2(id1, "x", null);
BasicTestEntity2 ver2 = new BasicTestEntity2(id1, "x2", null);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 3).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 4) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 4) == null;
}
@Test
public void testHistoryOfId2() {
BasicTestEntity2 ver1 = new BasicTestEntity2(id2, "y", null);
- assert getVersionsReader().find(BasicTestEntity2.class, id2, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity2.class, id2, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity2.class, id2, 3) == null;
- assert getVersionsReader().find(BasicTestEntity2.class, id2, 4) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id2, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity2.class, id2, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity2.class, id2, 3) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id2, 4) == null;
}
@Test
public void testHistoryOfId3() {
BasicTestEntity2 ver1 = new BasicTestEntity2(id3, "z", null);
- assert getVersionsReader().find(BasicTestEntity2.class, id3, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity2.class, id3, 2) == null;
- assert getVersionsReader().find(BasicTestEntity2.class, id3, 3) == null;
- assert getVersionsReader().find(BasicTestEntity2.class, id3, 4) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id3, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity2.class, id3, 2) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id3, 3) == null;
+ assert getAuditReader().find(BasicTestEntity2.class, id3, 4) == null;
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/GlobalVersioned.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -60,7 +60,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity4.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity4.class, id1));
}
@Test
@@ -68,7 +68,7 @@
BasicTestEntity4 ver1 = new BasicTestEntity4(id1, "x", "y");
BasicTestEntity4 ver2 = new BasicTestEntity4(id1, "a", "b");
- assert getVersionsReader().find(BasicTestEntity4.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity4.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity4.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity4.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/ManyOperationsInTransaction.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -87,11 +87,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
- assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id3));
+ assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id3));
}
@Test
@@ -99,9 +99,9 @@
BasicTestEntity1 ver1 = new BasicTestEntity1(id1, "x", 1);
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, "x2", 1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
}
@Test
@@ -110,9 +110,9 @@
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y", 21);
BasicTestEntity1 ver3 = new BasicTestEntity1(id2, "y3", 22);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver3);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver3);
}
@Test
@@ -120,8 +120,8 @@
BasicTestEntity1 ver1 = new BasicTestEntity1(id3, "z", 300);
BasicTestEntity1 ver2 = new BasicTestEntity1(id3, "z3", 300);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 1) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 3).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 1) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 3).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NotVersioned.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NotVersioned.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NotVersioned.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -60,11 +60,11 @@
@Test(expectedExceptions = NotAuditedException.class)
public void testRevisionsCounts() {
- getVersionsReader().getRevisions(BasicTestEntity3.class, id1);
+ getAuditReader().getRevisions(BasicTestEntity3.class, id1);
}
@Test(expectedExceptions = NotAuditedException.class)
public void testHistoryOfId1() {
- getVersionsReader().find(BasicTestEntity3.class, id1, 1);
+ getAuditReader().find(BasicTestEntity3.class, id1, 1);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NullProperties.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NullProperties.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/NullProperties.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -73,9 +73,9 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
- assert Arrays.asList(2, 4).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
+ assert Arrays.asList(2, 4).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
}
@Test
@@ -83,10 +83,10 @@
BasicTestEntity1 ver1 = new BasicTestEntity1(id1, "x", 1);
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, null, 1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
}
@Test
@@ -94,9 +94,9 @@
BasicTestEntity1 ver1 = new BasicTestEntity1(id2, null, 20);
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y2", 20);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 1) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 4).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 1) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 4).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Simple.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Simple.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/Simple.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -60,7 +60,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(IntTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IntTestEntity.class, id1));
}
@Test
@@ -68,7 +68,7 @@
IntTestEntity ver1 = new IntTestEntity(10, id1);
IntTestEntity ver2 = new IntTestEntity(20, id1);
- assert getVersionsReader().find(IntTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(IntTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(IntTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(IntTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/SingleOperationInTransaction.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -79,29 +79,29 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 4, 6).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id1));
+ assert Arrays.asList(1, 4, 6).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id1));
- assert Arrays.asList(2, 5, 7).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id2));
+ assert Arrays.asList(2, 5, 7).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id2));
- assert Arrays.asList(3).equals(getVersionsReader().getRevisions(BasicTestEntity1.class, id3));
+ assert Arrays.asList(3).equals(getAuditReader().getRevisions(BasicTestEntity1.class, id3));
}
@Test
public void testRevisionsDates() {
for (int i=1; i<7; i++) {
- assert getVersionsReader().getRevisionDate(i).getTime() <=
- getVersionsReader().getRevisionDate(i+1).getTime();
+ assert getAuditReader().getRevisionDate(i).getTime() <=
+ getAuditReader().getRevisionDate(i+1).getTime();
}
}
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testNotExistingRevision() {
- getVersionsReader().getRevisionDate(8);
+ getAuditReader().getRevisionDate(8);
}
@Test(expectedExceptions = IllegalArgumentException.class)
public void testIllegalRevision() {
- getVersionsReader().getRevisionDate(0);
+ getAuditReader().getRevisionDate(0);
}
@Test
@@ -110,13 +110,13 @@
BasicTestEntity1 ver2 = new BasicTestEntity1(id1, "x2", 2);
BasicTestEntity1 ver3 = new BasicTestEntity1(id1, "x3", 3);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 3).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 5).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 6).equals(ver3);
- assert getVersionsReader().find(BasicTestEntity1.class, id1, 7).equals(ver3);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 3).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 4).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 5).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 6).equals(ver3);
+ assert getAuditReader().find(BasicTestEntity1.class, id1, 7).equals(ver3);
}
@Test
@@ -125,36 +125,36 @@
BasicTestEntity1 ver2 = new BasicTestEntity1(id2, "y2", 20);
BasicTestEntity1 ver3 = new BasicTestEntity1(id2, "y3", 21);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 1) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 4).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 5).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 6).equals(ver2);
- assert getVersionsReader().find(BasicTestEntity1.class, id2, 7).equals(ver3);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 1) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 2).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 3).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 4).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 5).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 6).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity1.class, id2, 7).equals(ver3);
}
@Test
public void testHistoryOfId3() {
BasicTestEntity1 ver1 = new BasicTestEntity1(id3, "z", 30);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 1) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 2) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 3).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 4).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 5).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 6).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity1.class, id3, 7).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 1) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 2) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 3).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 4).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 5).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 6).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity1.class, id3, 7).equals(ver1);
}
@Test
public void testHistoryOfNotExistingEntity() {
- assert getVersionsReader().find(BasicTestEntity1.class, id1+id2+id3, 1) == null;
- assert getVersionsReader().find(BasicTestEntity1.class, id1+id2+id3, 7) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id1+id2+id3, 1) == null;
+ assert getAuditReader().find(BasicTestEntity1.class, id1+id2+id3, 7) == null;
}
@Test
public void testRevisionsOfNotExistingEntity() {
- assert getVersionsReader().getRevisions(BasicTestEntity1.class, id1+id2+id3).size() == 0;
+ assert getAuditReader().getRevisions(BasicTestEntity1.class, id1+id2+id3).size() == 0;
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedPropertiesChange.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -71,7 +71,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BasicTestEntity2.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BasicTestEntity2.class, id1));
}
@Test
@@ -79,7 +79,7 @@
BasicTestEntity2 ver1 = new BasicTestEntity2(id1, "x", null);
BasicTestEntity2 ver2 = new BasicTestEntity2(id1, "y", null);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(BasicTestEntity2.class, id1, 2).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/basic/UnversionedProperty.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -64,7 +64,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UnversionedEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UnversionedEntity.class, id1));
}
@Test
@@ -72,7 +72,7 @@
UnversionedEntity rev1 = new UnversionedEntity(id1, "a1", null);
UnversionedEntity rev2 = new UnversionedEntity(id1, "a2", null);
- assert getVersionsReader().find(UnversionedEntity.class, id1, 1).equals(rev1);
- assert getVersionsReader().find(UnversionedEntity.class, id1, 2).equals(rev2);
+ assert getAuditReader().find(UnversionedEntity.class, id1, 1).equals(rev1);
+ assert getAuditReader().find(UnversionedEntity.class, id1, 2).equals(rev2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToManyCache.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -96,10 +96,10 @@
@Test
public void testCacheReferenceAccessAfterFind() {
- SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+ SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
- SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
- SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
+ SetRefIngEntity ing1_rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity ing2_rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
// It should be exactly the same object
assert ing1_rev1.getReference() == ed1_rev1;
@@ -108,7 +108,7 @@
@Test
public void testCacheReferenceAccessAfterCollectionAccessRev1() {
- SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+ SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
// It should be exactly the same object
assert ed1_rev1.getReffering().size() == 2;
@@ -119,7 +119,7 @@
@Test
public void testCacheReferenceAccessAfterCollectionAccessRev2() {
- SetRefEdEntity ed2_rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
+ SetRefEdEntity ed2_rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
assert ed2_rev2.getReffering().size() == 2;
for (SetRefIngEntity setRefIngEntity : ed2_rev2.getReffering()) {
@@ -129,13 +129,13 @@
@Test
public void testCacheFindAfterCollectionAccessRev1() {
- SetRefEdEntity ed1_rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
+ SetRefEdEntity ed1_rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
// Reading the collection
assert ed1_rev1.getReffering().size() == 2;
- SetRefIngEntity ing1_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
- SetRefIngEntity ing2_rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
+ SetRefIngEntity ing1_rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity ing2_rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
for (SetRefIngEntity setRefIngEntity : ed1_rev1.getReffering()) {
assert setRefIngEntity == ing1_rev1 || setRefIngEntity == ing2_rev1;
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/OneToOneCache.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -88,16 +88,16 @@
@Test
public void testCacheReferenceAccessAfterFindRev1() {
- BiRefEdEntity ed1_rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
- BiRefIngEntity ing1_rev1 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 1);
+ BiRefEdEntity ed1_rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
+ BiRefIngEntity ing1_rev1 = getAuditReader().find(BiRefIngEntity.class, ing1_id, 1);
assert ing1_rev1.getReference() == ed1_rev1;
}
@Test
public void testCacheReferenceAccessAfterFindRev2() {
- BiRefEdEntity ed2_rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
- BiRefIngEntity ing1_rev2 = getVersionsReader().find(BiRefIngEntity.class, ing1_id, 2);
+ BiRefEdEntity ed2_rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
+ BiRefIngEntity ing1_rev2 = getAuditReader().find(BiRefIngEntity.class, ing1_id, 2);
assert ing1_rev2.getReference() == ed2_rev2;
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/QueryCache.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/QueryCache.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/cache/QueryCache.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -63,12 +63,12 @@
@Test
public void testCacheFindAfterRevisionsOfEntityQuery() {
- List entsFromQuery = getVersionsReader().createQuery()
+ List entsFromQuery = getAuditReader().createQuery()
.forRevisionsOfEntity(IntTestEntity.class, true, false)
.getResultList();
- IntTestEntity entFromFindRev1 = getVersionsReader().find(IntTestEntity.class, id1, 1);
- IntTestEntity entFromFindRev2 = getVersionsReader().find(IntTestEntity.class, id1, 2);
+ IntTestEntity entFromFindRev1 = getAuditReader().find(IntTestEntity.class, id1, 1);
+ IntTestEntity entFromFindRev2 = getAuditReader().find(IntTestEntity.class, id1, 2);
assert entFromFindRev1 == entsFromQuery.get(0);
assert entFromFindRev2 == entsFromQuery.get(1);
@@ -76,11 +76,11 @@
@Test
public void testCacheFindAfterEntitiesAtRevisionQuery() {
- IntTestEntity entFromQuery = (IntTestEntity) getVersionsReader().createQuery()
+ IntTestEntity entFromQuery = (IntTestEntity) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.getSingleResult();
- IntTestEntity entFromFind = getVersionsReader().find(IntTestEntity.class, id1, 1);
+ IntTestEntity entFromFind = getAuditReader().find(IntTestEntity.class, id1, 1);
assert entFromFind == entFromQuery;
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/EnumSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/EnumSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/EnumSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -89,14 +89,14 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(EnumSetEntity.class, sse1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(EnumSetEntity.class, sse1_id));
}
@Test
public void testHistoryOfSse1() {
- EnumSetEntity rev1 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 1);
- EnumSetEntity rev2 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 2);
- EnumSetEntity rev3 = getVersionsReader().find(EnumSetEntity.class, sse1_id, 3);
+ EnumSetEntity rev1 = getAuditReader().find(EnumSetEntity.class, sse1_id, 1);
+ EnumSetEntity rev2 = getAuditReader().find(EnumSetEntity.class, sse1_id, 2);
+ EnumSetEntity rev3 = getAuditReader().find(EnumSetEntity.class, sse1_id, 3);
assert rev1.getEnums1().equals(TestTools.makeSet(E1.X));
assert rev2.getEnums1().equals(TestTools.makeSet(E1.X, E1.Y));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringList.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringList.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringList.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -97,15 +97,15 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringListEntity.class, sle1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringListEntity.class, sle2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringListEntity.class, sle1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringListEntity.class, sle2_id));
}
@Test
public void testHistoryOfSle1() {
- StringListEntity rev1 = getVersionsReader().find(StringListEntity.class, sle1_id, 1);
- StringListEntity rev2 = getVersionsReader().find(StringListEntity.class, sle1_id, 2);
- StringListEntity rev3 = getVersionsReader().find(StringListEntity.class, sle1_id, 3);
+ StringListEntity rev1 = getAuditReader().find(StringListEntity.class, sle1_id, 1);
+ StringListEntity rev2 = getAuditReader().find(StringListEntity.class, sle1_id, 2);
+ StringListEntity rev3 = getAuditReader().find(StringListEntity.class, sle1_id, 3);
assert rev1.getStrings().equals(Collections.EMPTY_LIST);
assert rev2.getStrings().equals(TestTools.makeList("sle1_string1", "sle1_string2"));
@@ -114,9 +114,9 @@
@Test
public void testHistoryOfSse2() {
- StringListEntity rev1 = getVersionsReader().find(StringListEntity.class, sle2_id, 1);
- StringListEntity rev2 = getVersionsReader().find(StringListEntity.class, sle2_id, 2);
- StringListEntity rev3 = getVersionsReader().find(StringListEntity.class, sle2_id, 3);
+ StringListEntity rev1 = getAuditReader().find(StringListEntity.class, sle2_id, 1);
+ StringListEntity rev2 = getAuditReader().find(StringListEntity.class, sle2_id, 2);
+ StringListEntity rev3 = getAuditReader().find(StringListEntity.class, sle2_id, 3);
assert rev1.getStrings().equals(TestTools.makeList("sle2_string1", "sle2_string2"));
assert rev2.getStrings().equals(TestTools.makeList("sle2_string1", "sle2_string2", "sle2_string1"));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringMap.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringMap.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringMap.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -104,16 +104,16 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(StringMapEntity.class, sme1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(StringMapEntity.class, sme2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(StringMapEntity.class, sme1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(StringMapEntity.class, sme2_id));
}
@Test
public void testHistoryOfSse1() {
- StringMapEntity rev1 = getVersionsReader().find(StringMapEntity.class, sme1_id, 1);
- StringMapEntity rev2 = getVersionsReader().find(StringMapEntity.class, sme1_id, 2);
- StringMapEntity rev3 = getVersionsReader().find(StringMapEntity.class, sme1_id, 3);
- StringMapEntity rev4 = getVersionsReader().find(StringMapEntity.class, sme1_id, 4);
+ StringMapEntity rev1 = getAuditReader().find(StringMapEntity.class, sme1_id, 1);
+ StringMapEntity rev2 = getAuditReader().find(StringMapEntity.class, sme1_id, 2);
+ StringMapEntity rev3 = getAuditReader().find(StringMapEntity.class, sme1_id, 3);
+ StringMapEntity rev4 = getAuditReader().find(StringMapEntity.class, sme1_id, 4);
assert rev1.getStrings().equals(Collections.EMPTY_MAP);
assert rev2.getStrings().equals(TestTools.makeMap("1", "a", "2", "b"));
@@ -123,10 +123,10 @@
@Test
public void testHistoryOfSse2() {
- StringMapEntity rev1 = getVersionsReader().find(StringMapEntity.class, sme2_id, 1);
- StringMapEntity rev2 = getVersionsReader().find(StringMapEntity.class, sme2_id, 2);
- StringMapEntity rev3 = getVersionsReader().find(StringMapEntity.class, sme2_id, 3);
- StringMapEntity rev4 = getVersionsReader().find(StringMapEntity.class, sme2_id, 4);
+ StringMapEntity rev1 = getAuditReader().find(StringMapEntity.class, sme2_id, 1);
+ StringMapEntity rev2 = getAuditReader().find(StringMapEntity.class, sme2_id, 2);
+ StringMapEntity rev3 = getAuditReader().find(StringMapEntity.class, sme2_id, 3);
+ StringMapEntity rev4 = getAuditReader().find(StringMapEntity.class, sme2_id, 4);
assert rev1.getStrings().equals(TestTools.makeMap("1", "a"));
assert rev2.getStrings().equals(TestTools.makeMap("1", "a"));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/StringSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -96,15 +96,15 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StringSetEntity.class, sse1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(StringSetEntity.class, sse2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StringSetEntity.class, sse1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(StringSetEntity.class, sse2_id));
}
@Test
public void testHistoryOfSse1() {
- StringSetEntity rev1 = getVersionsReader().find(StringSetEntity.class, sse1_id, 1);
- StringSetEntity rev2 = getVersionsReader().find(StringSetEntity.class, sse1_id, 2);
- StringSetEntity rev3 = getVersionsReader().find(StringSetEntity.class, sse1_id, 3);
+ StringSetEntity rev1 = getAuditReader().find(StringSetEntity.class, sse1_id, 1);
+ StringSetEntity rev2 = getAuditReader().find(StringSetEntity.class, sse1_id, 2);
+ StringSetEntity rev3 = getAuditReader().find(StringSetEntity.class, sse1_id, 3);
assert rev1.getStrings().equals(Collections.EMPTY_SET);
assert rev2.getStrings().equals(TestTools.makeSet("sse1_string1", "sse1_string2"));
@@ -113,9 +113,9 @@
@Test
public void testHistoryOfSse2() {
- StringSetEntity rev1 = getVersionsReader().find(StringSetEntity.class, sse2_id, 1);
- StringSetEntity rev2 = getVersionsReader().find(StringSetEntity.class, sse2_id, 2);
- StringSetEntity rev3 = getVersionsReader().find(StringSetEntity.class, sse2_id, 3);
+ StringSetEntity rev1 = getAuditReader().find(StringSetEntity.class, sse2_id, 1);
+ StringSetEntity rev2 = getAuditReader().find(StringSetEntity.class, sse2_id, 2);
+ StringSetEntity rev3 = getAuditReader().find(StringSetEntity.class, sse2_id, 3);
assert rev1.getStrings().equals(TestTools.makeSet("sse2_string1", "sse2_string2"));
assert rev2.getStrings().equals(TestTools.makeSet("sse2_string1", "sse2_string2"));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/ComponentMapKey.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -91,7 +91,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ComponentMapKeyEntity.class, cmke_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ComponentMapKeyEntity.class, cmke_id));
}
@Test
@@ -103,8 +103,8 @@
cte1.setComp2(null);
cte2.setComp2(null);
- ComponentMapKeyEntity rev1 = getVersionsReader().find(ComponentMapKeyEntity.class, cmke_id, 1);
- ComponentMapKeyEntity rev2 = getVersionsReader().find(ComponentMapKeyEntity.class, cmke_id, 2);
+ ComponentMapKeyEntity rev1 = getAuditReader().find(ComponentMapKeyEntity.class, cmke_id, 1);
+ ComponentMapKeyEntity rev2 = getAuditReader().find(ComponentMapKeyEntity.class, cmke_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap(cte1.getComp1(), cte1));
assert rev2.getIdmap().equals(TestTools.makeMap(cte1.getComp1(), cte1, cte2.getComp1(), cte2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/collection/mapkey/IdMapKey.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -89,7 +89,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(IdMapKeyEntity.class, imke_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(IdMapKeyEntity.class, imke_id));
}
@Test
@@ -97,8 +97,8 @@
StrTestEntity ste1 = getEntityManager().find(StrTestEntity.class, ste1_id);
StrTestEntity ste2 = getEntityManager().find(StrTestEntity.class, ste2_id);
- IdMapKeyEntity rev1 = getVersionsReader().find(IdMapKeyEntity.class, imke_id, 1);
- IdMapKeyEntity rev2 = getVersionsReader().find(IdMapKeyEntity.class, imke_id, 2);
+ IdMapKeyEntity rev1 = getAuditReader().find(IdMapKeyEntity.class, imke_id, 1);
+ IdMapKeyEntity rev2 = getAuditReader().find(IdMapKeyEntity.class, imke_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap(ste1.getId(), ste1));
assert rev2.getIdmap().equals(TestTools.makeMap(ste1.getId(), ste1, ste2.getId(), ste2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/components/Components.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/components/Components.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/components/Components.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -107,11 +107,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id1));
- assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id2));
+ assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id2));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ComponentTestEntity.class, id3));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ComponentTestEntity.class, id3));
}
@Test
@@ -119,10 +119,10 @@
ComponentTestEntity ver1 = new ComponentTestEntity(id1, new Component1("a", "b"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id1, new Component1("a'", "b'"), null);
- assert getVersionsReader().find(ComponentTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(ComponentTestEntity.class, id1, 2).equals(ver2);
- assert getVersionsReader().find(ComponentTestEntity.class, id1, 3).equals(ver2);
- assert getVersionsReader().find(ComponentTestEntity.class, id1, 4).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(ComponentTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id1, 4).equals(ver2);
}
@Test
@@ -130,10 +130,10 @@
ComponentTestEntity ver1 = new ComponentTestEntity(id2, new Component1("a2", "b2"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id2, new Component1("a2'", "b2"), null);
- assert getVersionsReader().find(ComponentTestEntity.class, id2, 1).equals(ver1);
- assert getVersionsReader().find(ComponentTestEntity.class, id2, 2).equals(ver2);
- assert getVersionsReader().find(ComponentTestEntity.class, id2, 3).equals(ver2);
- assert getVersionsReader().find(ComponentTestEntity.class, id2, 4) == null;
+ assert getAuditReader().find(ComponentTestEntity.class, id2, 1).equals(ver1);
+ assert getAuditReader().find(ComponentTestEntity.class, id2, 2).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id2, 3).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id2, 4) == null;
}
@Test
@@ -141,9 +141,9 @@
ComponentTestEntity ver1 = new ComponentTestEntity(id3, new Component1("a3", "b3"), null);
ComponentTestEntity ver2 = new ComponentTestEntity(id3, new Component1("a3", "b3'"), null);
- assert getVersionsReader().find(ComponentTestEntity.class, id3, 1).equals(ver1);
- assert getVersionsReader().find(ComponentTestEntity.class, id3, 2).equals(ver1);
- assert getVersionsReader().find(ComponentTestEntity.class, id3, 3).equals(ver2);
- assert getVersionsReader().find(ComponentTestEntity.class, id3, 4).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id3, 1).equals(ver1);
+ assert getAuditReader().find(ComponentTestEntity.class, id3, 2).equals(ver1);
+ assert getAuditReader().find(ComponentTestEntity.class, id3, 3).equals(ver2);
+ assert getAuditReader().find(ComponentTestEntity.class, id3, 4).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/CompositeCustom.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -84,14 +84,14 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CompositeCustomTypeEntity.class, ccte_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CompositeCustomTypeEntity.class, ccte_id));
}
@Test
public void testHistoryOfCcte() {
- CompositeCustomTypeEntity rev1 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 1);
- CompositeCustomTypeEntity rev2 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 2);
- CompositeCustomTypeEntity rev3 = getVersionsReader().find(CompositeCustomTypeEntity.class, ccte_id, 3);
+ CompositeCustomTypeEntity rev1 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 1);
+ CompositeCustomTypeEntity rev2 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 2);
+ CompositeCustomTypeEntity rev3 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 3);
assert rev1.getComponent().equals(new Component("a", 1));
assert rev2.getComponent().equals(new Component("b", 1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/customtype/ParametrizedCustom.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -74,13 +74,13 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ParametrizedCustomTypeEntity.class, pcte_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ParametrizedCustomTypeEntity.class, pcte_id));
}
@Test
public void testHistoryOfCcte() {
- ParametrizedCustomTypeEntity rev1 = getVersionsReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
- ParametrizedCustomTypeEntity rev2 = getVersionsReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);
+ ParametrizedCustomTypeEntity rev1 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
+ ParametrizedCustomTypeEntity rev2 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);
assert "xUy".equals(rev1.getStr());
assert "xVy".equals(rev2.getStr());
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Dates.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Dates.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Dates.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -60,7 +60,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(DateTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DateTestEntity.class, id1));
}
@Test
@@ -68,7 +68,7 @@
DateTestEntity ver1 = new DateTestEntity(id1, new Date(12345000));
DateTestEntity ver2 = new DateTestEntity(id1, new Date(45678000));
- assert getVersionsReader().find(DateTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(DateTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(DateTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(DateTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Enums.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Enums.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Enums.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -62,7 +62,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(EnumTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(EnumTestEntity.class, id1));
}
@Test
@@ -70,7 +70,7 @@
EnumTestEntity ver1 = new EnumTestEntity(id1, EnumTestEntity.E1.X, EnumTestEntity.E2.A);
EnumTestEntity ver2 = new EnumTestEntity(id1, EnumTestEntity.E1.Y, EnumTestEntity.E2.B);
- assert getVersionsReader().find(EnumTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(EnumTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(EnumTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(EnumTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Lobs.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -61,7 +61,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(LobTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(LobTestEntity.class, id1));
}
@Test
@@ -69,7 +69,7 @@
LobTestEntity ver1 = new LobTestEntity(id1, "abc", new byte[] { 0, 1, 2 }, new char[] { 'x', 'y', 'z' });
LobTestEntity ver2 = new LobTestEntity(id1, "def", new byte[] { 3, 4, 5 }, new char[] { 'h', 'i', 'j' });
- assert getVersionsReader().find(LobTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(LobTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(LobTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(LobTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Serializables.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Serializables.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/data/Serializables.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -59,7 +59,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SerializableTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SerializableTestEntity.class, id1));
}
@Test
@@ -67,7 +67,7 @@
SerializableTestEntity ver1 = new SerializableTestEntity(id1, new SerObject("d1"));
SerializableTestEntity ver2 = new SerializableTestEntity(id1, new SerObject("d2"));
- assert getVersionsReader().find(SerializableTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(SerializableTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(SerializableTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(SerializableTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddDel.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddDel.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddDel.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -66,11 +66,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList().equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList().equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
public void testHistoryOfId() {
- assert getVersionsReader().find(StrTestEntity.class, id, 1) == null;
+ assert getAuditReader().find(StrTestEntity.class, id, 1) == null;
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddMod.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddMod.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushAddMod.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -76,7 +76,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -84,7 +84,7 @@
StrTestEntity ver1 = new StrTestEntity("y", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModDel.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModDel.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModDel.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -73,14 +73,14 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
public void testHistoryOfId() {
StrTestEntity ver1 = new StrTestEntity("x", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2) == null;
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2) == null;
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModMod.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModMod.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/DoubleFlushModMod.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -73,7 +73,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -81,7 +81,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/ManualFlush.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/ManualFlush.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/flush/ManualFlush.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -80,7 +80,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -88,8 +88,8 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("z", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
@Test
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -119,13 +119,13 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, id1));
+ assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, id1));
- assert Arrays.asList(2, 3, 4, 5).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, id2));
+ assert Arrays.asList(2, 3, 4, 5).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, id2));
- assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, id3));
+ assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id3));
- assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, id4));
+ assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id4));
}
@Test
@@ -133,11 +133,11 @@
EmbIdTestEntity ver1 = new EmbIdTestEntity(id1, "x");
EmbIdTestEntity ver2 = new EmbIdTestEntity(id1, "x2");
- assert getVersionsReader().find(EmbIdTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(EmbIdTestEntity.class, id1, 2).equals(ver1);
- assert getVersionsReader().find(EmbIdTestEntity.class, id1, 3).equals(ver2);
- assert getVersionsReader().find(EmbIdTestEntity.class, id1, 4) == null;
- assert getVersionsReader().find(EmbIdTestEntity.class, id1, 5) == null;
+ assert getAuditReader().find(EmbIdTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(EmbIdTestEntity.class, id1, 2).equals(ver1);
+ assert getAuditReader().find(EmbIdTestEntity.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(EmbIdTestEntity.class, id1, 4) == null;
+ assert getAuditReader().find(EmbIdTestEntity.class, id1, 5) == null;
}
@Test
@@ -146,11 +146,11 @@
EmbIdTestEntity ver2 = new EmbIdTestEntity(id2, "y2");
EmbIdTestEntity ver3 = new EmbIdTestEntity(id2, "y3");
- assert getVersionsReader().find(EmbIdTestEntity.class, id2, 1) == null;
- assert getVersionsReader().find(EmbIdTestEntity.class, id2, 2).equals(ver1);
- assert getVersionsReader().find(EmbIdTestEntity.class, id2, 3).equals(ver2);
- assert getVersionsReader().find(EmbIdTestEntity.class, id2, 4).equals(ver3);
- assert getVersionsReader().find(EmbIdTestEntity.class, id2, 5) == null;
+ assert getAuditReader().find(EmbIdTestEntity.class, id2, 1) == null;
+ assert getAuditReader().find(EmbIdTestEntity.class, id2, 2).equals(ver1);
+ assert getAuditReader().find(EmbIdTestEntity.class, id2, 3).equals(ver2);
+ assert getAuditReader().find(EmbIdTestEntity.class, id2, 4).equals(ver3);
+ assert getAuditReader().find(EmbIdTestEntity.class, id2, 5) == null;
}
@Test
@@ -158,11 +158,11 @@
MulIdTestEntity ver1 = new MulIdTestEntity(id3.getId1(), id3.getId2(), "a");
MulIdTestEntity ver2 = new MulIdTestEntity(id3.getId1(), id3.getId2(), "a2");
- assert getVersionsReader().find(MulIdTestEntity.class, id3, 1).equals(ver1);
- assert getVersionsReader().find(MulIdTestEntity.class, id3, 2).equals(ver1);
- assert getVersionsReader().find(MulIdTestEntity.class, id3, 3).equals(ver2);
- assert getVersionsReader().find(MulIdTestEntity.class, id3, 4) == null;
- assert getVersionsReader().find(MulIdTestEntity.class, id3, 5) == null;
+ assert getAuditReader().find(MulIdTestEntity.class, id3, 1).equals(ver1);
+ assert getAuditReader().find(MulIdTestEntity.class, id3, 2).equals(ver1);
+ assert getAuditReader().find(MulIdTestEntity.class, id3, 3).equals(ver2);
+ assert getAuditReader().find(MulIdTestEntity.class, id3, 4) == null;
+ assert getAuditReader().find(MulIdTestEntity.class, id3, 5) == null;
}
@Test
@@ -170,10 +170,10 @@
MulIdTestEntity ver1 = new MulIdTestEntity(id4.getId1(), id4.getId2(), "b");
MulIdTestEntity ver2 = new MulIdTestEntity(id4.getId1(), id4.getId2(), "b2");
- assert getVersionsReader().find(MulIdTestEntity.class, id4, 1) == null;
- assert getVersionsReader().find(MulIdTestEntity.class, id4, 2).equals(ver1);
- assert getVersionsReader().find(MulIdTestEntity.class, id4, 3).equals(ver2);
- assert getVersionsReader().find(MulIdTestEntity.class, id4, 4).equals(ver2);
- assert getVersionsReader().find(MulIdTestEntity.class, id4, 5).equals(ver2);
+ assert getAuditReader().find(MulIdTestEntity.class, id4, 1) == null;
+ assert getAuditReader().find(MulIdTestEntity.class, id4, 2).equals(ver1);
+ assert getAuditReader().find(MulIdTestEntity.class, id4, 3).equals(ver2);
+ assert getAuditReader().find(MulIdTestEntity.class, id4, 4).equals(ver2);
+ assert getAuditReader().find(MulIdTestEntity.class, id4, 5).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ChildVersioning.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ChildVersioning.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ChildVersioning.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -64,7 +64,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ChildEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ChildEntity.class, id1));
}
@Test
@@ -72,21 +72,21 @@
ChildEntity ver1 = new ChildEntity(id1, "x", 1l);
ChildEntity ver2 = new ChildEntity(id1, "y", 2l);
- assert getVersionsReader().find(ChildEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(ChildEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(ChildEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(ChildEntity.class, id1, 2).equals(ver2);
- assert getVersionsReader().find(ParentEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(ParentEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(ParentEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(ParentEntity.class, id1, 2).equals(ver2);
}
@Test
public void testPolymorphicQuery() {
ChildEntity childVer1 = new ChildEntity(id1, "x", 1l);
- assert getVersionsReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1).getSingleResult()
+ assert getAuditReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1).getSingleResult()
.equals(childVer1);
- assert getVersionsReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
+ assert getAuditReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
.equals(childVer1);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ParentVersioning.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ParentVersioning.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/ParentVersioning.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -63,13 +63,13 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ParentEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ParentEntity.class, id1));
}
@Test
public void testHistoryOfChildId1() {
- assert getVersionsReader().find(ChildEntity.class, id1, 1) == null;
- assert getVersionsReader().find(ChildEntity.class, id1, 2) == null;
+ assert getAuditReader().find(ChildEntity.class, id1, 1) == null;
+ assert getAuditReader().find(ChildEntity.class, id1, 2) == null;
}
@Test
@@ -77,17 +77,17 @@
ParentEntity ver1 = new ParentEntity(id1, "x");
ParentEntity ver2 = new ParentEntity(id1, "y");
- assert getVersionsReader().find(ParentEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(ParentEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(ParentEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(ParentEntity.class, id1, 2).equals(ver2);
}
@Test
public void testPolymorphicQuery() {
ParentEntity parentVer1 = new ParentEntity(id1, "x");
- assert getVersionsReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
+ assert getAuditReader().createQuery().forEntitiesAtRevision(ParentEntity.class, 1).getSingleResult()
.equals(parentVer1);
- assert getVersionsReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1)
+ assert getAuditReader().createQuery().forEntitiesAtRevision(ChildEntity.class, 1)
.getResultList().size() == 0;
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/childrelation/ChildReferencing.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -89,33 +89,33 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, re_id1));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, re_id2));
- assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(ChildIngEntity.class, c_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, re_id1));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, re_id2));
+ assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(ChildIngEntity.class, c_id));
}
@Test
public void testHistoryOfReferencedCollection1() {
- assert getVersionsReader().find(ReferencedEntity.class, re_id1, 1).getReferencing().size() == 0;
- assert getVersionsReader().find(ReferencedEntity.class, re_id1, 2).getReferencing().equals(
+ assert getAuditReader().find(ReferencedEntity.class, re_id1, 1).getReferencing().size() == 0;
+ assert getAuditReader().find(ReferencedEntity.class, re_id1, 2).getReferencing().equals(
TestTools.makeSet(new ChildIngEntity(c_id, "y", 1l)));
- assert getVersionsReader().find(ReferencedEntity.class, re_id1, 3).getReferencing().size() == 0;
+ assert getAuditReader().find(ReferencedEntity.class, re_id1, 3).getReferencing().size() == 0;
}
@Test
public void testHistoryOfReferencedCollection2() {
- assert getVersionsReader().find(ReferencedEntity.class, re_id2, 1).getReferencing().size() == 0;
- assert getVersionsReader().find(ReferencedEntity.class, re_id2, 2).getReferencing().size() == 0;
- assert getVersionsReader().find(ReferencedEntity.class, re_id2, 3).getReferencing().equals(
+ assert getAuditReader().find(ReferencedEntity.class, re_id2, 1).getReferencing().size() == 0;
+ assert getAuditReader().find(ReferencedEntity.class, re_id2, 2).getReferencing().size() == 0;
+ assert getAuditReader().find(ReferencedEntity.class, re_id2, 3).getReferencing().equals(
TestTools.makeSet(new ChildIngEntity(c_id, "y", 1l)));
}
@Test
public void testChildHistory() {
- assert getVersionsReader().find(ChildIngEntity.class, c_id, 1) == null;
- assert getVersionsReader().find(ChildIngEntity.class, c_id, 2).getReferenced().equals(
+ assert getAuditReader().find(ChildIngEntity.class, c_id, 1) == null;
+ assert getAuditReader().find(ChildIngEntity.class, c_id, 2).getReferenced().equals(
new ReferencedEntity(re_id1));
- assert getVersionsReader().find(ChildIngEntity.class, c_id, 3).getReferenced().equals(
+ assert getAuditReader().find(ChildIngEntity.class, c_id, 3).getReferenced().equals(
new ReferencedEntity(re_id2));
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/inheritance/single/relation/PolymorphicCollection.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -87,17 +87,17 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ReferencedEntity.class, ed_id1));
- assert Arrays.asList(2).equals(getVersionsReader().getRevisions(ParentIngEntity.class, p_id));
- assert Arrays.asList(3).equals(getVersionsReader().getRevisions(ChildIngEntity.class, c_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ReferencedEntity.class, ed_id1));
+ assert Arrays.asList(2).equals(getAuditReader().getRevisions(ParentIngEntity.class, p_id));
+ assert Arrays.asList(3).equals(getAuditReader().getRevisions(ChildIngEntity.class, c_id));
}
@Test
public void testHistoryOfReferencedCollection() {
- assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 1).getReferencing().size() == 0;
- assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 2).getReferencing().equals(
+ assert getAuditReader().find(ReferencedEntity.class, ed_id1, 1).getReferencing().size() == 0;
+ assert getAuditReader().find(ReferencedEntity.class, ed_id1, 2).getReferencing().equals(
TestTools.makeSet(new ParentIngEntity(p_id, "x")));
- assert getVersionsReader().find(ReferencedEntity.class, ed_id1, 3).getReferencing().equals(
+ assert getAuditReader().find(ReferencedEntity.class, ed_id1, 3).getReferencing().equals(
TestTools.makeSet(new ParentIngEntity(p_id, "x"), new ChildIngEntity(c_id, "y", 1l)));
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicList.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicList.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicList.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -132,11 +132,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(ListOwnedEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3, 5).equals(getVersionsReader().getRevisions(ListOwnedEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(ListOwnedEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3, 5).equals(getAuditReader().getRevisions(ListOwnedEntity.class, ed2_id));
- assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(ListOwningEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListOwningEntity.class, ing2_id));
+ assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(ListOwningEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListOwningEntity.class, ing2_id));
}
@Test
@@ -144,11 +144,11 @@
ListOwningEntity ing1 = getEntityManager().find(ListOwningEntity.class, ing1_id);
ListOwningEntity ing2 = getEntityManager().find(ListOwningEntity.class, ing2_id);
- ListOwnedEntity rev1 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 1);
- ListOwnedEntity rev2 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 2);
- ListOwnedEntity rev3 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 3);
- ListOwnedEntity rev4 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 4);
- ListOwnedEntity rev5 = getVersionsReader().find(ListOwnedEntity.class, ed1_id, 5);
+ ListOwnedEntity rev1 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 1);
+ ListOwnedEntity rev2 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 2);
+ ListOwnedEntity rev3 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 3);
+ ListOwnedEntity rev4 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 4);
+ ListOwnedEntity rev5 = getAuditReader().find(ListOwnedEntity.class, ed1_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferencing(), ing1, ing2);
@@ -162,11 +162,11 @@
ListOwningEntity ing1 = getEntityManager().find(ListOwningEntity.class, ing1_id);
ListOwningEntity ing2 = getEntityManager().find(ListOwningEntity.class, ing2_id);
- ListOwnedEntity rev1 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 1);
- ListOwnedEntity rev2 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 2);
- ListOwnedEntity rev3 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 3);
- ListOwnedEntity rev4 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 4);
- ListOwnedEntity rev5 = getVersionsReader().find(ListOwnedEntity.class, ed2_id, 5);
+ ListOwnedEntity rev1 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 1);
+ ListOwnedEntity rev2 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 2);
+ ListOwnedEntity rev3 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 3);
+ ListOwnedEntity rev4 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 4);
+ ListOwnedEntity rev5 = getAuditReader().find(ListOwnedEntity.class, ed2_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferencing(), ing2);
@@ -180,11 +180,11 @@
ListOwnedEntity ed1 = getEntityManager().find(ListOwnedEntity.class, ed1_id);
ListOwnedEntity ed2 = getEntityManager().find(ListOwnedEntity.class, ed2_id);
- ListOwningEntity rev1 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 1);
- ListOwningEntity rev2 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 2);
- ListOwningEntity rev3 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 3);
- ListOwningEntity rev4 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 4);
- ListOwningEntity rev5 = getVersionsReader().find(ListOwningEntity.class, ing1_id, 5);
+ ListOwningEntity rev1 = getAuditReader().find(ListOwningEntity.class, ing1_id, 1);
+ ListOwningEntity rev2 = getAuditReader().find(ListOwningEntity.class, ing1_id, 2);
+ ListOwningEntity rev3 = getAuditReader().find(ListOwningEntity.class, ing1_id, 3);
+ ListOwningEntity rev4 = getAuditReader().find(ListOwningEntity.class, ing1_id, 4);
+ ListOwningEntity rev5 = getAuditReader().find(ListOwningEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1);
@@ -198,11 +198,11 @@
ListOwnedEntity ed1 = getEntityManager().find(ListOwnedEntity.class, ed1_id);
ListOwnedEntity ed2 = getEntityManager().find(ListOwnedEntity.class, ed2_id);
- ListOwningEntity rev1 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 1);
- ListOwningEntity rev2 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 2);
- ListOwningEntity rev3 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 3);
- ListOwningEntity rev4 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 4);
- ListOwningEntity rev5 = getVersionsReader().find(ListOwningEntity.class, ing2_id, 5);
+ ListOwningEntity rev1 = getAuditReader().find(ListOwningEntity.class, ing2_id, 1);
+ ListOwningEntity rev2 = getAuditReader().find(ListOwningEntity.class, ing2_id, 2);
+ ListOwningEntity rev3 = getAuditReader().find(ListOwningEntity.class, ing2_id, 3);
+ ListOwningEntity rev4 = getAuditReader().find(ListOwningEntity.class, ing2_id, 4);
+ ListOwningEntity rev5 = getAuditReader().find(ListOwningEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1, ed2);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicMap.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -124,11 +124,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwnedEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwnedEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwnedEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwnedEntity.class, ed2_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwningEntity.class, ing1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(MapOwningEntity.class, ing2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwningEntity.class, ing1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(MapOwningEntity.class, ing2_id));
}
@Test
@@ -136,9 +136,9 @@
MapOwningEntity ing1 = getEntityManager().find(MapOwningEntity.class, ing1_id);
MapOwningEntity ing2 = getEntityManager().find(MapOwningEntity.class, ing2_id);
- MapOwnedEntity rev1 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 1);
- MapOwnedEntity rev2 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 2);
- MapOwnedEntity rev3 = getVersionsReader().find(MapOwnedEntity.class, ed1_id, 3);
+ MapOwnedEntity rev1 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 1);
+ MapOwnedEntity rev2 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 2);
+ MapOwnedEntity rev3 = getAuditReader().find(MapOwnedEntity.class, ed1_id, 3);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing1, ing2));
@@ -149,9 +149,9 @@
public void testHistoryOfEdId2() {
MapOwningEntity ing2 = getEntityManager().find(MapOwningEntity.class, ing2_id);
- MapOwnedEntity rev1 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 1);
- MapOwnedEntity rev2 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 2);
- MapOwnedEntity rev3 = getVersionsReader().find(MapOwnedEntity.class, ed2_id, 3);
+ MapOwnedEntity rev1 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 1);
+ MapOwnedEntity rev2 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 2);
+ MapOwnedEntity rev3 = getAuditReader().find(MapOwnedEntity.class, ed2_id, 3);
assert rev1.getReferencing().equals(TestTools.makeSet(ing2));
assert rev2.getReferencing().equals(Collections.EMPTY_SET);
@@ -162,9 +162,9 @@
public void testHistoryOfEdIng1() {
MapOwnedEntity ed1 = getEntityManager().find(MapOwnedEntity.class, ed1_id);
- MapOwningEntity rev1 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 1);
- MapOwningEntity rev2 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 2);
- MapOwningEntity rev3 = getVersionsReader().find(MapOwningEntity.class, ing1_id, 3);
+ MapOwningEntity rev1 = getAuditReader().find(MapOwningEntity.class, ing1_id, 1);
+ MapOwningEntity rev2 = getAuditReader().find(MapOwningEntity.class, ing1_id, 2);
+ MapOwningEntity rev3 = getAuditReader().find(MapOwningEntity.class, ing1_id, 3);
assert rev1.getReferences().equals(Collections.EMPTY_MAP);
assert rev2.getReferences().equals(TestTools.makeMap("1", ed1, "2", ed1));
@@ -176,9 +176,9 @@
MapOwnedEntity ed1 = getEntityManager().find(MapOwnedEntity.class, ed1_id);
MapOwnedEntity ed2 = getEntityManager().find(MapOwnedEntity.class, ed2_id);
- MapOwningEntity rev1 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 1);
- MapOwningEntity rev2 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 2);
- MapOwningEntity rev3 = getVersionsReader().find(MapOwningEntity.class, ing2_id, 3);
+ MapOwningEntity rev1 = getAuditReader().find(MapOwningEntity.class, ing2_id, 1);
+ MapOwningEntity rev2 = getAuditReader().find(MapOwningEntity.class, ing2_id, 2);
+ MapOwningEntity rev3 = getAuditReader().find(MapOwningEntity.class, ing2_id, 3);
assert rev1.getReferences().equals(TestTools.makeMap("2", ed2));
assert rev2.getReferences().equals(TestTools.makeMap("2", ed1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/BasicSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -132,11 +132,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(SetOwnedEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3, 5).equals(getVersionsReader().getRevisions(SetOwnedEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(SetOwnedEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3, 5).equals(getAuditReader().getRevisions(SetOwnedEntity.class, ed2_id));
- assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetOwningEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetOwningEntity.class, ing2_id));
+ assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetOwningEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetOwningEntity.class, ing2_id));
}
@Test
@@ -144,11 +144,11 @@
SetOwningEntity ing1 = getEntityManager().find(SetOwningEntity.class, ing1_id);
SetOwningEntity ing2 = getEntityManager().find(SetOwningEntity.class, ing2_id);
- SetOwnedEntity rev1 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 1);
- SetOwnedEntity rev2 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 2);
- SetOwnedEntity rev3 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 3);
- SetOwnedEntity rev4 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 4);
- SetOwnedEntity rev5 = getVersionsReader().find(SetOwnedEntity.class, ed1_id, 5);
+ SetOwnedEntity rev1 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 1);
+ SetOwnedEntity rev2 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 2);
+ SetOwnedEntity rev3 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 3);
+ SetOwnedEntity rev4 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 4);
+ SetOwnedEntity rev5 = getAuditReader().find(SetOwnedEntity.class, ed1_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing1, ing2));
@@ -162,11 +162,11 @@
SetOwningEntity ing1 = getEntityManager().find(SetOwningEntity.class, ing1_id);
SetOwningEntity ing2 = getEntityManager().find(SetOwningEntity.class, ing2_id);
- SetOwnedEntity rev1 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 1);
- SetOwnedEntity rev2 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 2);
- SetOwnedEntity rev3 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 3);
- SetOwnedEntity rev4 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 4);
- SetOwnedEntity rev5 = getVersionsReader().find(SetOwnedEntity.class, ed2_id, 5);
+ SetOwnedEntity rev1 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 1);
+ SetOwnedEntity rev2 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 2);
+ SetOwnedEntity rev3 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 3);
+ SetOwnedEntity rev4 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 4);
+ SetOwnedEntity rev5 = getAuditReader().find(SetOwnedEntity.class, ed2_id, 5);
assert rev1.getReferencing().equals(Collections.EMPTY_SET);
assert rev2.getReferencing().equals(TestTools.makeSet(ing2));
@@ -180,11 +180,11 @@
SetOwnedEntity ed1 = getEntityManager().find(SetOwnedEntity.class, ed1_id);
SetOwnedEntity ed2 = getEntityManager().find(SetOwnedEntity.class, ed2_id);
- SetOwningEntity rev1 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 1);
- SetOwningEntity rev2 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 2);
- SetOwningEntity rev3 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 3);
- SetOwningEntity rev4 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 4);
- SetOwningEntity rev5 = getVersionsReader().find(SetOwningEntity.class, ing1_id, 5);
+ SetOwningEntity rev1 = getAuditReader().find(SetOwningEntity.class, ing1_id, 1);
+ SetOwningEntity rev2 = getAuditReader().find(SetOwningEntity.class, ing1_id, 2);
+ SetOwningEntity rev3 = getAuditReader().find(SetOwningEntity.class, ing1_id, 3);
+ SetOwningEntity rev4 = getAuditReader().find(SetOwningEntity.class, ing1_id, 4);
+ SetOwningEntity rev5 = getAuditReader().find(SetOwningEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1));
@@ -198,11 +198,11 @@
SetOwnedEntity ed1 = getEntityManager().find(SetOwnedEntity.class, ed1_id);
SetOwnedEntity ed2 = getEntityManager().find(SetOwnedEntity.class, ed2_id);
- SetOwningEntity rev1 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 1);
- SetOwningEntity rev2 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 2);
- SetOwningEntity rev3 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 3);
- SetOwningEntity rev4 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 4);
- SetOwningEntity rev5 = getVersionsReader().find(SetOwningEntity.class, ing2_id, 5);
+ SetOwningEntity rev1 = getAuditReader().find(SetOwningEntity.class, ing2_id, 1);
+ SetOwningEntity rev2 = getAuditReader().find(SetOwningEntity.class, ing2_id, 2);
+ SetOwningEntity rev3 = getAuditReader().find(SetOwningEntity.class, ing2_id, 3);
+ SetOwningEntity rev4 = getAuditReader().find(SetOwningEntity.class, ing2_id, 4);
+ SetOwningEntity rev5 = getAuditReader().find(SetOwningEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1, ed2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMap.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -150,14 +150,14 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 4).equals(getVersionsReader().getRevisions(TernaryMapEntity.class, map1_id));
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(TernaryMapEntity.class, map2_id));
+ assert Arrays.asList(1, 2, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(TernaryMapEntity.class, map2_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(IntTestEntity.class, int1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(IntTestEntity.class, int2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(IntTestEntity.class, int2_id));
}
@Test
@@ -168,10 +168,10 @@
IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id);
IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id);
- TernaryMapEntity rev1 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 1);
- TernaryMapEntity rev2 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 2);
- TernaryMapEntity rev3 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 3);
- TernaryMapEntity rev4 = getVersionsReader().find(TernaryMapEntity.class, map1_id, 4);
+ TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map1_id, 1);
+ TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map1_id, 2);
+ TernaryMapEntity rev3 = getAuditReader().find(TernaryMapEntity.class, map1_id, 3);
+ TernaryMapEntity rev4 = getAuditReader().find(TernaryMapEntity.class, map1_id, 4);
assert rev1.getMap().equals(TestTools.makeMap(int1, str1));
assert rev2.getMap().equals(TestTools.makeMap(int1, str2));
@@ -187,10 +187,10 @@
IntTestEntity int1 = getEntityManager().find(IntTestEntity.class, int1_id);
IntTestEntity int2 = getEntityManager().find(IntTestEntity.class, int2_id);
- TernaryMapEntity rev1 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 1);
- TernaryMapEntity rev2 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 2);
- TernaryMapEntity rev3 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 3);
- TernaryMapEntity rev4 = getVersionsReader().find(TernaryMapEntity.class, map2_id, 4);
+ TernaryMapEntity rev1 = getAuditReader().find(TernaryMapEntity.class, map2_id, 1);
+ TernaryMapEntity rev2 = getAuditReader().find(TernaryMapEntity.class, map2_id, 2);
+ TernaryMapEntity rev3 = getAuditReader().find(TernaryMapEntity.class, map2_id, 3);
+ TernaryMapEntity rev4 = getAuditReader().find(TernaryMapEntity.class, map2_id, 4);
assert rev1.getMap().equals(TestTools.makeMap());
assert rev2.getMap().equals(TestTools.makeMap(int1, str1, int2, str1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniList.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -132,11 +132,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed2_id));
- assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(ListUniEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListUniEntity.class, ing2_id));
+ assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(ListUniEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListUniEntity.class, ing2_id));
}
@Test
@@ -144,11 +144,11 @@
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
- ListUniEntity rev1 = getVersionsReader().find(ListUniEntity.class, ing1_id, 1);
- ListUniEntity rev2 = getVersionsReader().find(ListUniEntity.class, ing1_id, 2);
- ListUniEntity rev3 = getVersionsReader().find(ListUniEntity.class, ing1_id, 3);
- ListUniEntity rev4 = getVersionsReader().find(ListUniEntity.class, ing1_id, 4);
- ListUniEntity rev5 = getVersionsReader().find(ListUniEntity.class, ing1_id, 5);
+ ListUniEntity rev1 = getAuditReader().find(ListUniEntity.class, ing1_id, 1);
+ ListUniEntity rev2 = getAuditReader().find(ListUniEntity.class, ing1_id, 2);
+ ListUniEntity rev3 = getAuditReader().find(ListUniEntity.class, ing1_id, 3);
+ ListUniEntity rev4 = getAuditReader().find(ListUniEntity.class, ing1_id, 4);
+ ListUniEntity rev5 = getAuditReader().find(ListUniEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1);
@@ -162,11 +162,11 @@
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
- ListUniEntity rev1 = getVersionsReader().find(ListUniEntity.class, ing2_id, 1);
- ListUniEntity rev2 = getVersionsReader().find(ListUniEntity.class, ing2_id, 2);
- ListUniEntity rev3 = getVersionsReader().find(ListUniEntity.class, ing2_id, 3);
- ListUniEntity rev4 = getVersionsReader().find(ListUniEntity.class, ing2_id, 4);
- ListUniEntity rev5 = getVersionsReader().find(ListUniEntity.class, ing2_id, 5);
+ ListUniEntity rev1 = getAuditReader().find(ListUniEntity.class, ing2_id, 1);
+ ListUniEntity rev2 = getAuditReader().find(ListUniEntity.class, ing2_id, 2);
+ ListUniEntity rev3 = getAuditReader().find(ListUniEntity.class, ing2_id, 3);
+ ListUniEntity rev4 = getAuditReader().find(ListUniEntity.class, ing2_id, 4);
+ ListUniEntity rev5 = getAuditReader().find(ListUniEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_LIST);
assert TestTools.checkList(rev2.getReferences(), ed1, ed2);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniMap.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -110,10 +110,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(MapUniEntity.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(MapUniEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@@ -121,10 +121,10 @@
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
- MapUniEntity rev1 = getVersionsReader().find(MapUniEntity.class, coll1_id, 1);
- MapUniEntity rev2 = getVersionsReader().find(MapUniEntity.class, coll1_id, 2);
- MapUniEntity rev3 = getVersionsReader().find(MapUniEntity.class, coll1_id, 3);
- MapUniEntity rev4 = getVersionsReader().find(MapUniEntity.class, coll1_id, 4);
+ MapUniEntity rev1 = getAuditReader().find(MapUniEntity.class, coll1_id, 1);
+ MapUniEntity rev2 = getAuditReader().find(MapUniEntity.class, coll1_id, 2);
+ MapUniEntity rev3 = getAuditReader().find(MapUniEntity.class, coll1_id, 3);
+ MapUniEntity rev4 = getAuditReader().find(MapUniEntity.class, coll1_id, 4);
assert rev1.getMap().equals(TestTools.makeMap("1", str1));
assert rev2.getMap().equals(TestTools.makeMap("1", str1, "2", str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/manytomany/unidirectional/BasicUniSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -132,11 +132,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, ed2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, ed2_id));
- assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetUniEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetUniEntity.class, ing2_id));
+ assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetUniEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetUniEntity.class, ing2_id));
}
@Test
@@ -144,11 +144,11 @@
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
- SetUniEntity rev1 = getVersionsReader().find(SetUniEntity.class, ing1_id, 1);
- SetUniEntity rev2 = getVersionsReader().find(SetUniEntity.class, ing1_id, 2);
- SetUniEntity rev3 = getVersionsReader().find(SetUniEntity.class, ing1_id, 3);
- SetUniEntity rev4 = getVersionsReader().find(SetUniEntity.class, ing1_id, 4);
- SetUniEntity rev5 = getVersionsReader().find(SetUniEntity.class, ing1_id, 5);
+ SetUniEntity rev1 = getAuditReader().find(SetUniEntity.class, ing1_id, 1);
+ SetUniEntity rev2 = getAuditReader().find(SetUniEntity.class, ing1_id, 2);
+ SetUniEntity rev3 = getAuditReader().find(SetUniEntity.class, ing1_id, 3);
+ SetUniEntity rev4 = getAuditReader().find(SetUniEntity.class, ing1_id, 4);
+ SetUniEntity rev5 = getAuditReader().find(SetUniEntity.class, ing1_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1));
@@ -162,11 +162,11 @@
StrTestEntity ed1 = getEntityManager().find(StrTestEntity.class, ed1_id);
StrTestEntity ed2 = getEntityManager().find(StrTestEntity.class, ed2_id);
- SetUniEntity rev1 = getVersionsReader().find(SetUniEntity.class, ing2_id, 1);
- SetUniEntity rev2 = getVersionsReader().find(SetUniEntity.class, ing2_id, 2);
- SetUniEntity rev3 = getVersionsReader().find(SetUniEntity.class, ing2_id, 3);
- SetUniEntity rev4 = getVersionsReader().find(SetUniEntity.class, ing2_id, 4);
- SetUniEntity rev5 = getVersionsReader().find(SetUniEntity.class, ing2_id, 5);
+ SetUniEntity rev1 = getAuditReader().find(SetUniEntity.class, ing2_id, 1);
+ SetUniEntity rev2 = getAuditReader().find(SetUniEntity.class, ing2_id, 2);
+ SetUniEntity rev3 = getAuditReader().find(SetUniEntity.class, ing2_id, 3);
+ SetUniEntity rev4 = getAuditReader().find(SetUniEntity.class, ing2_id, 4);
+ SetUniEntity rev5 = getAuditReader().find(SetUniEntity.class, ing2_id, 5);
assert rev1.getReferences().equals(Collections.EMPTY_SET);
assert rev2.getReferences().equals(TestTools.makeSet(ed1, ed2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/BasicNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/BasicNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/BasicNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -81,9 +81,9 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(NamingTestEntity1.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(NamingTestEntity1.class, id1));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(NamingTestEntity1.class, id2));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(NamingTestEntity1.class, id2));
}
@Test
@@ -91,9 +91,9 @@
NamingTestEntity1 ver1 = new NamingTestEntity1(id1, "data1");
NamingTestEntity1 ver2 = new NamingTestEntity1(id1, "data1'");
- assert getVersionsReader().find(NamingTestEntity1.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(NamingTestEntity1.class, id1, 2).equals(ver2);
- assert getVersionsReader().find(NamingTestEntity1.class, id1, 3).equals(ver2);
+ assert getAuditReader().find(NamingTestEntity1.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(NamingTestEntity1.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(NamingTestEntity1.class, id1, 3).equals(ver2);
}
@Test
@@ -101,9 +101,9 @@
NamingTestEntity1 ver1 = new NamingTestEntity1(id2, "data2");
NamingTestEntity1 ver2 = new NamingTestEntity1(id2, "data2'");
- assert getVersionsReader().find(NamingTestEntity1.class, id2, 1).equals(ver1);
- assert getVersionsReader().find(NamingTestEntity1.class, id2, 2).equals(ver1);
- assert getVersionsReader().find(NamingTestEntity1.class, id2, 3).equals(ver2);
+ assert getAuditReader().find(NamingTestEntity1.class, id2, 1).equals(ver1);
+ assert getAuditReader().find(NamingTestEntity1.class, id2, 2).equals(ver1);
+ assert getAuditReader().find(NamingTestEntity1.class, id2, 3).equals(ver2);
}
@Test
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/JoinNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/JoinNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/JoinNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -84,25 +84,25 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefEdEntity.class, ed_id1));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefEdEntity.class, ed_id2));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinNamingRefIngEntity.class, ing_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefEdEntity.class, ed_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefEdEntity.class, ed_id2));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinNamingRefEdEntity ver1 = new JoinNamingRefEdEntity(ed_id1, "data1");
- assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
+ assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinNamingRefEdEntity ver1 = new JoinNamingRefEdEntity(ed_id2, "data2");
- assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
- assert getVersionsReader().find(JoinNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
+ assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
+ assert getAuditReader().find(JoinNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@@ -110,12 +110,12 @@
JoinNamingRefIngEntity ver1 = new JoinNamingRefIngEntity(ing_id1, "x", null);
JoinNamingRefIngEntity ver2 = new JoinNamingRefIngEntity(ing_id1, "y", null);
- assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
+ assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
- assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
+ assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinNamingRefEdEntity(ed_id1, "data1"));
- assert getVersionsReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
+ assert getAuditReader().find(JoinNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinNamingRefEdEntity(ed_id2, "data2"));
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -81,16 +81,16 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(DetachedNamingTestEntity.class, uni1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DetachedNamingTestEntity.class, uni1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfUniId1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
- DetachedNamingTestEntity rev1 = getVersionsReader().find(DetachedNamingTestEntity.class, uni1_id, 1);
- DetachedNamingTestEntity rev2 = getVersionsReader().find(DetachedNamingTestEntity.class, uni1_id, 2);
+ DetachedNamingTestEntity rev1 = getAuditReader().find(DetachedNamingTestEntity.class, uni1_id, 1);
+ DetachedNamingTestEntity rev2 = getAuditReader().find(DetachedNamingTestEntity.class, uni1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -81,16 +81,16 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(VersionsJoinTableTestEntity.class, uni1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(VersionsJoinTableTestEntity.class, uni1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfUniId1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
- VersionsJoinTableTestEntity rev1 = getVersionsReader().find(VersionsJoinTableTestEntity.class, uni1_id, 1);
- VersionsJoinTableTestEntity rev2 = getVersionsReader().find(VersionsJoinTableTestEntity.class, uni1_id, 2);
+ VersionsJoinTableTestEntity rev1 = getAuditReader().find(VersionsJoinTableTestEntity.class, uni1_id, 1);
+ VersionsJoinTableTestEntity rev2 = getAuditReader().find(VersionsJoinTableTestEntity.class, uni1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinEmbIdNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -82,25 +82,25 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id1));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id2));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinEmbIdNamingRefIngEntity.class, ing_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefEdEntity.class, ed_id2));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinEmbIdNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinEmbIdNamingRefEdEntity ver1 = new JoinEmbIdNamingRefEdEntity(ed_id1, "data1");
- assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
+ assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinEmbIdNamingRefEdEntity ver1 = new JoinEmbIdNamingRefEdEntity(ed_id2, "data2");
- assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
- assert getVersionsReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
+ assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
+ assert getAuditReader().find(JoinEmbIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@@ -108,12 +108,12 @@
JoinEmbIdNamingRefIngEntity ver1 = new JoinEmbIdNamingRefIngEntity(ing_id1, "x", null);
JoinEmbIdNamingRefIngEntity ver2 = new JoinEmbIdNamingRefIngEntity(ing_id1, "y", null);
- assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
+ assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
- assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
+ assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinEmbIdNamingRefEdEntity(ed_id1, "data1"));
- assert getVersionsReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
+ assert getAuditReader().find(JoinEmbIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinEmbIdNamingRefEdEntity(ed_id2, "data2"));
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/naming/ids/JoinMulIdNaming.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -82,25 +82,25 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id1));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id2));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(JoinMulIdNamingRefIngEntity.class, ing_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefEdEntity.class, ed_id2));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(JoinMulIdNamingRefIngEntity.class, ing_id1));
}
@Test
public void testHistoryOfEdId1() {
JoinMulIdNamingRefEdEntity ver1 = new JoinMulIdNamingRefEdEntity(ed_id1, "data1");
- assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
+ assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id1, 2).equals(ver1);
}
@Test
public void testHistoryOfEdId2() {
JoinMulIdNamingRefEdEntity ver1 = new JoinMulIdNamingRefEdEntity(ed_id2, "data2");
- assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
- assert getVersionsReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
+ assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 1).equals(ver1);
+ assert getAuditReader().find(JoinMulIdNamingRefEdEntity.class, ed_id2, 2).equals(ver1);
}
@Test
@@ -108,12 +108,12 @@
JoinMulIdNamingRefIngEntity ver1 = new JoinMulIdNamingRefIngEntity(ing_id1, "x", null);
JoinMulIdNamingRefIngEntity ver2 = new JoinMulIdNamingRefIngEntity(ing_id1, "y", null);
- assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
- assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
+ assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).equals(ver1);
+ assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).equals(ver2);
- assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
+ assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 1).getReference().equals(
new JoinMulIdNamingRefEdEntity(ed_id1, "data1"));
- assert getVersionsReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
+ assert getAuditReader().find(JoinMulIdNamingRefIngEntity.class, ing_id1, 2).getReference().equals(
new JoinMulIdNamingRefEdEntity(ed_id2, "data2"));
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/notinsertable/NotInsertable.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -59,7 +59,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(NotInsertableTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(NotInsertableTestEntity.class, id1));
}
@Test
@@ -67,7 +67,7 @@
NotInsertableTestEntity ver1 = new NotInsertableTestEntity(id1, "data1", "data1");
NotInsertableTestEntity ver2 = new NotInsertableTestEntity(id1, "data2", "data2");
- assert getVersionsReader().find(NotInsertableTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(NotInsertableTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(NotInsertableTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(NotInsertableTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicCollection.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -104,11 +104,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CollectionRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(CollectionRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CollectionRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(CollectionRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(CollectionRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(CollectionRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(CollectionRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(CollectionRefIngEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@@ -123,9 +123,9 @@
CollectionRefIngEntity ing1 = getEntityManager().find(CollectionRefIngEntity.class, ing1_id);
CollectionRefIngEntity ing2 = getEntityManager().find(CollectionRefIngEntity.class, ing2_id);
- CollectionRefEdEntity rev1 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 1);
- CollectionRefEdEntity rev2 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 2);
- CollectionRefEdEntity rev3 = getVersionsReader().find(CollectionRefEdEntity.class, ed1_id, 3);
+ CollectionRefEdEntity rev1 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 1);
+ CollectionRefEdEntity rev2 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 2);
+ CollectionRefEdEntity rev3 = getAuditReader().find(CollectionRefEdEntity.class, ed1_id, 3);
assert rev1.getReffering().containsAll(makeSet(ing1, ing2));
assert rev1.getReffering().size() == 2;
@@ -142,9 +142,9 @@
CollectionRefIngEntity ing1 = getEntityManager().find(CollectionRefIngEntity.class, ing1_id);
CollectionRefIngEntity ing2 = getEntityManager().find(CollectionRefIngEntity.class, ing2_id);
- CollectionRefEdEntity rev1 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 1);
- CollectionRefEdEntity rev2 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 2);
- CollectionRefEdEntity rev3 = getVersionsReader().find(CollectionRefEdEntity.class, ed2_id, 3);
+ CollectionRefEdEntity rev1 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 1);
+ CollectionRefEdEntity rev2 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 2);
+ CollectionRefEdEntity rev3 = getAuditReader().find(CollectionRefEdEntity.class, ed2_id, 3);
assert rev1.getReffering().containsAll(Collections.EMPTY_SET);
assert rev1.getReffering().size() == 0;
@@ -162,9 +162,9 @@
CollectionRefEdEntity ed1 = getEntityManager().find(CollectionRefEdEntity.class, ed1_id);
CollectionRefEdEntity ed2 = getEntityManager().find(CollectionRefEdEntity.class, ed2_id);
- CollectionRefIngEntity rev1 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 1);
- CollectionRefIngEntity rev2 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 2);
- CollectionRefIngEntity rev3 = getVersionsReader().find(CollectionRefIngEntity.class, ing1_id, 3);
+ CollectionRefIngEntity rev1 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 1);
+ CollectionRefIngEntity rev2 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 2);
+ CollectionRefIngEntity rev3 = getAuditReader().find(CollectionRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@@ -176,9 +176,9 @@
CollectionRefEdEntity ed1 = getEntityManager().find(CollectionRefEdEntity.class, ed1_id);
CollectionRefEdEntity ed2 = getEntityManager().find(CollectionRefEdEntity.class, ed2_id);
- CollectionRefIngEntity rev1 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 1);
- CollectionRefIngEntity rev2 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 2);
- CollectionRefIngEntity rev3 = getVersionsReader().find(CollectionRefIngEntity.class, ing2_id, 3);
+ CollectionRefIngEntity rev1 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 1);
+ CollectionRefIngEntity rev2 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 2);
+ CollectionRefIngEntity rev3 = getAuditReader().find(CollectionRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicList.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicList.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicList.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -102,20 +102,20 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ListRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(ListRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ListRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(ListRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(ListRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(ListRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ListRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(ListRefIngEntity.class, ing2_id));
}
@Test
public void testHistoryOfEdId1() {
ListRefIngEntity ing1 = getEntityManager().find(ListRefIngEntity.class, ing1_id);
ListRefIngEntity ing2 = getEntityManager().find(ListRefIngEntity.class, ing2_id);
- ListRefEdEntity rev1 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 1);
- ListRefEdEntity rev2 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 2);
- ListRefEdEntity rev3 = getVersionsReader().find(ListRefEdEntity.class, ed1_id, 3);
+ ListRefEdEntity rev1 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 1);
+ ListRefEdEntity rev2 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 2);
+ ListRefEdEntity rev3 = getAuditReader().find(ListRefEdEntity.class, ed1_id, 3);
assert TestTools.checkList(rev1.getReffering(), ing1, ing2);
assert TestTools.checkList(rev2.getReffering(), ing2);
@@ -127,9 +127,9 @@
ListRefIngEntity ing1 = getEntityManager().find(ListRefIngEntity.class, ing1_id);
ListRefIngEntity ing2 = getEntityManager().find(ListRefIngEntity.class, ing2_id);
- ListRefEdEntity rev1 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 1);
- ListRefEdEntity rev2 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 2);
- ListRefEdEntity rev3 = getVersionsReader().find(ListRefEdEntity.class, ed2_id, 3);
+ ListRefEdEntity rev1 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 1);
+ ListRefEdEntity rev2 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 2);
+ ListRefEdEntity rev3 = getAuditReader().find(ListRefEdEntity.class, ed2_id, 3);
assert TestTools.checkList(rev1.getReffering());
assert TestTools.checkList(rev2.getReffering(), ing1);
@@ -141,9 +141,9 @@
ListRefEdEntity ed1 = getEntityManager().find(ListRefEdEntity.class, ed1_id);
ListRefEdEntity ed2 = getEntityManager().find(ListRefEdEntity.class, ed2_id);
- ListRefIngEntity rev1 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 1);
- ListRefIngEntity rev2 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 2);
- ListRefIngEntity rev3 = getVersionsReader().find(ListRefIngEntity.class, ing1_id, 3);
+ ListRefIngEntity rev1 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 1);
+ ListRefIngEntity rev2 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 2);
+ ListRefIngEntity rev3 = getAuditReader().find(ListRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@@ -155,9 +155,9 @@
ListRefEdEntity ed1 = getEntityManager().find(ListRefEdEntity.class, ed1_id);
ListRefEdEntity ed2 = getEntityManager().find(ListRefEdEntity.class, ed2_id);
- ListRefIngEntity rev1 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 1);
- ListRefIngEntity rev2 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 2);
- ListRefIngEntity rev3 = getVersionsReader().find(ListRefIngEntity.class, ing2_id, 3);
+ ListRefIngEntity rev1 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 1);
+ ListRefIngEntity rev2 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 2);
+ ListRefIngEntity rev3 = getAuditReader().find(ListRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -114,11 +114,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 3, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed2_id));
- assert Arrays.asList(2, 3).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing1_id));
- assert Arrays.asList(2, 4).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing2_id));
+ assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing1_id));
+ assert Arrays.asList(2, 4).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing2_id));
}
@Test
@@ -126,10 +126,10 @@
SetRefIngEntity ing1 = getEntityManager().find(SetRefIngEntity.class, ing1_id);
SetRefIngEntity ing2 = getEntityManager().find(SetRefIngEntity.class, ing2_id);
- SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
- SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 2);
- SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 3);
- SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 4);
+ SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
+ SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 2);
+ SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 3);
+ SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 4);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(TestTools.makeSet(ing1, ing2));
@@ -142,10 +142,10 @@
SetRefIngEntity ing1 = getEntityManager().find(SetRefIngEntity.class, ing1_id);
SetRefIngEntity ing2 = getEntityManager().find(SetRefIngEntity.class, ing2_id);
- SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 1);
- SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
- SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 3);
- SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 4);
+ SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 1);
+ SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
+ SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 3);
+ SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 4);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(Collections.EMPTY_SET);
@@ -158,10 +158,10 @@
SetRefEdEntity ed1 = getEntityManager().find(SetRefEdEntity.class, ed1_id);
SetRefEdEntity ed2 = getEntityManager().find(SetRefEdEntity.class, ed2_id);
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 4);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 4);
assert rev1 == null;
assert rev2.getReference().equals(ed1);
@@ -174,10 +174,10 @@
SetRefEdEntity ed1 = getEntityManager().find(SetRefEdEntity.class, ed1_id);
SetRefEdEntity ed2 = getEntityManager().find(SetRefEdEntity.class, ed2_id);
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 4);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 4);
assert rev1 == null;
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithEmbId.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -103,11 +103,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdEmbIdEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdEmbIdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdEmbIdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdEmbIdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngEmbIdEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngEmbIdEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngEmbIdEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngEmbIdEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@@ -122,9 +122,9 @@
SetRefIngEmbIdEntity ing1 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing1_id);
SetRefIngEmbIdEntity ing2 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing2_id);
- SetRefEdEmbIdEntity rev1 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 1);
- SetRefEdEmbIdEntity rev2 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 2);
- SetRefEdEmbIdEntity rev3 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed1_id, 3);
+ SetRefEdEmbIdEntity rev1 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 1);
+ SetRefEdEmbIdEntity rev2 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 2);
+ SetRefEdEmbIdEntity rev3 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 3);
assert rev1.getReffering().equals(makeSet(ing1, ing2));
assert rev2.getReffering().equals(makeSet(ing2));
@@ -136,9 +136,9 @@
SetRefIngEmbIdEntity ing1 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing1_id);
SetRefIngEmbIdEntity ing2 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing2_id);
- SetRefEdEmbIdEntity rev1 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 1);
- SetRefEdEmbIdEntity rev2 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 2);
- SetRefEdEmbIdEntity rev3 = getVersionsReader().find(SetRefEdEmbIdEntity.class, ed2_id, 3);
+ SetRefEdEmbIdEntity rev1 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 1);
+ SetRefEdEmbIdEntity rev2 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 2);
+ SetRefEdEmbIdEntity rev3 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed2_id, 3);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(makeSet(ing1));
@@ -150,9 +150,9 @@
SetRefEdEmbIdEntity ed1 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed1_id);
SetRefEdEmbIdEntity ed2 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed2_id);
- SetRefIngEmbIdEntity rev1 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 1);
- SetRefIngEmbIdEntity rev2 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 2);
- SetRefIngEmbIdEntity rev3 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing1_id, 3);
+ SetRefIngEmbIdEntity rev1 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 1);
+ SetRefIngEmbIdEntity rev2 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 2);
+ SetRefIngEmbIdEntity rev3 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@@ -164,9 +164,9 @@
SetRefEdEmbIdEntity ed1 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed1_id);
SetRefEdEmbIdEntity ed2 = getEntityManager().find(SetRefEdEmbIdEntity.class, ed2_id);
- SetRefIngEmbIdEntity rev1 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 1);
- SetRefIngEmbIdEntity rev2 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 2);
- SetRefIngEmbIdEntity rev3 = getVersionsReader().find(SetRefIngEmbIdEntity.class, ing2_id, 3);
+ SetRefIngEmbIdEntity rev1 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 1);
+ SetRefIngEmbIdEntity rev2 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 2);
+ SetRefIngEmbIdEntity rev3 = getAuditReader().find(SetRefIngEmbIdEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithMulId.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -103,11 +103,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdMulIdEntity.class, ed1_id));
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(SetRefEdMulIdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdMulIdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(SetRefEdMulIdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngMulIdEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngMulIdEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngMulIdEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngMulIdEntity.class, ing2_id));
}
private <T> Set<T> makeSet(T... objects) {
@@ -122,9 +122,9 @@
SetRefIngMulIdEntity ing1 = getEntityManager().find(SetRefIngMulIdEntity.class, ing1_id);
SetRefIngMulIdEntity ing2 = getEntityManager().find(SetRefIngMulIdEntity.class, ing2_id);
- SetRefEdMulIdEntity rev1 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 1);
- SetRefEdMulIdEntity rev2 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 2);
- SetRefEdMulIdEntity rev3 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed1_id, 3);
+ SetRefEdMulIdEntity rev1 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 1);
+ SetRefEdMulIdEntity rev2 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 2);
+ SetRefEdMulIdEntity rev3 = getAuditReader().find(SetRefEdMulIdEntity.class, ed1_id, 3);
assert rev1.getReffering().equals(makeSet(ing1, ing2));
assert rev2.getReffering().equals(makeSet(ing2));
@@ -136,9 +136,9 @@
SetRefIngMulIdEntity ing1 = getEntityManager().find(SetRefIngMulIdEntity.class, ing1_id);
SetRefIngMulIdEntity ing2 = getEntityManager().find(SetRefIngMulIdEntity.class, ing2_id);
- SetRefEdMulIdEntity rev1 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 1);
- SetRefEdMulIdEntity rev2 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 2);
- SetRefEdMulIdEntity rev3 = getVersionsReader().find(SetRefEdMulIdEntity.class, ed2_id, 3);
+ SetRefEdMulIdEntity rev1 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 1);
+ SetRefEdMulIdEntity rev2 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 2);
+ SetRefEdMulIdEntity rev3 = getAuditReader().find(SetRefEdMulIdEntity.class, ed2_id, 3);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(makeSet(ing1));
@@ -150,9 +150,9 @@
SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
- SetRefIngMulIdEntity rev1 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 1);
- SetRefIngMulIdEntity rev2 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 2);
- SetRefIngMulIdEntity rev3 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing1_id, 3);
+ SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 1);
+ SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 2);
+ SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@@ -164,9 +164,9 @@
SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
- SetRefIngMulIdEntity rev1 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 1);
- SetRefIngMulIdEntity rev2 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 2);
- SetRefIngMulIdEntity rev3 = getVersionsReader().find(SetRefIngMulIdEntity.class, ing2_id, 3);
+ SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 1);
+ SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 2);
+ SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BasicSetWithNullsDelete.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -127,13 +127,13 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4, 5).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(SetRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3, 4, 5).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(SetRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing2_id));
- assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing3_id));
- assert Arrays.asList(1, 5).equals(getVersionsReader().getRevisions(SetRefIngEntity.class, ing4_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing3_id));
+ assert Arrays.asList(1, 5).equals(getAuditReader().getRevisions(SetRefIngEntity.class, ing4_id));
}
private <T> Set<T> makeSet(T... objects) {
@@ -150,11 +150,11 @@
SetRefIngEntity ing3 = getEntityManager().find(SetRefIngEntity.class, ing3_id);
SetRefIngEntity ing4 = getEntityManager().find(SetRefIngEntity.class, ing4_id);
- SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 1);
- SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 2);
- SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 3);
- SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 4);
- SetRefEdEntity rev5 = getVersionsReader().find(SetRefEdEntity.class, ed1_id, 5);
+ SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 1);
+ SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 2);
+ SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 3);
+ SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 4);
+ SetRefEdEntity rev5 = getAuditReader().find(SetRefEdEntity.class, ed1_id, 5);
assert rev1.getReffering().equals(makeSet(ing1, ing2, ing3, ing4));
assert rev2.getReffering().equals(makeSet(ing2, ing3, ing4));
@@ -167,11 +167,11 @@
public void testHistoryOfEdId2() {
SetRefIngEntity ing3 = getEntityManager().find(SetRefIngEntity.class, ing3_id);
- SetRefEdEntity rev1 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 1);
- SetRefEdEntity rev2 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 2);
- SetRefEdEntity rev3 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 3);
- SetRefEdEntity rev4 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 4);
- SetRefEdEntity rev5 = getVersionsReader().find(SetRefEdEntity.class, ed2_id, 5);
+ SetRefEdEntity rev1 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 1);
+ SetRefEdEntity rev2 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 2);
+ SetRefEdEntity rev3 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 3);
+ SetRefEdEntity rev4 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 4);
+ SetRefEdEntity rev5 = getAuditReader().find(SetRefEdEntity.class, ed2_id, 5);
assert rev1.getReffering().equals(Collections.EMPTY_SET);
assert rev2.getReffering().equals(Collections.EMPTY_SET);
@@ -184,11 +184,11 @@
public void testHistoryOfEdIng1() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 4);
- SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing1_id, 5);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 4);
+ SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing1_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference() == null;
@@ -201,11 +201,11 @@
public void testHistoryOfEdIng2() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 4);
- SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing2_id, 5);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 4);
+ SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing2_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
@@ -219,11 +219,11 @@
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2");
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 4);
- SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing3_id, 5);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 4);
+ SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
@@ -236,11 +236,11 @@
public void testHistoryOfEdIng4() {
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
- SetRefIngEntity rev1 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 1);
- SetRefIngEntity rev2 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 2);
- SetRefIngEntity rev3 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 3);
- SetRefIngEntity rev4 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 4);
- SetRefIngEntity rev5 = getVersionsReader().find(SetRefIngEntity.class, ing4_id, 5);
+ SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 1);
+ SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 2);
+ SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 3);
+ SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 4);
+ SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing4_id, 5);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/BidirectionalMapKey.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -90,10 +90,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(RefEdMapKeyEntity.class, ed_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(RefEdMapKeyEntity.class, ed_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(RefIngMapKeyEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(RefIngMapKeyEntity.class, ing2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(RefIngMapKeyEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(RefIngMapKeyEntity.class, ing2_id));
}
@Test
@@ -101,8 +101,8 @@
RefIngMapKeyEntity ing1 = getEntityManager().find(RefIngMapKeyEntity.class, ing1_id);
RefIngMapKeyEntity ing2 = getEntityManager().find(RefIngMapKeyEntity.class, ing2_id);
- RefEdMapKeyEntity rev1 = getVersionsReader().find(RefEdMapKeyEntity.class, ed_id, 1);
- RefEdMapKeyEntity rev2 = getVersionsReader().find(RefEdMapKeyEntity.class, ed_id, 2);
+ RefEdMapKeyEntity rev1 = getAuditReader().find(RefEdMapKeyEntity.class, ed_id, 1);
+ RefEdMapKeyEntity rev2 = getAuditReader().find(RefEdMapKeyEntity.class, ed_id, 2);
assert rev1.getIdmap().equals(TestTools.makeMap("a", ing1));
assert rev2.getIdmap().equals(TestTools.makeMap("a", ing1, "b", ing2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedList.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -110,10 +110,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(ListRefCollEntity.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(ListRefCollEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@@ -121,10 +121,10 @@
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
- ListRefCollEntity rev1 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 1);
- ListRefCollEntity rev2 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 2);
- ListRefCollEntity rev3 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 3);
- ListRefCollEntity rev4 = getVersionsReader().find(ListRefCollEntity.class, coll1_id, 4);
+ ListRefCollEntity rev1 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 1);
+ ListRefCollEntity rev2 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 2);
+ ListRefCollEntity rev3 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 3);
+ ListRefCollEntity rev4 = getAuditReader().find(ListRefCollEntity.class, coll1_id, 4);
assert TestTools.checkList(rev1.getCollection(), str1);
assert TestTools.checkList(rev2.getCollection(), str1, str2);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -110,10 +110,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntity.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@@ -121,10 +121,10 @@
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
- SetRefCollEntity rev1 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 1);
- SetRefCollEntity rev2 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 2);
- SetRefCollEntity rev3 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 3);
- SetRefCollEntity rev4 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 4);
+ SetRefCollEntity rev1 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 1);
+ SetRefCollEntity rev2 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 2);
+ SetRefCollEntity rev3 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 3);
+ SetRefCollEntity rev4 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithEmbId.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -109,10 +109,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntityEmbId.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntityEmbId.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(EmbIdTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(EmbIdTestEntity.class, str2_id));
}
@Test
@@ -120,10 +120,10 @@
EmbIdTestEntity str1 = getEntityManager().find(EmbIdTestEntity.class, str1_id);
EmbIdTestEntity str2 = getEntityManager().find(EmbIdTestEntity.class, str2_id);
- SetRefCollEntityEmbId rev1 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 1);
- SetRefCollEntityEmbId rev2 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 2);
- SetRefCollEntityEmbId rev3 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 3);
- SetRefCollEntityEmbId rev4 = getVersionsReader().find(SetRefCollEntityEmbId.class, coll1_id, 4);
+ SetRefCollEntityEmbId rev1 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 1);
+ SetRefCollEntityEmbId rev2 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 2);
+ SetRefCollEntityEmbId rev3 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 3);
+ SetRefCollEntityEmbId rev4 = getAuditReader().find(SetRefCollEntityEmbId.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicDetachedSetWithMulId.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -109,10 +109,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetRefCollEntityMulId.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetRefCollEntityMulId.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(MulIdTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(MulIdTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(MulIdTestEntity.class, str2_id));
}
@Test
@@ -120,10 +120,10 @@
MulIdTestEntity str1 = getEntityManager().find(MulIdTestEntity.class, str1_id);
MulIdTestEntity str2 = getEntityManager().find(MulIdTestEntity.class, str2_id);
- SetRefCollEntityMulId rev1 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 1);
- SetRefCollEntityMulId rev2 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 2);
- SetRefCollEntityMulId rev3 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 3);
- SetRefCollEntityMulId rev4 = getVersionsReader().find(SetRefCollEntityMulId.class, coll1_id, 4);
+ SetRefCollEntityMulId rev1 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 1);
+ SetRefCollEntityMulId rev2 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 2);
+ SetRefCollEntityMulId rev3 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 3);
+ SetRefCollEntityMulId rev4 = getAuditReader().find(SetRefCollEntityMulId.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/BasicJoinColumnSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -110,10 +110,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(SetJoinColumnRefCollEntity.class, coll1_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(SetJoinColumnRefCollEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@@ -121,10 +121,10 @@
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
- SetJoinColumnRefCollEntity rev1 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 1);
- SetJoinColumnRefCollEntity rev2 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 2);
- SetJoinColumnRefCollEntity rev3 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 3);
- SetJoinColumnRefCollEntity rev4 = getVersionsReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 4);
+ SetJoinColumnRefCollEntity rev1 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 1);
+ SetJoinColumnRefCollEntity rev2 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 2);
+ SetJoinColumnRefCollEntity rev3 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 3);
+ SetJoinColumnRefCollEntity rev4 = getAuditReader().find(SetJoinColumnRefCollEntity.class, coll1_id, 4);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DataChangesDetachedSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -87,17 +87,17 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SetRefCollEntity.class, coll1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SetRefCollEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
}
@Test
public void testHistoryOfColl1() {
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
- SetRefCollEntity rev1 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 1);
- SetRefCollEntity rev2 = getVersionsReader().find(SetRefCollEntity.class, coll1_id, 2);
+ SetRefCollEntity rev1 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 1);
+ SetRefCollEntity rev2 = getAuditReader().find(SetRefCollEntity.class, coll1_id, 2);
assert rev1.getCollection().equals(TestTools.makeSet());
assert rev2.getCollection().equals(TestTools.makeSet(str1));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetomany/detached/DoubleDetachedSet.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -106,10 +106,10 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3).equals(getVersionsReader().getRevisions(DoubleSetRefCollEntity.class, coll1_id));
+ assert Arrays.asList(1, 2, 3).equals(getAuditReader().getRevisions(DoubleSetRefCollEntity.class, coll1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(StrTestEntity.class, str2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(StrTestEntity.class, str2_id));
}
@Test
@@ -117,9 +117,9 @@
StrTestEntity str1 = getEntityManager().find(StrTestEntity.class, str1_id);
StrTestEntity str2 = getEntityManager().find(StrTestEntity.class, str2_id);
- DoubleSetRefCollEntity rev1 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 1);
- DoubleSetRefCollEntity rev2 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 2);
- DoubleSetRefCollEntity rev3 = getVersionsReader().find(DoubleSetRefCollEntity.class, coll1_id, 3);
+ DoubleSetRefCollEntity rev1 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 1);
+ DoubleSetRefCollEntity rev2 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 2);
+ DoubleSetRefCollEntity rev3 = getAuditReader().find(DoubleSetRefCollEntity.class, coll1_id, 3);
assert rev1.getCollection().equals(TestTools.makeSet(str1));
assert rev2.getCollection().equals(TestTools.makeSet(str1, str2));
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -86,18 +86,18 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@@ -107,8 +107,8 @@
public void testHistoryOfEdId2() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/Bidirectional2.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -111,11 +111,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2, 3, 4).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 4).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2, 3, 4).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 4).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
- assert Arrays.asList(2, 3, 4).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
- assert Arrays.asList(2, 3, 4).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing2_id));
+ assert Arrays.asList(2, 3, 4).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
+ assert Arrays.asList(2, 3, 4).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing2_id));
}
@Test
@@ -123,10 +123,10 @@
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
- BiRefEdEntity rev3 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 3);
- BiRefEdEntity rev4 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 4);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
+ BiRefEdEntity rev3 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 3);
+ BiRefEdEntity rev4 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 4);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@@ -138,10 +138,10 @@
public void testHistoryOfEdId2() {
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
- BiRefEdEntity rev3 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 3);
- BiRefEdEntity rev4 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 4);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
+ BiRefEdEntity rev3 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 3);
+ BiRefEdEntity rev4 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 4);
assert rev1.getReferencing() == null;
assert rev2.getReferencing() == null;
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/BidirectionalNoNulls.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -96,11 +96,11 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiRefIngEntity.class, ing2_id));
}
@Test
@@ -108,8 +108,8 @@
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed1_id, 2);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing().equals(ing2);
@@ -120,8 +120,8 @@
BiRefIngEntity ing1 = getEntityManager().find(BiRefIngEntity.class, ing1_id);
BiRefIngEntity ing2 = getEntityManager().find(BiRefIngEntity.class, ing2_id);
- BiRefEdEntity rev1 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 1);
- BiRefEdEntity rev2 = getVersionsReader().find(BiRefEdEntity.class, ed2_id, 2);
+ BiRefEdEntity rev1 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 1);
+ BiRefEdEntity rev2 = getAuditReader().find(BiRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing().equals(ing2);
assert rev2.getReferencing().equals(ing1);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/EmbIdBidirectional.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -85,18 +85,18 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiEmbIdRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiEmbIdRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiEmbIdRefIngEntity ing1 = getEntityManager().find(BiEmbIdRefIngEntity.class, ing1_id);
- BiEmbIdRefEdEntity rev1 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed1_id, 1);
- BiEmbIdRefEdEntity rev2 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed1_id, 2);
+ BiEmbIdRefEdEntity rev1 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed1_id, 1);
+ BiEmbIdRefEdEntity rev2 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@@ -106,8 +106,8 @@
public void testHistoryOfEdId2() {
BiEmbIdRefIngEntity ing1 = getEntityManager().find(BiEmbIdRefIngEntity.class, ing1_id);
- BiEmbIdRefEdEntity rev1 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed2_id, 1);
- BiEmbIdRefEdEntity rev2 = getVersionsReader().find(BiEmbIdRefEdEntity.class, ed2_id, 2);
+ BiEmbIdRefEdEntity rev1 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed2_id, 1);
+ BiEmbIdRefEdEntity rev2 = getAuditReader().find(BiEmbIdRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@@ -118,8 +118,8 @@
BiEmbIdRefEdEntity ed1 = getEntityManager().find(BiEmbIdRefEdEntity.class, ed1_id);
BiEmbIdRefEdEntity ed2 = getEntityManager().find(BiEmbIdRefEdEntity.class, ed2_id);
- BiEmbIdRefIngEntity rev1 = getVersionsReader().find(BiEmbIdRefIngEntity.class, ing1_id, 1);
- BiEmbIdRefIngEntity rev2 = getVersionsReader().find(BiEmbIdRefIngEntity.class, ing1_id, 2);
+ BiEmbIdRefIngEntity rev1 = getAuditReader().find(BiEmbIdRefIngEntity.class, ing1_id, 1);
+ BiEmbIdRefIngEntity rev2 = getAuditReader().find(BiEmbIdRefIngEntity.class, ing1_id, 2);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/bidirectional/ids/MulIdBidirectional.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -85,18 +85,18 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefEdEntity.class, ed1_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(BiMulIdRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(BiMulIdRefIngEntity.class, ing1_id));
}
@Test
public void testHistoryOfEdId1() {
BiMulIdRefIngEntity ing1 = getEntityManager().find(BiMulIdRefIngEntity.class, ing1_id);
- BiMulIdRefEdEntity rev1 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed1_id, 1);
- BiMulIdRefEdEntity rev2 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed1_id, 2);
+ BiMulIdRefEdEntity rev1 = getAuditReader().find(BiMulIdRefEdEntity.class, ed1_id, 1);
+ BiMulIdRefEdEntity rev2 = getAuditReader().find(BiMulIdRefEdEntity.class, ed1_id, 2);
assert rev1.getReferencing().equals(ing1);
assert rev2.getReferencing() == null;
@@ -106,8 +106,8 @@
public void testHistoryOfEdId2() {
BiMulIdRefIngEntity ing1 = getEntityManager().find(BiMulIdRefIngEntity.class, ing1_id);
- BiMulIdRefEdEntity rev1 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed2_id, 1);
- BiMulIdRefEdEntity rev2 = getVersionsReader().find(BiMulIdRefEdEntity.class, ed2_id, 2);
+ BiMulIdRefEdEntity rev1 = getAuditReader().find(BiMulIdRefEdEntity.class, ed2_id, 1);
+ BiMulIdRefEdEntity rev2 = getAuditReader().find(BiMulIdRefEdEntity.class, ed2_id, 2);
assert rev1.getReferencing() == null;
assert rev2.getReferencing().equals(ing1);
@@ -118,8 +118,8 @@
BiMulIdRefEdEntity ed1 = getEntityManager().find(BiMulIdRefEdEntity.class, ed1_id);
BiMulIdRefEdEntity ed2 = getEntityManager().find(BiMulIdRefEdEntity.class, ed2_id);
- BiMulIdRefIngEntity rev1 = getVersionsReader().find(BiMulIdRefIngEntity.class, ing1_id, 1);
- BiMulIdRefIngEntity rev2 = getVersionsReader().find(BiMulIdRefIngEntity.class, ing1_id, 2);
+ BiMulIdRefIngEntity rev1 = getAuditReader().find(BiMulIdRefIngEntity.class, ing1_id, 1);
+ BiMulIdRefIngEntity rev2 = getAuditReader().find(BiMulIdRefIngEntity.class, ing1_id, 2);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/Unidirectional.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -110,13 +110,13 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed2_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed3_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed4_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed3_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed4_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing2_id));
}
@Test
@@ -124,9 +124,9 @@
UniRefEdEntity ed1 = getEntityManager().find(UniRefEdEntity.class, ed1_id);
UniRefEdEntity ed2 = getEntityManager().find(UniRefEdEntity.class, ed2_id);
- UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 1);
- UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 2);
- UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 3);
+ UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 1);
+ UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 2);
+ UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference().equals(ed2);
@@ -138,9 +138,9 @@
UniRefEdEntity ed3 = getEntityManager().find(UniRefEdEntity.class, ed3_id);
UniRefEdEntity ed4 = getEntityManager().find(UniRefEdEntity.class, ed4_id);
- UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 1);
- UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 2);
- UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 3);
+ UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 1);
+ UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 2);
+ UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 3);
assert rev1.getReference().equals(ed3);
assert rev2.getReference().equals(ed3);
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/onetoone/unidirectional/UnidirectionalWithNulls.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -101,20 +101,20 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed1_id));
- assert Arrays.asList(1).equals(getVersionsReader().getRevisions(UniRefEdEntity.class, ed2_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed1_id));
+ assert Arrays.asList(1).equals(getAuditReader().getRevisions(UniRefEdEntity.class, ed2_id));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing1_id));
- assert Arrays.asList(1, 3).equals(getVersionsReader().getRevisions(UniRefIngEntity.class, ing2_id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing1_id));
+ assert Arrays.asList(1, 3).equals(getAuditReader().getRevisions(UniRefIngEntity.class, ing2_id));
}
@Test
public void testHistoryOfIngId1() {
UniRefEdEntity ed1 = getEntityManager().find(UniRefEdEntity.class, ed1_id);
- UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 1);
- UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 2);
- UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing1_id, 3);
+ UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 1);
+ UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 2);
+ UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing1_id, 3);
assert rev1.getReference().equals(ed1);
assert rev2.getReference() == null;
@@ -125,9 +125,9 @@
public void testHistoryOfIngId2() {
UniRefEdEntity ed2 = getEntityManager().find(UniRefEdEntity.class, ed2_id);
- UniRefIngEntity rev1 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 1);
- UniRefIngEntity rev2 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 2);
- UniRefIngEntity rev3 = getVersionsReader().find(UniRefIngEntity.class, ing2_id, 3);
+ UniRefIngEntity rev1 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 1);
+ UniRefIngEntity rev2 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 2);
+ UniRefIngEntity rev3 = getAuditReader().find(UniRefIngEntity.class, ing2_id, 3);
assert rev1.getReference() == null;
assert rev2.getReference() == null;
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/UnversionedOptimisticLockingField.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -65,7 +65,7 @@
@Test
public void testRevisionCounts() {
assert Arrays.asList(1, 2).equals(
- getVersionsReader().getRevisions(UnversionedOptimisticLockingFieldEntity.class,
+ getAuditReader().getRevisions(UnversionedOptimisticLockingFieldEntity.class,
id1));
}
@@ -74,9 +74,9 @@
UnversionedOptimisticLockingFieldEntity ver1 = new UnversionedOptimisticLockingFieldEntity(id1, "x");
UnversionedOptimisticLockingFieldEntity ver2 = new UnversionedOptimisticLockingFieldEntity(id1, "y");
- assert getVersionsReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 1)
+ assert getAuditReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 1)
.equals(ver1);
- assert getVersionsReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 2)
+ assert getAuditReader().find(UnversionedOptimisticLockingFieldEntity.class, id1, 2)
.equals(ver2);
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/properties/VersionsProperties.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -64,7 +64,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(PropertiesTestEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(PropertiesTestEntity.class, id1));
}
@Test
@@ -72,7 +72,7 @@
PropertiesTestEntity ver1 = new PropertiesTestEntity(id1, "x");
PropertiesTestEntity ver2 = new PropertiesTestEntity(id1, "y");
- assert getVersionsReader().find(PropertiesTestEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(PropertiesTestEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(PropertiesTestEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(PropertiesTestEntity.class, id1, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/AggregateQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/AggregateQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/AggregateQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -81,19 +81,19 @@
@Test
public void testEntitiesAvgMaxQuery() {
- Object[] ver1 = (Object[]) getVersionsReader().createQuery()
+ Object[] ver1 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addProjection("max", "number")
.addProjection("avg", "number")
.getSingleResult();
- Object[] ver2 = (Object[]) getVersionsReader().createQuery()
+ Object[] ver2 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addProjection("max", "number")
.addProjection("avg", "number")
.getSingleResult();
- Object[] ver3 = (Object[]) getVersionsReader().createQuery()
+ Object[] ver3 = (Object[]) getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 3)
.addProjection("max", "number")
.addProjection("avg", "number")
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/CustomRevEntityQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/CustomRevEntityQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/CustomRevEntityQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -77,7 +77,7 @@
@Test
public void testRevisionsOfId1Query() {
- List<Object[]> result = getVersionsReader().createQuery()
+ List<Object[]> result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@@ -93,7 +93,7 @@
@Test
public void testRevisionsOfId2Query() {
- List<Object[]> result = getVersionsReader().createQuery()
+ List<Object[]> result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id2))
.getResultList();
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/DeletedEntities.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/DeletedEntities.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/DeletedEntities.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -73,20 +73,20 @@
@Test
public void testProjectionsInEntitiesAtRevision() {
- assert getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
+ assert getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
.getResultList().size() == 2;
- assert getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
+ assert getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
.getResultList().size() == 1;
- assert (Long) getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
+ assert (Long) getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 1)
.addProjection("count", "originalId.id").getResultList().get(0) == 2;
- assert (Long) getVersionsReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
+ assert (Long) getAuditReader().createQuery().forEntitiesAtRevision(StrIntTestEntity.class, 2)
.addProjection("count", "originalId.id").getResultList().get(0) == 1;
}
@Test
public void testRevisionsOfEntityWithoutDelete() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, false)
.add(AuditRestrictions.idEq(id2))
.getResultList();
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/MaximalizePropertyQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -101,7 +101,7 @@
@Test
public void testMaximizeWithIdEq() {
- List revs_id1 = getVersionsReader().createQuery()
+ List revs_id1 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.maximizeProperty("number")
@@ -113,7 +113,7 @@
@Test
public void testMinimizeWithPropertyEq() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.minimizeProperty("number")
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByLimitQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -90,21 +90,21 @@
@Test
public void testEntitiesOrderLimitByQueryRev1() {
- List res_0_to_1 = getVersionsReader().createQuery()
+ List res_0_to_1 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(0)
.setMaxResults(2)
.getResultList();
- List res_2_to_3 = getVersionsReader().createQuery()
+ List res_2_to_3 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(2)
.setMaxResults(2)
.getResultList();
- List res_empty = getVersionsReader().createQuery()
+ List res_empty = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 1)
.addOrder("number", false)
.setFirstResult(4)
@@ -118,21 +118,21 @@
@Test
public void testEntitiesOrderLimitByQueryRev2() {
- List res_0_to_1 = getVersionsReader().createQuery()
+ List res_0_to_1 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(0)
.setMaxResults(2)
.getResultList();
- List res_2_to_3 = getVersionsReader().createQuery()
+ List res_2_to_3 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(2)
.setMaxResults(2)
.getResultList();
- List res_4 = getVersionsReader().createQuery()
+ List res_4 = getAuditReader().createQuery()
.forEntitiesAtRevision(IntTestEntity.class, 2)
.addOrder("number", false)
.setFirstResult(4)
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/RevisionConstraintQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -100,7 +100,7 @@
@Test
public void testRevisionsLtQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.distinct())
.add(RevisionProperty.lt(3))
@@ -111,7 +111,7 @@
@Test
public void testRevisionsGeQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.distinct())
.add(RevisionProperty.ge(2))
@@ -122,7 +122,7 @@
@Test
public void testRevisionsLeWithPropertyQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(RevisionProperty.le(3))
@@ -134,7 +134,7 @@
@Test
public void testRevisionsGtWithPropertyQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(RevisionProperty.gt(1))
@@ -146,7 +146,7 @@
@Test
public void testRevisionProjectionQuery() {
- Object[] result = (Object[]) getVersionsReader().createQuery()
+ Object[] result = (Object[]) getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.max())
.addProjection(RevisionProperty.count())
@@ -163,7 +163,7 @@
@Test
public void testRevisionOrderQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.idEq(id1))
@@ -176,7 +176,7 @@
@Test
public void testRevisionCountQuery() {
// The query shouldn't be ordered as always, otherwise - we get an exception.
- Object result = getVersionsReader().createQuery()
+ Object result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.count())
.add(AuditRestrictions.idEq(id1))
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/SimpleQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/SimpleQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/SimpleQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -106,7 +106,7 @@
@Test
public void testEntitiesIdQuery() {
- StrIntTestEntity ver2 = (StrIntTestEntity) getVersionsReader().createQuery()
+ StrIntTestEntity ver2 = (StrIntTestEntity) getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.idEq(id2))
.getSingleResult();
@@ -116,17 +116,17 @@
@Test
public void testEntitiesPropertyEqualsQuery() {
- List ver1 = getVersionsReader().createQuery()
+ List ver1 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 1)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
- List ver2 = getVersionsReader().createQuery()
+ List ver2 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
- List ver3 = getVersionsReader().createQuery()
+ List ver3 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 3)
.add(AuditRestrictions.eq("str1", "a"))
.getResultList();
@@ -140,17 +140,17 @@
@Test
public void testEntitiesPropertyLeQuery() {
- List ver1 = getVersionsReader().createQuery()
+ List ver1 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 1)
.add(AuditRestrictions.le("number", 10))
.getResultList();
- List ver2 = getVersionsReader().createQuery()
+ List ver2 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 2)
.add(AuditRestrictions.le("number", 10))
.getResultList();
- List ver3 = getVersionsReader().createQuery()
+ List ver3 = getAuditReader().createQuery()
.forEntitiesAtRevision(StrIntTestEntity.class, 3)
.add(AuditRestrictions.le("number", 10))
.getResultList();
@@ -165,21 +165,21 @@
@Test
public void testRevisionsPropertyEqQuery() {
- List revs_id1 = getVersionsReader().createQuery()
+ List revs_id1 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
.add(AuditRestrictions.idEq(id1))
.getResultList();
- List revs_id2 = getVersionsReader().createQuery()
+ List revs_id2 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
.add(AuditRestrictions.idEq(id2))
.getResultList();
- List revs_id3 = getVersionsReader().createQuery()
+ List revs_id3 = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionProperty.revisionNumber())
.add(AuditRestrictions.le("str1", "a"))
@@ -193,7 +193,7 @@
@Test
public void testSelectEntitiesQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, true, false)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@@ -206,7 +206,7 @@
@Test
public void testSelectEntitiesAndRevisionsQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.idEq(id1))
.getResultList();
@@ -228,7 +228,7 @@
@Test
public void testSelectRevisionTypeQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.addProjection(RevisionTypeProperty.revisionType())
.add(AuditRestrictions.idEq(id1))
@@ -243,7 +243,7 @@
@Test
public void testEmptyRevisionOfEntityQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.getResultList();
@@ -252,7 +252,7 @@
@Test
public void testEmptyConjunctionRevisionOfEntityQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.conjunction())
.getResultList();
@@ -262,7 +262,7 @@
@Test
public void testEmptyDisjunctionRevisionOfEntityQuery() {
- List result = getVersionsReader().createQuery()
+ List result = getAuditReader().createQuery()
.forRevisionsOfEntity(StrIntTestEntity.class, false, true)
.add(AuditRestrictions.disjunction())
.getResultList();
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/EmbIdOneToManyQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -103,32 +103,32 @@
@Test
public void testEntitiesReferencedToId3() {
- Set rev1_related = new HashSet(getVersionsReader().createQuery()
+ Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev1 = new HashSet(getVersionsReader().createQuery()
+ Set rev1 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
- Set rev2_related = new HashSet(getVersionsReader().createQuery()
+ Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev2 = new HashSet(getVersionsReader().createQuery()
+ Set rev2 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
- Set rev3_related = new HashSet(getVersionsReader().createQuery()
+ Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev3 = new HashSet(getVersionsReader().createQuery()
+ Set rev3 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.eq("reference", new SetRefEdEmbIdEntity(id3, null)))
.getResultList());
@@ -145,17 +145,17 @@
@Test
public void testEntitiesReferencedToId4() {
- Set rev1_related = new HashSet(getVersionsReader().createQuery()
+ Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
- Set rev2_related = new HashSet(getVersionsReader().createQuery()
+ Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
- Set rev3_related = new HashSet(getVersionsReader().createQuery()
+ Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
@@ -167,19 +167,19 @@
@Test
public void testEntitiesReferencedByIng1ToId3() {
- List rev1_related = getVersionsReader().createQuery()
+ List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getResultList();
- Object rev2_related = getVersionsReader().createQuery()
+ Object rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getSingleResult();
- Object rev3_related = getVersionsReader().createQuery()
+ Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
@@ -192,19 +192,19 @@
@Test
public void testEntitiesReferencedByIng2ToId3() {
- List rev1_related = getVersionsReader().createQuery()
+ List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
- List rev2_related = getVersionsReader().createQuery()
+ List rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
- Object rev3_related = getVersionsReader().createQuery()
+ Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngEmbIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/query/ids/MulIdOneToManyQuery.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -103,32 +103,32 @@
@Test
public void testEntitiesReferencedToId3() {
- Set rev1_related = new HashSet(getVersionsReader().createQuery()
+ Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev1 = new HashSet(getVersionsReader().createQuery()
+ Set rev1 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
- Set rev2_related = new HashSet(getVersionsReader().createQuery()
+ Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev2 = new HashSet(getVersionsReader().createQuery()
+ Set rev2 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
- Set rev3_related = new HashSet(getVersionsReader().createQuery()
+ Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.getResultList());
- Set rev3 = new HashSet(getVersionsReader().createQuery()
+ Set rev3 = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.eq("reference", new SetRefEdMulIdEntity(id3, null)))
.getResultList());
@@ -145,17 +145,17 @@
@Test
public void testEntitiesReferencedToId4() {
- Set rev1_related = new HashSet(getVersionsReader().createQuery()
+ Set rev1_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
- Set rev2_related = new HashSet(getVersionsReader().createQuery()
+ Set rev2_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
- Set rev3_related = new HashSet(getVersionsReader().createQuery()
+ Set rev3_related = new HashSet(getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id4))
.getResultList());
@@ -167,19 +167,19 @@
@Test
public void testEntitiesReferencedByIng1ToId3() {
- List rev1_related = getVersionsReader().createQuery()
+ List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getResultList();
- Object rev2_related = getVersionsReader().createQuery()
+ Object rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
.getSingleResult();
- Object rev3_related = getVersionsReader().createQuery()
+ Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id1))
@@ -192,19 +192,19 @@
@Test
public void testEntitiesReferencedByIng2ToId3() {
- List rev1_related = getVersionsReader().createQuery()
+ List rev1_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 1)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
- List rev2_related = getVersionsReader().createQuery()
+ List rev2_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 2)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
.getResultList();
- Object rev3_related = getVersionsReader().createQuery()
+ Object rev3_related = getAuditReader().createQuery()
.forEntitiesAtRevision(SetRefIngMulIdEntity.class, 3)
.add(AuditRestrictions.relatedIdEq("reference", id3))
.add(AuditRestrictions.idEq(id2))
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Custom.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Custom.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Custom.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -80,25 +80,25 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@@ -108,7 +108,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@@ -121,7 +121,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -129,7 +129,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomBoxed.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -79,25 +79,25 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@@ -107,7 +107,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomBoxedRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@@ -120,7 +120,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -128,7 +128,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/CustomPropertyAccess.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -80,25 +80,25 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@@ -108,7 +108,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomPropertyAccessRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
@@ -121,7 +121,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -129,7 +129,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Inherited.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Inherited.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Inherited.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -79,25 +79,25 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@@ -107,7 +107,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(InheritedRevEntity.class, 1).getTimestamp();
assert rev1Timestamp > timestamp1;
@@ -120,7 +120,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -128,7 +128,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Listener.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Listener.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/Listener.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -85,25 +85,25 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@@ -113,7 +113,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
ListenerRevEntity rev1Data = vr.findRevision(ListenerRevEntity.class, 1);
ListenerRevEntity rev2Data = vr.findRevision(ListenerRevEntity.class, 2);
@@ -133,7 +133,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -141,7 +141,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevNumber.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -64,7 +64,7 @@
@Test
public void testFindRevision() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.findRevision(LongRevNumberRevEntity.class, 1l).getCustomId() == 1l;
assert vr.findRevision(LongRevNumberRevEntity.class, 2l).getCustomId() == 2l;
@@ -72,7 +72,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1l, 2l).equals(getVersionsReader().getRevisions(StrTestEntity.class, id));
+ assert Arrays.asList(1l, 2l).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
}
@Test
@@ -80,7 +80,7 @@
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
- assert getVersionsReader().find(StrTestEntity.class, id, 1l).equals(ver1);
- assert getVersionsReader().find(StrTestEntity.class, id, 2l).equals(ver2);
+ assert getAuditReader().find(StrTestEntity.class, id, 1l).equals(ver1);
+ assert getAuditReader().find(StrTestEntity.class, id, 2l).equals(ver2);
}
}
\ No newline at end of file
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/revfordate/RevisionForDate.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -87,19 +87,19 @@
@Test(expectedExceptions = RevisionDoesNotExistException.class)
public void testTimestamps1() {
- getVersionsReader().getRevisionNumberForDate(new Date(timestamp1));
+ getAuditReader().getRevisionNumberForDate(new Date(timestamp1));
}
@Test
public void testTimestamps() {
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
- assert getVersionsReader().getRevisionNumberForDate(new Date(timestamp4)).intValue() == 3;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp2)).intValue() == 1;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp3)).intValue() == 2;
+ assert getAuditReader().getRevisionNumberForDate(new Date(timestamp4)).intValue() == 3;
}
@Test
public void testDatesForRevisions() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(3)).intValue() == 3;
@@ -107,7 +107,7 @@
@Test
public void testRevisionsForDates() {
- AuditReader vr = getVersionsReader();
+ AuditReader vr = getAuditReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/sameids/SameIds.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/sameids/SameIds.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/sameids/SameIds.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -64,8 +64,8 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SameIdTestEntity1.class, 1));
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SameIdTestEntity2.class, 1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SameIdTestEntity1.class, 1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SameIdTestEntity2.class, 1));
}
@Test
@@ -73,8 +73,8 @@
SameIdTestEntity1 ver1 = new SameIdTestEntity1(1, "str1");
SameIdTestEntity1 ver2 = new SameIdTestEntity1(1, "str2");
- assert getVersionsReader().find(SameIdTestEntity1.class, 1, 1).equals(ver1);
- assert getVersionsReader().find(SameIdTestEntity1.class, 1, 2).equals(ver2);
+ assert getAuditReader().find(SameIdTestEntity1.class, 1, 1).equals(ver1);
+ assert getAuditReader().find(SameIdTestEntity1.class, 1, 2).equals(ver2);
}
@Test
@@ -82,7 +82,7 @@
SameIdTestEntity2 ver1 = new SameIdTestEntity2(1, "str1");
SameIdTestEntity2 ver2 = new SameIdTestEntity2(1, "str2");
- assert getVersionsReader().find(SameIdTestEntity2.class, 1, 1).equals(ver1);
- assert getVersionsReader().find(SameIdTestEntity2.class, 1, 2).equals(ver2);
+ assert getAuditReader().find(SameIdTestEntity2.class, 1, 1).equals(ver1);
+ assert getAuditReader().find(SameIdTestEntity2.class, 1, 2).equals(ver2);
}
}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/BasicSecondary.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -72,7 +72,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryTestEntity.class, id));
}
@Test
@@ -80,8 +80,8 @@
SecondaryTestEntity ver1 = new SecondaryTestEntity(id, "a", "1");
SecondaryTestEntity ver2 = new SecondaryTestEntity(id, "b", "2");
- assert getVersionsReader().find(SecondaryTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(SecondaryTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(SecondaryTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(SecondaryTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/NamingSecondary.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -72,7 +72,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryNamingTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryNamingTestEntity.class, id));
}
@Test
@@ -80,8 +80,8 @@
SecondaryNamingTestEntity ver1 = new SecondaryNamingTestEntity(id, "a", "1");
SecondaryNamingTestEntity ver2 = new SecondaryNamingTestEntity(id, "b", "2");
- assert getVersionsReader().find(SecondaryNamingTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(SecondaryNamingTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(SecondaryNamingTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(SecondaryNamingTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/EmbIdSecondary.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -71,7 +71,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryEmbIdTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryEmbIdTestEntity.class, id));
}
@Test
@@ -79,8 +79,8 @@
SecondaryEmbIdTestEntity ver1 = new SecondaryEmbIdTestEntity(id, "a", "1");
SecondaryEmbIdTestEntity ver2 = new SecondaryEmbIdTestEntity(id, "b", "2");
- assert getVersionsReader().find(SecondaryEmbIdTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(SecondaryEmbIdTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(SecondaryEmbIdTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(SecondaryEmbIdTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/secondary/ids/MulIdSecondary.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -71,7 +71,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SecondaryMulIdTestEntity.class, id));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SecondaryMulIdTestEntity.class, id));
}
@Test
@@ -79,8 +79,8 @@
SecondaryMulIdTestEntity ver1 = new SecondaryMulIdTestEntity(id, "a", "1");
SecondaryMulIdTestEntity ver2 = new SecondaryMulIdTestEntity(id, "b", "2");
- assert getVersionsReader().find(SecondaryMulIdTestEntity.class, id, 1).equals(ver1);
- assert getVersionsReader().find(SecondaryMulIdTestEntity.class, id, 2).equals(ver2);
+ assert getAuditReader().find(SecondaryMulIdTestEntity.class, id, 1).equals(ver1);
+ assert getAuditReader().find(SecondaryMulIdTestEntity.class, id, 2).equals(ver2);
}
@SuppressWarnings({"unchecked"})
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/superclass/MappedSubclassing.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/superclass/MappedSubclassing.java 2008-11-05 09:13:05 UTC (rev 15517)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/superclass/MappedSubclassing.java 2008-11-05 09:17:10 UTC (rev 15518)
@@ -61,7 +61,7 @@
@Test
public void testRevisionsCounts() {
- assert Arrays.asList(1, 2).equals(getVersionsReader().getRevisions(SubclassEntity.class, id1));
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(SubclassEntity.class, id1));
}
@Test
@@ -69,7 +69,7 @@
SubclassEntity ver1 = new SubclassEntity(id1, "x");
SubclassEntity ver2 = new SubclassEntity(id1, "y");
- assert getVersionsReader().find(SubclassEntity.class, id1, 1).equals(ver1);
- assert getVersionsReader().find(SubclassEntity.class, id1, 2).equals(ver2);
+ assert getAuditReader().find(SubclassEntity.class, id1, 1).equals(ver1);
+ assert getAuditReader().find(SubclassEntity.class, id1, 2).equals(ver2);
}
}
16 years, 2 months