svn commit: r760146 - in /jakarta/jcs/trunk: src/java/org/apache/jcs/auxiliary/disk/block/ src/java/org/apache/jcs/auxiliary/disk/indexed/ src/java/org/apache/jcs/auxiliary/remote/ src/java/org/apache/jcs/engine/memory/ src/java/org/apache/jcs/utils/da...
[email protected] Mon, 30 Mar 2009 20:18:05 -0000
| Newsgroups | gmane.comp.jakarta.turbine.jcs.devel |
|---|---|
| Message-ID | <[email protected]> |
Author: asmuts
Date: Mon Mar 30 20:18:04 2009
New Revision: 760146
URL: http://svn.apache.org/viewvc?rev=760146&view=rev
Log:
Adding a unit test here and there, some formatting changes, and some simple utilities. I'm working on a block disk cache bug.
Added:
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/DateFormatter.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/AddressUtil.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java
jakarta/jcs/trunk/src/test-conf/log4j.properties
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/MockElementSerializer.java
jakarta/jcs/trunk/xdocs/changes.xml
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java Mon Mar 30 20:18:04 2009
@@ -119,7 +119,7 @@
* The program flow is as follows:
* <ol>
* <li>Serialize the object.</li>
- * <li>Detemine the number of blocks needed.</li>
+ * <li>Determine the number of blocks needed.</li>
* <li>Look for free blocks in the emptyBlock list.</li>
* <li>If there were not enough in the empty list. Take the nextBlock and increment it.</li>
* <li>If the data will not fit in one block, create sub arrays.</li>
@@ -136,12 +136,21 @@
// serialize the object
byte[] data = elementSerializer.serialize( object );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "read, total pre-chunking data.length = " + data.length );
+ }
+
this.addToPutBytes( data.length );
this.incrementPutCount();
// figure out how many blocks we need.
int numBlocksNeeded = calculateTheNumberOfBlocksNeeded( data );
-
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "numBlocksNeeded = " + numBlocksNeeded );
+ }
+
int[] blocks = new int[numBlocksNeeded];
// get them from the empty list or take the next one
@@ -255,13 +264,18 @@
byte[] newTotal = new byte[data.length + chunk.length];
// copy data into the new array
System.arraycopy( data, 0, newTotal, 0, data.length );
- // copyt the chunk into the new array
+ // copy the chunk into the new array
System.arraycopy( chunk, 0, newTotal, data.length, chunk.length );
// swap the new and old.
data = newTotal;
}
}
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "read, total post combination data.length = " + data.length );
+ }
+
return (Serializable) elementSerializer.deSerialize( data );
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java Mon Mar 30 20:18:04 2009
@@ -37,6 +37,7 @@
import org.apache.jcs.auxiliary.disk.AbstractDiskCache;
import org.apache.jcs.engine.CacheConstants;
import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.group.GroupAttrName;
import org.apache.jcs.engine.control.group.GroupId;
import org.apache.jcs.engine.stats.StatElement;
@@ -82,8 +83,6 @@
* Use this lock to synchronize reads and writes to the underlying storage mechansism. We don't
* need a reentrant lock, since we only lock one level.
*/
- // private ReentrantWriterPreferenceReadWriteLock storageLock = new
- // ReentrantWriterPreferenceReadWriteLock();
private WriterPreferenceReadWriteLock storageLock = new WriterPreferenceReadWriteLock();
/**
@@ -93,8 +92,20 @@
*/
public BlockDiskCache( BlockDiskCacheAttributes cacheAttributes )
{
+ this( cacheAttributes, null );
+ }
+
+ /**
+ * Constructs the BlockDisk after setting up the root directory.
+ * <p>
+ * @param cacheAttributes
+ * @param elementSerializer used if supplied, the super's super will not set a null
+ */
+ public BlockDiskCache( BlockDiskCacheAttributes cacheAttributes, IElementSerializer elementSerializer )
+ {
super( cacheAttributes );
-
+ setElementSerializer( elementSerializer );
+
this.blockDiskCacheAttributes = cacheAttributes;
this.logCacheName = "Region [" + getCacheName() + "] ";
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Mon Mar 30 20:18:04 2009
@@ -41,6 +41,7 @@
import org.apache.jcs.auxiliary.disk.LRUMapJCS;
import org.apache.jcs.engine.CacheConstants;
import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.group.GroupAttrName;
import org.apache.jcs.engine.control.group.GroupId;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
@@ -142,11 +143,23 @@
/**
* Constructor for the DiskCache object.
* <p>
+ * @param cacheAttributes
+ */
+ public IndexedDiskCache( IndexedDiskCacheAttributes cacheAttributes )
+ {
+ this( cacheAttributes, null );
+ }
+
+ /**
+ * Constructor for the DiskCache object.
+ * <p>
* @param cattr
+ * @param elementSerializer used if supplied, the super's super will not set a null
*/
- public IndexedDiskCache( IndexedDiskCacheAttributes cattr )
+ public IndexedDiskCache( IndexedDiskCacheAttributes cattr, IElementSerializer elementSerializer )
{
super( cattr );
+ setElementSerializer( elementSerializer );
String rootDirName = cattr.getDiskPath();
this.maxKeySize = cattr.getMaxKeySize();
@@ -598,13 +611,13 @@
{
storageLock.readLock().release();
}
-
+
Set matchingKeys = getKeyMatcher().getMatchingKeysFromArray( pattern, keyArray );
-
+
Iterator keyIterator = matchingKeys.iterator();
while ( keyIterator.hasNext() )
{
- String key = (String)keyIterator.next();
+ String key = (String) keyIterator.next();
ICacheElement element = processGet( key );
if ( element != null )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java Mon Mar 30 20:18:04 2009
@@ -129,9 +129,8 @@
if ( cache == null )
{
- cache = new IndexedDiskCache( cacheAttributes );
+ cache = new IndexedDiskCache( cacheAttributes, getElementSerializer() );
cache.setCacheEventLogger( getCacheEventLogger() );
- cache.setElementSerializer( getElementSerializer() );
caches.put( cacheName, cache );
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java Mon Mar 30 20:18:04 2009
@@ -21,7 +21,7 @@
/**
* Used to dump out a Disk cache from disk for debugging. This is meant to be
- * run as a comman line utility for
+ * run as a command line utility for
*/
public class IndexedDiskDumper
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java Mon Mar 30 20:18:04 2009
@@ -102,7 +102,7 @@
private ICompositeCacheManager cacheMgr;
/** The service found through lookup */
- private String registry;
+ //private String registry;
/**
* Constructs an instance to with the given remote connection parameters. If the connection
@@ -133,7 +133,7 @@
( (CompositeCacheManager) this.cacheMgr ).registerShutdownObserver( this );
}
- this.registry = "//" + host + ":" + port + "/" + service;
+ String registry = "//" + host + ":" + port + "/" + service;
if ( log.isInfoEnabled() )
{
log.info( "Looking up server [" + registry + "]" );
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java Mon Mar 30 20:18:04 2009
@@ -206,7 +206,7 @@
}
/**
- * Adjust the list as needed for a get. This allows childred to control the algorithm
+ * Adjust the list as needed for a get. This allows children to control the algorithm
* <p>
* @param me
*/
Added: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/DateFormatter.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/DateFormatter.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/DateFormatter.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/DateFormatter.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,100 @@
+package org.apache.jcs.utils.date;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
+
+/**
+ * This makes standard formatted dates.
+ * <p>
+ * This is used by the KeyGenerationUtil.
+ */
+public final class DateFormatter
+{
+ /** static methods */
+ private DateFormatter()
+ {
+ // no instances
+ }
+
+ /** DDDHHmm */
+ private static final String dddHHmmFormat = "DDDHHmm";
+
+ /** DDDHHmmss */
+ private static final String dddHHmmssFormat = "DDDHHmmss";
+
+ /** dddHHmmFormatter */
+ private static final DateFormat dddHHmmFormatter = new ThreadSafeSimpleDateFormat( dddHHmmFormat );
+
+ /** dddHHmmssFormatter */
+ private static final DateFormat dddHHmmssFormatter = new ThreadSafeSimpleDateFormat( dddHHmmssFormat );
+
+
+ /**
+ * Takes string that look like 20051017
+ * <p>
+ * @param in in
+ * @return Date for the string, if the input is null, null is returned.
+ * @throws ParseException ParseException
+ */
+ public static Date parseFormattedStringDddHHmm( String in )
+ throws ParseException
+ {
+ Date retval = null;
+ if ( in != null )
+ {
+ retval = dddHHmmFormatter.parse( in );
+ }
+ return retval;
+ }
+
+ /**
+ * gets a date formatted in dddHHmm
+ * <p>
+ * @param in date
+ * @return date as string
+ */
+ public static String getDddHHmm( Date in )
+ {
+ String retval = null;
+ if ( in != null )
+ {
+ retval = dddHHmmFormatter.format( in );
+ }
+ return retval;
+ }
+
+ /**
+ * Takes string that look like 209123934
+ * <p>
+ * @param in in
+ * @return Date for the string, if the input is null, null is returned.
+ * @throws ParseException ParseException
+ */
+ public static Date parseFormattedStringDddHHmmss( String in )
+ throws ParseException
+ {
+ Date retval = null;
+ if ( in != null )
+ {
+ retval = dddHHmmssFormatter.parse( in );
+ }
+ return retval;
+ }
+
+ /**
+ * gets a date formatted in yyyymmddss
+ * <p>
+ * @param in date
+ * @return date as string
+ */
+ public static String getDddHHmmss( Date in )
+ {
+ String retval = null;
+ if ( in != null )
+ {
+ retval = dddHHmmssFormatter.format( in );
+ }
+ return retval;
+ }
+}
Added: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,87 @@
+package org.apache.jcs.utils.date;
+
+import java.text.DateFormatSymbols;
+import java.text.FieldPosition;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * Thread Safe version of SimpleDateFormat
+ * <p>
+ * This class simply synchronizes format and parse for SimpleDateFormat.
+ */
+public class ThreadSafeSimpleDateFormat
+ extends SimpleDateFormat
+{
+ /**
+ * Generated Serial Version ID
+ */
+ private static final long serialVersionUID = -6394173605134585999L;
+
+ /**
+ * Empty Constructor
+ */
+ public ThreadSafeSimpleDateFormat()
+ {
+ super();
+ }
+
+ /**
+ * @param pattern the pattern describing the date and time format
+ */
+ public ThreadSafeSimpleDateFormat( String pattern )
+ {
+ super( pattern );
+ }
+
+ /**
+ * @param pattern the pattern describing the date and time format
+ * @param lenient leniency option - if false, strictly valid dates are enforced
+ */
+ public ThreadSafeSimpleDateFormat( String pattern, boolean lenient )
+ {
+ super( pattern );
+ this.setLenient( lenient );
+ }
+
+ /**
+ * @param pattern the pattern describing the date and time format
+ * @param locale the locale whose date format symbols should be used.
+ */
+ public ThreadSafeSimpleDateFormat( String pattern, Locale locale )
+ {
+ super( pattern, locale );
+ }
+
+ /**
+ * @param pattern the pattern describing the date and time format
+ * @param formatSymbols the date format symbols to be used for formatting.
+ */
+ public ThreadSafeSimpleDateFormat( String pattern, DateFormatSymbols formatSymbols )
+ {
+ super( pattern, formatSymbols );
+ }
+
+ /**
+ * @param date date
+ * @param toAppendTo buffer to append to
+ * @param fieldPosition field position
+ * @return a string buffer with more data in it
+ */
+ public synchronized StringBuffer format( Date date, StringBuffer toAppendTo, FieldPosition fieldPosition )
+ {
+ return super.format( date, toAppendTo, fieldPosition );
+ }
+
+ /**
+ * @param source source
+ * @param pos parse position
+ * @return date
+ */
+ public synchronized Date parse( String source, ParsePosition pos )
+ {
+ return super.parse( source, pos );
+ }
+}
Added: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,166 @@
+package org.apache.jcs.utils.key;
+
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.utils.date.DateFormatter;
+
+/**
+ * This can create and parse request ids. You can use it to generate keys that contain a create time stamp.
+ * <p>
+ * You can set a system property called "KEY_LEAD_NUMBER" to override the lead number. The value
+ * must be a simple int from 1 to 9.
+ */
+public final class KeyGeneratorUtil
+{
+ /** The logger. */
+ private static final Log log = LogFactory.getLog( KeyGeneratorUtil.class );
+
+ /** a temporary counter for generating request ids. */
+ private static int requestCounter = 0;
+
+ /** last reset time. */
+ private static long lastCounterResetTime = System.currentTimeMillis();
+
+ /** defaults to 2 hours. */
+ private static final long DEFAULT_COUNTER_RESET_INTERVAL_MILLIS = 2 * 60 * 60 * 1000;
+
+ /** How often should we reset the counter. */
+ protected static long counterResetIntervalMillis = DEFAULT_COUNTER_RESET_INTERVAL_MILLIS;
+
+ /** The size of the data portion. */
+ private static final int LENGTH_OF_DATE_STRING = 8;
+
+ /**
+ * The name of the system property that can be used to override the default. This allows us to
+ * run multiple instance on a machine.
+ */
+ public static final String KEY_LEAD_NUMBER_PROPERTY_NAME = "KEY_LEAD_NUMBER";
+
+ /** The default lead number. */
+ public static final int DEFAULT_LEAD_NUMBER = 3;
+
+ /** We lead with a number so it can be converted to a number. This is the prefix to all ids. */
+ protected static int leadNumber = DEFAULT_LEAD_NUMBER;
+
+ static
+ {
+ setLeadFromSystemProperty();
+ }
+
+ /** Sets the lead number from a system property */
+ protected static void setLeadFromSystemProperty()
+ {
+ String leadString = System.getProperty( KEY_LEAD_NUMBER_PROPERTY_NAME, String.valueOf( DEFAULT_LEAD_NUMBER ) );
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "leadString = [" + leadString + "]" );
+ }
+ try
+ {
+ leadNumber = Integer.parseInt( leadString );
+ }
+ catch ( NumberFormatException e )
+ {
+ log.error( "Problem parsing lead number system property value. [" + leadString + "]", e );
+ }
+ }
+
+ /**
+ * Creates a query id in the format 1001010121712345 where the first 8 digits (10010101) is a 8
+ * digit number where: 1 is a padding digit and 001 is the first day of the year. The next 3
+ * digits (217) are the decimal representation of the last byte of data in the machine ip (for
+ * example 192.168.1.2 will be 002). The remaining digits (ex. 12345) are some unique number.
+ * These come from a counter that is reset every 2 hours.
+ * <p>
+ * @return long
+ */
+ public static String generateRequestId()
+ {
+ int counter = getNextRequestCounter();
+
+ Date d = new Date();
+ String dateString = DateFormatter.getDddHHmm( d );
+ String finalOctetOfIp = org.apache.jcs.utils.net.AddressUtil.obtainFinalThreeDigitsOfAddressAsString();
+ String queryId = leadNumber + dateString + finalOctetOfIp + counter;
+ return queryId;
+ }
+
+ /**
+ * This DddHHmm.
+ * <p>
+ * This has to get the current year and set it, since the source data does not have the year.
+ * <p>
+ * @param queryId queryId
+ * @return now if we can't parse, else the data from the query id.
+ * @throws ParseException ParseException
+ */
+ public static Date getDateOfShopFromRequestId( String queryId )
+ throws ParseException
+ {
+ Date date = null;
+ if ( queryId != null )
+ {
+ if ( queryId.length() >= LENGTH_OF_DATE_STRING )
+ {
+ Calendar cal = Calendar.getInstance();
+ int year = cal.get( Calendar.YEAR );
+ int dayOfYear;
+ int hour;
+ int minute;
+
+ try
+ {
+ dayOfYear = Integer.parseInt( queryId.substring( 1, 4 ) );
+ hour = Integer.parseInt( queryId.substring( 4, 6 ) );
+ minute = Integer.parseInt( queryId.substring( 6, 8 ) );
+ }
+ catch ( NumberFormatException e )
+ {
+ throw new ParseException( "Error reading date/hour/minute from input string [" + queryId + "]", 0 );
+ }
+
+ cal.set( Calendar.YEAR, year );
+ cal.set( Calendar.DAY_OF_YEAR, dayOfYear );
+ cal.set( Calendar.HOUR_OF_DAY, hour );
+ cal.set( Calendar.MINUTE, minute );
+ date = cal.getTime();
+ }
+ else
+ {
+ throw new ParseException( "The input string is not long enough [" + queryId + "]", queryId.length() );
+ }
+ }
+ else
+ {
+ throw new ParseException( "Can't parse a null string.", 0 );
+ }
+ return date;
+ }
+
+ /**
+ * Automatically increment and return the request counter. If the last counter reset was more
+ * than the interval, reset the counter.
+ * <p>
+ * @return The incremented count.
+ */
+ protected static synchronized int getNextRequestCounter()
+ {
+ long now = System.currentTimeMillis();
+ if ( ( now - KeyGeneratorUtil.lastCounterResetTime ) > KeyGeneratorUtil.counterResetIntervalMillis )
+ {
+ resetCounter();
+ }
+ return ++requestCounter;
+ }
+
+ /** reset the counter and the reset time. */
+ protected static synchronized void resetCounter()
+ {
+ KeyGeneratorUtil.lastCounterResetTime = System.currentTimeMillis();
+ KeyGeneratorUtil.requestCounter = 0;
+ }
+}
Added: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/AddressUtil.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/AddressUtil.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/AddressUtil.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/AddressUtil.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,115 @@
+package org.apache.jcs.utils.net;
+
+import java.net.UnknownHostException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/** Utility for getting info on the local ip address. */
+public final class AddressUtil
+{
+ /** log instance */
+ private static final Log log = LogFactory.getLog( AddressUtil.class );
+
+ /** the default returned string value for the last octet */
+ public static final String DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING = "000";
+
+ /** the default returned string value for the whole ip */
+ public static final String DEFAULT_INTERNET_ADDRESS_AS_STRING = "0.0.0.0";
+
+ /** current address octet as string */
+ private static String currentAddressOctetAsString = null;
+
+ /**
+ * private constructor.
+ */
+ private AddressUtil()
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "private constructor" );
+ }
+ }
+
+ /**
+ * This method looks up the host machines internet address, parses out the last octet and
+ * formats that number as a 3 character string.
+ * @return a string containing the digits of the ip address
+ */
+ public static synchronized String obtainFinalThreeDigitsOfAddressAsString()
+ {
+ if ( currentAddressOctetAsString == null )
+ {
+ currentAddressOctetAsString = obtainFinalThreeDigitsOfAddressAsStringLookup();
+ }
+
+ return currentAddressOctetAsString;
+ }
+
+ /**
+ * This method looks up the host machines internet address, parses out the last octet and
+ * formats that number as a 3 character string.
+ * <p>
+ * @return a string containing the digits of the ip address
+ */
+ private static String obtainFinalThreeDigitsOfAddressAsStringLookup()
+ {
+ String retval = DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING;
+ try
+ {
+ String ipAsString = HostNameUtil.getLocalHostAddress();
+
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "obtainFinalThreeDigitsOfAddressAsStringLookup running; ipstring [" + ipAsString + "]" );
+ }
+
+ int lastdot = ipAsString.lastIndexOf( "." );
+ if ( lastdot != -1 )
+ {
+ if ( lastdot != ipAsString.length() )
+ {
+ ipAsString = ipAsString.substring( lastdot + 1 );
+
+ // pad it out to 3 characters
+ switch ( ipAsString.length() )
+ {
+ case 1:
+ ipAsString = "00" + ipAsString;
+ break;
+ case 2:
+ ipAsString = "0" + ipAsString;
+ break;
+ case 3:
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "3 digits is as we expect" );
+ }
+ break;
+ default:
+ log.warn( "detected invalid ip octet length [" + ipAsString + "] will return default" );
+ ipAsString = DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING;
+
+ break;
+ }
+ retval = ipAsString;
+ }
+ else
+ {
+ log.warn( "ip ends in . ip: " + ipAsString + " returning default: "
+ + DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING );
+ }
+ }
+ else
+ {
+ log.warn( "could not find a . in address: " + ipAsString + " returning default: "
+ + DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING );
+ }
+ }
+ catch ( UnknownHostException e1 )
+ {
+ log.warn( "problem getting host address. returning default: " + DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING );
+ }
+ return retval;
+ }
+}
Modified: jakarta/jcs/trunk/src/test-conf/log4j.properties
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test-conf/log4j.properties?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test-conf/log4j.properties (original)
+++ jakarta/jcs/trunk/src/test-conf/log4j.properties Mon Mar 30 20:18:04 2009
@@ -22,7 +22,7 @@
log4j.category.org.apache.jcs.engine.CacheEventQueueFactory=INFO
log4j.category.org.apache.jcs.auxiliary.disk.jdbc=INFO
log4j.category.org.apache.jcs.auxiliary.disk=INFO
-log4j.category.org.apache.jcs.auxiliary.disk.block=INFO
+log4j.category.org.apache.jcs.auxiliary.disk.block=DEBUG
log4j.category.org.apache.jcs.auxiliary.remote=INFO
log4j.category.org.apache.jcs.auxiliary.lateral=INFO
log4j.category.org.apache.jcs.utils.struct=INFO
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java Mon Mar 30 20:18:04 2009
@@ -1,10 +1,14 @@
package org.apache.jcs.auxiliary.disk.block;
+import java.io.File;
+import java.io.Serializable;
import java.util.Map;
import junit.framework.TestCase;
import org.apache.jcs.engine.CacheElement;
+import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.utils.serialization.StandardSerializer;
/** Unit tests for the Block Disk Cache */
public class BlockDiskCacheUnitTest
@@ -74,4 +78,242 @@
//System.out.println( "matchingResults.keySet() " + matchingResults.keySet() );
//System.out.println( "\nAFTER TEST \n" + diskCache.getStats() );
}
+
+ /**
+ * Verify that the block disk cache can handle a big string.
+ * <p>
+ * @throws Exception
+ */
+ public void SKIPtestChunk_BigString()
+ throws Exception
+ {
+
+ String string = "This is my big string ABCDEFGH";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( " " + i + sb.toString() ); // big string
+ }
+ string = sb.toString();
+
+ StandardSerializer elementSerializer = new StandardSerializer();
+ byte[] data = elementSerializer.serialize( string );
+
+ File file = new File( "target/test-sandbox/BlockDiskCacheUnitTest/testChunk_BigString.data" );
+ BlockDisk blockDisk = new BlockDisk( file, elementSerializer );
+
+ int numBlocksNeeded = blockDisk.calculateTheNumberOfBlocksNeeded( data );
+
+ // get the individual sub arrays.
+ byte[][] chunks = blockDisk.getBlockChunks( data, numBlocksNeeded );
+
+ for ( short i = 0; i < chunks.length; i++ )
+ {
+ byte[] chunk = chunks[i];
+ byte[] newTotal = new byte[data.length + chunk.length];
+ // copy data into the new array
+ System.arraycopy( data, 0, newTotal, 0, data.length );
+ // copy the chunk into the new array
+ System.arraycopy( chunk, 0, newTotal, data.length, chunk.length );
+ // swap the new and old.
+ data = newTotal;
+ }
+
+ Serializable result = (Serializable) elementSerializer.deSerialize( data );
+ System.out.println( result );
+ assertEquals( "wrong string after retrieval", string, result );
+ }
+
+ /**
+ * Verify that the block disk cache can handle a big string.
+ * <p>
+ * @throws Exception
+ */
+ public void SKIPtestPutGet_BigString()
+ throws Exception
+ {
+ String string = "This is my big string ABCDEFGH";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( " " + i + sb.toString() ); // big string
+ }
+ string = sb.toString();
+
+ String cacheName = "testPutGet_BigString";
+
+ BlockDiskCacheAttributes cattr = new BlockDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setBlockSizeBytes( 300 );
+ cattr.setDiskPath( "target/test-sandbox/BlockDiskCacheUnitTest" );
+ BlockDiskCache diskCache = new BlockDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", string ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ assertNotNull( afterElement );
+ System.out.println( "afterElement = " + afterElement );
+ String after = (String) afterElement.getVal();
+
+ assertNotNull( after );
+ assertEquals( "wrong string after retrieval", string, after );
+ }
+
+ /**
+ * Verify that the block disk cache can handle utf encoded strings.
+ * <p>
+ * @throws Exception
+ */
+ public void SKIPtestUTF8String()
+ throws Exception
+ {
+ String string = "Iñtërnâtiônàlizætiøn";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( sb.toString() ); // big string
+ }
+ string = sb.toString();
+
+ //System.out.println( "The string contains " + string.length() + " characters" );
+
+ String cacheName = "testUTF8String";
+
+ BlockDiskCacheAttributes cattr = new BlockDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setBlockSizeBytes( 200 );
+ cattr.setDiskPath( "target/test-sandbox/BlockDiskCacheUnitTest" );
+ BlockDiskCache diskCache = new BlockDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", string ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ assertNotNull( afterElement );
+ System.out.println( "afterElement = " + afterElement );
+ String after = (String) afterElement.getVal();
+
+ assertNotNull( after );
+ assertEquals( "wrong string after retrieval", string, after );
+ }
+
+ /**
+ * Verify that the block disk cache can handle utf encoded strings.
+ * <p>
+ * @throws Exception
+ */
+ public void SKIPtestUTF8ByteArray()
+ throws Exception
+ {
+ String string = "Iñtërnâtiônàlizætiøn";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( sb.toString() ); // big string
+ }
+ string = sb.toString();
+ //System.out.println( "The string contains " + string.length() + " characters" );
+ String UTF8 = "UTF-8";
+ byte[] bytes = string.getBytes( UTF8 );
+
+ String cacheName = "testUTF8ByteArray";
+
+ BlockDiskCacheAttributes cattr = new BlockDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setBlockSizeBytes( 200 );
+ cattr.setDiskPath( "target/test-sandbox/BlockDiskCacheUnitTest" );
+ BlockDiskCache diskCache = new BlockDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", bytes ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ assertNotNull( afterElement );
+ System.out.println( "afterElement = " + afterElement );
+ byte[] after = (byte[]) afterElement.getVal();
+
+ assertNotNull( after );
+ assertEquals( "wrong bytes after retrieval", bytes.length, after.length );
+ //assertEquals( "wrong bytes after retrieval", bytes, after );
+ //assertEquals( "wrong bytes after retrieval", string, new String( after, UTF8 ) );
+
+ }
+
+ /**
+ * Verify that the block disk cache can handle utf encoded strings.
+ * <p>
+ * @throws Exception
+ */
+ public void SKIPtestUTF8StringAndBytes()
+ throws Exception
+ {
+ X before = new X();
+ String string = "Iñtërnâtiônàlizætiøn";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( sb.toString() ); // big string
+ }
+ string = sb.toString();
+ //System.out.println( "The string contains " + string.length() + " characters" );
+ String UTF8 = "UTF-8";
+ before.string = string;
+ before.bytes = string.getBytes( UTF8 );
+
+ String cacheName = "testUTF8StringAndBytes";
+
+ BlockDiskCacheAttributes cattr = new BlockDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setBlockSizeBytes( 500 );
+ cattr.setDiskPath( "target/test-sandbox/BlockDiskCacheUnitTest" );
+ BlockDiskCache diskCache = new BlockDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", before ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ System.out.println( "afterElement = " + afterElement );
+ X after = (X) ( afterElement.getVal() );
+
+ assertNotNull( after );
+ assertEquals( "wrong string after retrieval", string, after.string );
+ assertEquals( "wrong bytes after retrieval", string, new String( after.bytes, UTF8 ) );
+
+ }
+
+ /** Holder for a string and byte array. */
+ static class X
+ implements Serializable
+ {
+ /** ignore */
+ private static final long serialVersionUID = 1L;
+
+ /** Test string */
+ String string;
+
+ /*** test byte array. */
+ byte[] bytes;
+ }
}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java Mon Mar 30 20:18:04 2009
@@ -745,7 +745,7 @@
//System.out.println( "matchingResults.keySet() " + matchingResults.keySet() );
//System.out.println( "\nAFTER TEST \n" + diskCache.getStats() );
}
-
+
/**
* Test the basic get matching. With no wait this will all come from purgatory.
* <p>
@@ -776,5 +776,91 @@
assertEquals( "Wrong number returned", 10, matchingResults.size() );
//System.out.println( "matchingResults.keySet() " + matchingResults.keySet() );
//System.out.println( "\nAFTER TEST \n" + diskCache.getStats() );
- }
+ }
+
+ /**
+ * Verify that the block disk cache can handle utf encoded strings.
+ * <p>
+ * @throws Exception
+ */
+ public void testUTF8String()
+ throws Exception
+ {
+ String string = "Iñtërnâtiônàlizætiøn";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( sb.toString() ); // big string
+ }
+ string = sb.toString();
+
+ //System.out.println( "The string contains " + string.length() + " characters" );
+
+ String cacheName = "testUTF8String";
+
+ IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
+ IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", string ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ assertNotNull( afterElement );
+ System.out.println( "afterElement = " + afterElement );
+ String after = (String) afterElement.getVal();
+
+ assertNotNull( after );
+ assertEquals( "wrong string after retrieval", string, after );
+ }
+
+ /**
+ * Verify that the block disk cache can handle utf encoded strings.
+ * <p>
+ * @throws Exception
+ */
+ public void testUTF8ByteArray()
+ throws Exception
+ {
+ String string = "Iñtërnâtiônàlizætiøn";
+ StringBuffer sb = new StringBuffer();
+ sb.append( string );
+ for ( int i = 0; i < 4; i++ )
+ {
+ sb.append( sb.toString() ); // big string
+ }
+ string = sb.toString();
+ //System.out.println( "The string contains " + string.length() + " characters" );
+ String UTF8 = "UTF-8";
+ byte[] bytes = string.getBytes( UTF8 );
+
+ String cacheName = "testUTF8ByteArray";
+
+ IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
+ cattr.setCacheName( cacheName );
+ cattr.setMaxKeySize( 100 );
+ cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
+ IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
+
+ // DO WORK
+ diskCache.update( new CacheElement( cacheName, "x", bytes ) );
+
+ // VERIFY
+ assertNotNull( diskCache.get( "x" ) );
+ Thread.sleep( 1000 );
+ ICacheElement afterElement = diskCache.get( "x" );
+ assertNotNull( afterElement );
+ System.out.println( "afterElement = " + afterElement );
+ byte[] after = (byte[]) afterElement.getVal();
+
+ assertNotNull( after );
+ assertEquals( "wrong bytes after retrieval", string, new String( after, UTF8 ) );
+ }
+
}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java Mon Mar 30 20:18:04 2009
@@ -1,34 +1,52 @@
package org.apache.jcs.auxiliary.disk.indexed;
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
import org.apache.jcs.auxiliary.MockCacheEventLogger;
-import org.apache.jcs.engine.behavior.IElementSerializer;
+import org.apache.jcs.engine.CacheElement;
+import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
-
-import junit.framework.TestCase;
+import org.apache.jcs.utils.timing.SleepUtil;
/** Unit tests for the manager */
public class IndexedDiskCacheManagerUnitTest
extends TestCase
{
- /** Verify that the disk cache has the event logger */
+ /**
+ * Verify that the disk cache has the event logger
+ * @throws IOException
+ */
public void testGetCache_normal()
+ throws IOException
{
// SETUP
String cacheName = "testGetCache_normal";
IndexedDiskCacheAttributes defaultCacheAttributes = new IndexedDiskCacheAttributes();
defaultCacheAttributes.setDiskPath( "target/IndexedDiskCacheManagerUnitTest" );
-
+
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
- IElementSerializer elementSerializer = new MockElementSerializer();
-
- IndexedDiskCacheManager manager = IndexedDiskCacheManager.getInstance( defaultCacheAttributes, cacheEventLogger, elementSerializer );
-
+ MockElementSerializer elementSerializer = new MockElementSerializer();
+
+ String key = "myKey";
+ ICacheElement cacheElement = new CacheElement( "test", key, "MyValue" );
+
+ IndexedDiskCacheManager manager = IndexedDiskCacheManager.getInstance( defaultCacheAttributes,
+ cacheEventLogger, elementSerializer );
+
// DO WORK
- IndexedDiskCache cache = (IndexedDiskCache)manager.getCache( cacheName );
-
+ IndexedDiskCache cache = (IndexedDiskCache) manager.getCache( cacheName );
+
+ cache.update( cacheElement );
+ SleepUtil.sleepAtLeast( 100 );
+ cache.get( key );
+
// VERIFY
- assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger());
- assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer());
+ assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );
+ assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer() );
+ assertEquals( "Wrong serialize count", elementSerializer.serializeCount, 1 );
+ assertEquals( "Wrong deSerialize count", elementSerializer.deSerializeCount, 1 );
}
}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java Mon Mar 30 20:18:04 2009
@@ -33,9 +33,6 @@
/**
* Test which exercises the indexed disk cache. Runs three threads against the
* same region.
- *
- * @version $Id: TestDiskCacheConcurrent.java,v 1.8 2005/02/01 00:01:59 asmuts
- * Exp $
*/
public class IndexedDiskCacheSameRegionConcurrentUnitTest
extends TestCase
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,33 @@
+package org.apache.jcs.auxiliary.remote.http.client;
+
+import junit.framework.TestCase;
+
+import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
+
+/** Unit tests for the dispatcher. */
+public class RemoteHttpCacheDispatcherUniTest
+ extends TestCase
+{
+ /**
+ * Verify that we don't get two ?'s
+ */
+ public void testAddParameters_withQueryString()
+ {
+ // SETUP
+ RemoteHttpCacheAttributes remoteHttpCacheAttributes = new RemoteHttpCacheAttributes();
+ RemoteHttpCacheDispatcher dispatcher = new RemoteHttpCacheDispatcher( remoteHttpCacheAttributes );
+
+ RemoteCacheRequest remoteCacheRequest = new RemoteCacheRequest();
+ remoteCacheRequest.setRequestType( RemoteCacheRequest.REQUEST_TYPE_REMOVE_ALL );
+ String cacheName = "myCache";
+ remoteCacheRequest.setCacheName( cacheName );
+
+ String baseUrl = "http://localhost?thishasaquestionmark";
+
+ // DO WORK
+ String result = dispatcher.addParameters( remoteCacheRequest, baseUrl );
+
+ // VERIFY
+ assertEquals( "Wrong url", baseUrl + "&CacheName=" + cacheName + "&Key=&RequestType=RemoveAll", result );
+ }
+}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/MockElementSerializer.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/MockElementSerializer.java?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/MockElementSerializer.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/engine/control/MockElementSerializer.java Mon Mar 30 20:18:04 2009
@@ -16,6 +16,12 @@
/** What's used in the background */
private StandardSerializer serializer = new StandardSerializer();
+ /** times out was called */
+ public int deSerializeCount = 0;
+
+ /** times in was called */
+ public int serializeCount = 0;
+
/**
* @param bytes
* @return Object
@@ -26,6 +32,7 @@
public Object deSerialize( byte[] bytes )
throws IOException, ClassNotFoundException
{
+ deSerializeCount++;
return serializer.deSerialize( bytes );
}
@@ -38,6 +45,7 @@
public byte[] serialize( Serializable obj )
throws IOException
{
+ serializeCount++;
return serializer.serialize( obj );
}
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,98 @@
+package org.apache.jcs.utils.date;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+/** Simple tests for the date formatter utility. */
+public class DateFormatterUnitTest
+ extends TestCase
+{
+ /**
+ * Output a date into a String like 3591010.
+ */
+ public void testGetDddHHmm()
+ {
+ // SETUP
+ Calendar c = Calendar.getInstance();
+ c.set( Calendar.DATE, 25 );
+ c.set( Calendar.MONTH, Calendar.DECEMBER );
+ c.set( Calendar.YEAR, 2005 );
+ c.set( Calendar.HOUR_OF_DAY, 10 );
+ c.set( Calendar.MINUTE, 10 );
+
+ // DO WORK
+ String formatted = DateFormatter.getDddHHmm( c.getTime() );
+
+ // VERIFY
+ assertNotNull( "Missing formatted date", formatted );
+ assertEquals( "Incorrectly formatted date", "3591010", formatted.toUpperCase() );
+ }
+
+ /**
+ * Verify that we can get a date from a string
+ * @throws Exception on error
+ */
+ public void testParseFormattedStringDddHHmm()
+ throws Exception
+ {
+ // SETUP
+ String formatted = "3591017";
+
+ // DO WORK
+ Date date = DateFormatter.parseFormattedStringDddHHmm( formatted );
+
+ // VERIFY
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime( date );
+ assertEquals( "Month is wrong", 12, calendar.get( Calendar.MONTH ) + 1 );
+ assertEquals( "Date is wrong", 25, calendar.get( Calendar.DATE ) );
+ assertEquals( "Hour is wrong", 10, calendar.get( Calendar.HOUR ) );
+ assertEquals( "Minute is wrong", 17, calendar.get( Calendar.MINUTE ) );
+ }
+
+ /**
+ * Output a date into a String like 359101001.
+ */
+ public void testGetDddHHmmss()
+ {
+ // SETUP
+ Calendar c = Calendar.getInstance();
+ c.set( Calendar.DATE, 25 );
+ c.set( Calendar.MONTH, Calendar.DECEMBER );
+ c.set( Calendar.YEAR, 2005 );
+ c.set( Calendar.HOUR_OF_DAY, 10 );
+ c.set( Calendar.MINUTE, 10 );
+ c.set( Calendar.SECOND, 01 );
+
+ // DO WORK
+ String formatted = DateFormatter.getDddHHmmss( c.getTime() );
+
+ // VERIFY
+ assertNotNull( "Missing formatted date", formatted );
+ assertEquals( "Incorrectly formatted date", "359101001", formatted.toUpperCase() );
+ }
+
+ /**
+ * Verify that we can get a date from a string
+ * @throws Exception on error
+ */
+ public void testParseFormattedStringDddHHmmss()
+ throws Exception
+ {
+ String formatted = "359101701";
+
+ // DO WORK
+ Date date = DateFormatter.parseFormattedStringDddHHmmss( formatted );
+
+ // VERIFY
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime( date );
+ assertEquals( "Month is wrong", 12, calendar.get( Calendar.MONTH ) + 1 );
+ assertEquals( "Date is wrong", 25, calendar.get( Calendar.DATE ) );
+ assertEquals( "Hour is wrong", 10, calendar.get( Calendar.HOUR ) );
+ assertEquals( "Minute is wrong", 17, calendar.get( Calendar.MINUTE ) );
+ assertEquals( "Second is wrong", 1, calendar.get( Calendar.SECOND ) );
+ }
+}
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,145 @@
+package org.apache.jcs.utils.date;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.utils.timing.SleepUtil;
+
+/**
+ * Multi-threaded tests for SimpleDateFormat.
+ */
+public class ThreadSafeSimpleDateFormatUnitTest
+ extends TestCase
+{
+ /** log instance */
+ private static final Log log = LogFactory.getLog( ThreadSafeSimpleDateFormatUnitTest.class );
+
+ /** date format string */
+ private static final String DATE_FORMAT_STRING = "yyyy-MM-dd kk:mm:ss:SSS";
+
+ /** test run length */
+ private static final int TEST_RUN_LENGTH = 100;
+
+ /** number of threads */
+ private static final int NUM_THREADS = 50;
+
+ /** random number generator */
+ private static final Random random = new Random();
+
+ /** number wrong */
+ private int numWrong = 0;
+
+ /** number of loops? */
+ private int numLoops = 0;
+
+ /** run? */
+ private boolean run = false;
+
+ /** a simpledateformat instance */
+ private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT_STRING );
+
+ /** a threadsafe simpledateformat instance */
+ private ThreadSafeSimpleDateFormat threadSafeSimpleDateFormat = new ThreadSafeSimpleDateFormat( DATE_FORMAT_STRING );
+
+ /** date format */
+ private DateFormat dateFormat;
+
+ /**
+ * Tests to make sure that format produces the same string on the thread-safe implementation as
+ * it does on the regular one.
+ */
+ public void testFormat()
+ {
+ Date now = new Date();
+ String regularFormatted = simpleDateFormat.format( now );
+ String threadSafeFormatted = threadSafeSimpleDateFormat.format( now );
+
+ assertEquals( "Two formatted strings should be equal", regularFormatted, threadSafeFormatted );
+ }
+
+ /**
+ * Tests to make sure that parse produces the same date on the thread-safe implementation as it
+ * does on the regular one.
+ * <p>
+ * @throws ParseException if there was a problem parsing the line.
+ */
+ public void testParse()
+ throws ParseException
+ {
+ String dateString = "2006-01-11 21:03:37:719";
+ Date regularDate = simpleDateFormat.parse( dateString );
+ Date threadSafeDate = threadSafeSimpleDateFormat.parse( dateString );
+
+ assertEquals( "Two dates should be equal", regularDate, threadSafeDate );
+ }
+
+ /**
+ * Tests to make sure that the pooled implementation works.
+ */
+ public void testThreadSafeDateFormatWorks()
+ {
+ dateFormat = threadSafeSimpleDateFormat;
+
+ // Reset the counter.
+ numWrong = 0;
+ numLoops = 0;
+ run = true;
+
+ for ( int i = 0; i < NUM_THREADS; i++ )
+ {
+ Thread thread = createSimpleDateFormatTestThread();
+ thread.start();
+ }
+
+ // Let the threads run a bit...
+ SleepUtil.sleepAtLeast( TEST_RUN_LENGTH );
+
+ // Stop the threads.
+ run = false;
+
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Thread Safe Test - NumLoops: " + numLoops + " NumWrong: " + numWrong );
+ }
+ assertEquals( "Thread, we should get no wrongly formatted dates", 0, numWrong );
+ }
+
+ /**
+ * Creates a test thread that records how many times a date is formatted wrong by creating and
+ * formatting random dates.
+ * <p>
+ * @return an unstarted thread.
+ */
+ private Thread createSimpleDateFormatTestThread()
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ Date date = new Date( System.currentTimeMillis() + random.nextInt( 60 * 60 * 1000 ) );
+
+ String properDate = dateFormat.format( date );
+
+ while ( run )
+ {
+ numLoops++;
+ // Get an SimpleDateFormat object from the pool, and creates the formatted date.
+ String formattedDate = dateFormat.format( date );
+ if ( !properDate.equals( formattedDate ) )
+ {
+ numWrong++;
+ }
+ SleepUtil.sleepAtLeast( 1 );
+ }
+ }
+ };
+ return thread;
+ }
+}
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,226 @@
+package org.apache.jcs.utils.key;
+
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.apache.jcs.utils.date.DateFormatter;
+import org.apache.jcs.utils.timing.SleepUtil;
+
+/**
+ * Tests for the Key Generator Util.
+ */
+public class KeyGeneratorUtilUnitTest
+ extends TestCase
+{
+ /**
+ * Creates a query id. Verify that we lead with the system lead.
+ */
+ public void testGetQueryId_SytemLeadNumber_Good()
+ {
+ // SETUP
+ String lead = "9";
+ System.setProperty( KeyGeneratorUtil.KEY_LEAD_NUMBER_PROPERTY_NAME, lead );
+ // have to force this since it might have already been loaded.
+ KeyGeneratorUtil.setLeadFromSystemProperty();
+ String expectedDate = DateFormatter.getDddHHmm( new Date() );
+
+ // DO WORK
+ String result = KeyGeneratorUtil.generateRequestId();
+
+ // VERIFY
+ assertNotNull( "We should have a query id.", result );
+ assertTrue( "Should have the input.", result.indexOf( String.valueOf( expectedDate ) ) != -1 );
+ assertEquals( "Wrong lead", lead, result.substring( 0, 1 ) );
+ }
+
+ /**
+ * Creates a query id. Verify that we lead with the default if the system lead is junk.
+ */
+ public void testGetQueryId_SytemLeadNumber_Nan()
+ {
+ // SETUP
+ KeyGeneratorUtil.leadNumber = KeyGeneratorUtil.DEFAULT_LEAD_NUMBER;
+ String lead = "afdsafsadf";
+ System.setProperty( KeyGeneratorUtil.KEY_LEAD_NUMBER_PROPERTY_NAME, lead );
+ // have to force this since it might have already been loaded.
+ KeyGeneratorUtil.setLeadFromSystemProperty();
+ String expectedDate = DateFormatter.getDddHHmm( new Date() );
+
+ // DO WORK
+ String result = KeyGeneratorUtil.generateRequestId();
+
+ // VERIFY
+ assertNotNull( "We should have a query id.", result );
+ assertTrue( "Should have the input.", result.indexOf( String.valueOf( expectedDate ) ) != -1 );
+ assertEquals( "Wrong lead", String.valueOf( KeyGeneratorUtil.DEFAULT_LEAD_NUMBER ), result.substring( 0, 1 ) );
+ }
+
+ /**
+ * Creates a query id.
+ */
+ public void testGetQueryId()
+ {
+ // SETUP
+ String expectedDate = DateFormatter.getDddHHmm( new Date() );
+
+ // DO WORK
+ String result = KeyGeneratorUtil.generateRequestId();
+
+ // VERIFY
+ assertNotNull( "We should have a query id.", result );
+ assertTrue( "Should have the input.", result.indexOf( String.valueOf( expectedDate ) ) != -1 );
+ }
+
+ /**
+ * Verify that we get the right date out. This has just the leading 9 and the date.
+ */
+ public void testGetDateFromQueryId_exact()
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.set( Calendar.HOUR_OF_DAY, 13 );
+ cal.set( Calendar.MINUTE, 59 );
+
+ String inputDate = DateFormatter.getDddHHmm( cal.getTime() );
+
+ // DO WORK
+ try
+ {
+ Date result = KeyGeneratorUtil.getDateOfShopFromRequestId( "9" + inputDate );
+
+ // VERIFY
+ Calendar resultCal = Calendar.getInstance();
+ resultCal.setTime( result );
+
+ assertEquals( "Wrong day of year.", cal.get( Calendar.DAY_OF_YEAR ), resultCal.get( Calendar.DAY_OF_YEAR ) );
+ assertEquals( "Wrong hour.", cal.get( Calendar.HOUR_OF_DAY ), resultCal.get( Calendar.HOUR_OF_DAY ) );
+ assertEquals( "Wrong minute.", cal.get( Calendar.MINUTE ), resultCal.get( Calendar.MINUTE ) );
+ }
+ catch ( ParseException e )
+ {
+ fail( e.getMessage() );
+ }
+ }
+
+ /**
+ * Verify that we get the right date out. This has the leading 9, the date, and more
+ */
+ public void testGetDateFromQueryId_over()
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.set( Calendar.HOUR_OF_DAY, 13 );
+ cal.set( Calendar.MINUTE, 59 );
+
+ String inputDate = DateFormatter.getDddHHmm( cal.getTime() );
+
+ // DO WORK
+ try
+ {
+ Date result = KeyGeneratorUtil.getDateOfShopFromRequestId( "9" + inputDate + "542143211242134" );
+
+ // VERIFY
+ Calendar resultCal = Calendar.getInstance();
+ resultCal.setTime( result );
+
+ assertEquals( "Wrong day of year.", cal.get( Calendar.DAY_OF_YEAR ), resultCal.get( Calendar.DAY_OF_YEAR ) );
+ assertEquals( "Wrong hour.", cal.get( Calendar.HOUR_OF_DAY ), resultCal.get( Calendar.HOUR_OF_DAY ) );
+ assertEquals( "Wrong minute.", cal.get( Calendar.MINUTE ), resultCal.get( Calendar.MINUTE ) );
+ }
+ catch ( ParseException e )
+ {
+ fail( e.getMessage() );
+ }
+ }
+
+ /**
+ * Verify that we get an error if it is too small
+ */
+ public void testGetDateFromQueryId_tooSmall()
+ {
+ // DO WORK
+ try
+ {
+ KeyGeneratorUtil.getDateOfShopFromRequestId( "9876" );
+
+ fail( "We should have an error." );
+ }
+ catch ( ParseException e )
+ {
+ // expected
+ assertTrue( "Missing string from error message.", e.getMessage().indexOf( "9876" ) != -1 );
+ }
+ }
+
+ /**
+ * Verify that we get an error if it is null
+ */
+ public void testGetDateFromQueryId_null()
+ {
+ // DO WORK
+ try
+ {
+ KeyGeneratorUtil.getDateOfShopFromRequestId( null );
+
+ fail( "We should have an error." );
+ }
+ catch ( ParseException e )
+ {
+ // expected
+ assertTrue( "Missing string from error message.", e.getMessage().indexOf( "null" ) != -1 );
+ }
+ }
+
+ /**
+ * Reset and verify that we get 1;
+ */
+ public void testGetNextRequestCounter_simple()
+ {
+ // SETUP
+ KeyGeneratorUtil.resetCounter();
+
+ // DO WORK
+ int result = KeyGeneratorUtil.getNextRequestCounter();
+
+ // VERIFY
+ assertEquals( "Wrong counter value.", 1, result );
+ }
+
+ /**
+ * Reset, call twice, and verify that we get 2;
+ */
+ public void testGetNextRequestCounter_twice()
+ {
+ // SETUP
+ KeyGeneratorUtil.resetCounter();
+
+ // DO WORK
+ KeyGeneratorUtil.getNextRequestCounter();
+ int result = KeyGeneratorUtil.getNextRequestCounter();
+
+ // VERIFY
+ assertEquals( "Wrong counter value.", 2, result );
+ }
+
+ /**
+ * Verify that the counter is reset if we set the interval vey low.
+ */
+ public void testGetNextRequestCounter_delay()
+ {
+ // SETUP
+ long interval = 10;
+ KeyGeneratorUtil.counterResetIntervalMillis = interval;
+ KeyGeneratorUtil.resetCounter();
+
+ // DO WORK
+ KeyGeneratorUtil.getNextRequestCounter();
+
+ SleepUtil.sleepAtLeast( interval * 2 );
+
+ int result = KeyGeneratorUtil.getNextRequestCounter();
+
+ // VERIFY
+ assertEquals( "Wrong counter value.", 1, result );
+ }
+}
Added: jakarta/jcs/trunk/src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java?rev=760146&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java (added)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java Mon Mar 30 20:18:04 2009
@@ -0,0 +1,20 @@
+package org.apache.jcs.utils.net;
+
+import junit.framework.TestCase;
+
+/**
+ * Basic AddressUtil Test class.
+ */
+public class AddressUtilUnitTest
+ extends TestCase
+{
+ /**
+ * test the basics
+ */
+ public void testOctetBasicAddressParsing()
+ {
+ String tempStr = AddressUtil.obtainFinalThreeDigitsOfAddressAsString();
+ assertNotNull( "some result shoudl come back", tempStr );
+ assertTrue( "shoudl not be default", !tempStr.equals( "000" ) );
+ }
+}
Modified: jakarta/jcs/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/changes.xml?rev=760146&r1=760145&r2=760146&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/changes.xml (original)
+++ jakarta/jcs/trunk/xdocs/changes.xml Mon Mar 30 20:18:04 2009
@@ -21,8 +21,15 @@
<body>
<release version="1.4-dev" date="in SVN">
</release>
+ <release version="1.3.2.9" date="2009-02-02" description="tempbuild">
+ <action dev="asmuts" type="fix">Fixed bug in Remote Http Client
+ URL creation for query strings.</action>
+ <action dev="asmuts" type="fix" issue="JCS-55" due-to="Alexander Sofronov"> Fixed
+ disk cache custom serializer injection.</action>
+ </release>
<release version="1.3.2.8" date="2008-12-16" description="tempbuild">
- <action dev="asmuts" type="fix">Fixed bug remote cache listener interface.</action>
+ <action dev="asmuts" type="fix">Fixed bug remote cache listener
+ interface.</action>
</release>
<release version="1.3.2.7" date="2008-12-15" description="tempbuild">
<action dev="asmuts" type="update">Added a simple http remote