psUpdate.setBytes( 1, element ); Timestamp createTime = new Timestamp( ce.getElementAttributes().getCreateTime() ); psUpdate.setTimestamp( 2, createTime );
psUpdate.setBytes( 1, element ); Timestamp createTime = new Timestamp( ce.getElementAttributes().getCreateTime() ); psUpdate.setTimestamp( 2, createTime );
String.valueOf( key ), attributes.getIsEternal(), format.format(new Date(attributes.getCreateTime())), attributes.getMaxLife(), (now - attributes.getCreateTime() - attributes.getMaxLife() * 1000 ) / -1000);
String.valueOf( key ), attributes.getIsEternal(), format.format(new Date(attributes.getCreateTime())), attributes.getMaxLife(), (now - attributes.getCreateTime() - attributes.getMaxLife() * 1000 ) / -1000);
Timestamp createTime = new Timestamp( ce.getElementAttributes().getCreateTime() ); psInsert.setTimestamp( 6, createTime );
Timestamp createTime = new Timestamp( ce.getElementAttributes().getCreateTime() ); psInsert.setTimestamp( 6, createTime );
long createTime = attributes.getCreateTime();
long createTime = attributes.getCreateTime();
/** * Test that cloned ElementAttributes have different creation times. * @throws Exception */ public void testElementAttributesCreationTime() throws Exception { ElementAttributes elem1 = new ElementAttributes(); long ctime1 = elem1.getCreateTime(); Thread.sleep(10); IElementAttributes elem2 = elem1.clone(); long ctime2 = elem2.getCreateTime(); assertFalse("Creation times should be different", ctime1 == ctime2); }
/** * * @throws Exception */ public void testSimpleElementRetrieval() throws Exception { CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" ); jcs.put( "test_key", "test_data" ); long now = System.currentTimeMillis(); ICacheElement<String, String> elem = jcs.getCacheElement( "test_key" ); assertEquals( "Name wasn't right", "testCache1", elem.getCacheName() ); long diff = now - elem.getElementAttributes().getCreateTime(); assertTrue( "Create time should have been at or after the call", diff >= 0 ); }
/** * * @throws Exception */ public void testSimpleElementRetrieval() throws Exception { CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" ); jcs.put( "test_key", "test_data" ); long now = System.currentTimeMillis(); ICacheElement<String, String> elem = jcs.getCacheElement( "test_key" ); assertEquals( "Name wasn't right", "testCache1", elem.getCacheName() ); long diff = now - elem.getElementAttributes().getCreateTime(); assertTrue( "Create time should have been at or after the call", diff >= 0 ); }