JBoss Cache SVN: r7127 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-12 16:48:08 -0500 (Wed, 12 Nov 2008)
New Revision: 7127
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-11-12 21:22:19 UTC (rev 7126)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-11-12 21:48:08 UTC (rev 7127)
@@ -319,6 +319,11 @@
assertTrue(buddyLocalAddress + " should be a buddy to " + group.getGroupName(), group.getBuddies().contains(buddyLocalAddress));
}
+ public void waitForBuddy(Cache dataOwner, Cache buddy, boolean onlyBuddy) throws Exception
+ {
+ waitForBuddy(dataOwner, buddy, onlyBuddy, 60000);
+ }
+
public void waitForBuddy(Cache dataOwner, Cache buddy, boolean onlyBuddy, long timeout) throws Exception
{
long start = System.currentTimeMillis();
17 years, 1 month
JBoss Cache SVN: r7126 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-12 16:22:19 -0500 (Wed, 12 Nov 2008)
New Revision: 7126
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java 2008-11-12 20:44:39 UTC (rev 7125)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java 2008-11-12 21:22:19 UTC (rev 7126)
@@ -58,6 +58,9 @@
c1.activate();
cache1.put(A_B, "name", JOE);
+ waitForBuddy(cache2, cache1, true);
+ waitForBuddy(cache1, cache2, true);
+
// TestingUtil.sleepThread(getSleepTimeout());
System.out.println("Cache dump BEFORE activation");
17 years, 1 month
JBoss Cache SVN: r7125 - core/trunk/src/test/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-12 15:44:39 -0500 (Wed, 12 Nov 2008)
New Revision: 7125
Modified:
core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java 2008-11-12 20:43:47 UTC (rev 7124)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java 2008-11-12 20:44:39 UTC (rev 7125)
@@ -204,7 +204,6 @@
try
{
rollback();
- System.out.println("Rollback executed");
}
catch (Exception exception)
{
17 years, 1 month
JBoss Cache SVN: r7124 - core/trunk/src/test/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-12 15:43:47 -0500 (Wed, 12 Nov 2008)
New Revision: 7124
Modified:
core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java 2008-11-12 17:47:12 UTC (rev 7123)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTransactionManager.java 2008-11-12 20:43:47 UTC (rev 7124)
@@ -62,7 +62,6 @@
private class TimedOutTransactionsChecker extends Thread
{
- private boolean running;
public TimedOutTransactionsChecker()
{
@@ -70,12 +69,11 @@
public void run()
{
- running = true;
- while (running)
+ while (true)
{
try
{
- Thread.sleep(500);
+ Thread.sleep(50);
synchronized (this)
{
Iterator<AsyncRollbackTransaction> iterator = txMap.values().iterator();
@@ -104,7 +102,6 @@
}
}
}
-
}
public void begin() throws NotSupportedException, SystemException
@@ -207,6 +204,7 @@
try
{
rollback();
+ System.out.println("Rollback executed");
}
catch (Exception exception)
{
17 years, 1 month
JBoss Cache SVN: r7123 - in core/trunk/src: test/java/org/jboss/cache/api/pfer and 9 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-12 12:47:12 -0500 (Wed, 12 Nov 2008)
New Revision: 7123
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticTestBase.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/EmptyRegionTest.java
core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
core/trunk/src/test/java/org/jboss/cache/eviction/ElementSizePolicyTest.java
core/trunk/src/test/java/org/jboss/cache/lock/ReadWriteLockWithUpgradeTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/CacheLoaderMarshallingJDBCTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/CustomCollectionTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/RegionBasedMarshallingTestBase.java
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java
core/trunk/src/test/java/org/jboss/cache/notifications/BuddyGroupChangeNotificationTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java
core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java
Log:
fixing tests
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -1,24 +1,24 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.cache.commands.remote;
import org.apache.commons.logging.Log;
@@ -264,15 +264,29 @@
{
if (isSingleCommand())
{
- return getSingleModification().getClass().equals(aClass);
+
+ return isCommandWithType(getSingleModification(), aClass);
}
else
{
for (ReplicableCommand command : getModifications())
{
- if (command.getClass().equals(aClass)) return true;
+ if (isCommandWithType(command, aClass)) return true;
}
}
return false;
}
+
+ private boolean isCommandWithType(ReplicableCommand command, Class<? extends ReplicableCommand> aClass)
+ {
+ if (command.getClass().equals(aClass)) return true;
+ if (command instanceof ReplicateCommand)
+ {
+ return ((ReplicateCommand) command).containsCommandType(aClass);
+ }
+ else
+ {
+ return false;
+ }
+ }
}
\ No newline at end of file
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticTestBase.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PFERPessimisticTestBase.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -2,6 +2,8 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
+import org.jboss.cache.util.internals.ReplicationListener;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.lock.NodeLock;
import static org.testng.AssertJUnit.*;
@@ -38,8 +40,12 @@
{
PutForExternalReadTestBaseTL threadCfg = threadLocal.get();
// create the parent node first ...
+ threadCfg.replListener2 = new ReplicationListener(threadCfg.cache2);
+ threadCfg.replListener2.smartExpect(PutKeyValueCommand.class, false);
threadCfg.cache1.put(parentFqn, key, value);
+ threadCfg.replListener2.waitForReplicationToOccur(10000);
+ threadCfg.replListener2.smartExpect(PutKeyValueCommand.class, true);
threadCfg.tm1.begin();
threadCfg.cache1.put(parentFqn, key, value2);
@@ -59,7 +65,7 @@
threadCfg.tm1.resume(t);
threadCfg.tm1.commit();
- asyncWait();
+ threadCfg.replListener2.waitForReplicationToOccur(1000);
assertEquals("Parent node write should have succeeded", value2, threadCfg.cache1.get(parentFqn, key));
if (isUsingInvalidation())
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -65,6 +65,7 @@
tl.cache1 = (CacheSPI<String, String>) cf.createCache(UnitTestCacheConfigurationFactory.createConfiguration(cacheMode), false);
tl.cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ tl.cache1.getConfiguration().setSerializationExecutorPoolSize(0);//this is very important for async tests!
tl.cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
tl.cache1.start();
@@ -72,6 +73,7 @@
tl.cache2 = (CacheSPI<String, String>) cf.createCache(UnitTestCacheConfigurationFactory.createConfiguration(cacheMode), false);
tl.cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ tl.cache2.getConfiguration().setSerializationExecutorPoolSize(0); //this is very important for async tests!
tl.cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
tl.cache2.start();
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -319,6 +319,39 @@
assertTrue(buddyLocalAddress + " should be a buddy to " + group.getGroupName(), group.getBuddies().contains(buddyLocalAddress));
}
+ public void waitForBuddy(Cache dataOwner, Cache buddy, boolean onlyBuddy, long timeout) throws Exception
+ {
+ long start = System.currentTimeMillis();
+ while ((System.currentTimeMillis() - start) < timeout)
+ {
+ if (isBuddy(dataOwner, buddy, onlyBuddy)) return;
+ Thread.sleep(50);
+ }
+ //give it a last chance, just to have a nice printed message
+ assertIsBuddy(dataOwner, buddy, onlyBuddy);
+ }
+
+
+ private boolean isBuddy(Cache dataOwner, Cache buddy, boolean onlyBuddy)
+ {
+ Address dataOwnerLocalAddress = dataOwner.getLocalAddress();
+ Address buddyLocalAddress = buddy.getLocalAddress();
+ printBuddyGroup(dataOwner);
+ BuddyManager dataOwnerBuddyManager = ((CacheSPI) dataOwner).getBuddyManager();
+ BuddyManager buddyBuddyManager = ((CacheSPI) buddy).getBuddyManager();
+ boolean result = true;
+ // lets test things on the data owner's side of things
+ if (onlyBuddy) result = result && (1 == dataOwnerBuddyManager.getBuddyAddresses().size());
+ result = result && dataOwnerBuddyManager.getBuddyAddresses().contains(buddyLocalAddress);
+
+ // and now on the buddy end
+ BuddyGroup group = buddyBuddyManager.buddyGroupsIParticipateIn.get(dataOwnerLocalAddress);
+ result = result & buddyBuddyManager.buddyGroupsIParticipateIn.containsKey(dataOwnerLocalAddress);
+ if (onlyBuddy) result = result && group.getBuddies().size() == 1;
+ result = result & group!= null && group.getBuddies() != null && group.getBuddies().contains(buddyLocalAddress);
+ return result;
+ }
+
protected void assertNoLocks(List<CacheSPI<Object, Object>> caches)
{
for (Cache cache : caches)
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/EmptyRegionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/EmptyRegionTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/EmptyRegionTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -28,7 +28,7 @@
Fqn regionFqn = Fqn.fromString("/a/b/c");
Fqn region2Fqn = Fqn.fromString("/d/e/f");
Region region, region2;
- CountDownLatch buddyJoinLatch = new CountDownLatch(1);
+ CountDownLatch buddyJoinLatch = new CountDownLatch(2);
@BeforeMethod
public void setUp() throws Exception
@@ -62,6 +62,7 @@
assert c1.getNode(regionFqn) == null : "Node should not exist";
assert c1.getRegion(regionFqn, false) != null : "Region should exist";
assert c1.getRegion(regionFqn, false).isActive() : "Region should be active";
+ c1.addCacheListener(new BuddyJoinListener());
// now start c2
c2.start();
@@ -84,6 +85,7 @@
@BuddyGroupChanged
public void buddyJoined(Event e)
{
+ System.out.println("e = " + e);
buddyJoinLatch.countDown();
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -5,14 +5,17 @@
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.util.internals.ReplicationQueueNotifier;
+import org.jboss.cache.util.internals.ReplicationListener;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.transaction.TransactionManager;
import org.jboss.cache.UnitTestCacheFactory;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.tx.PrepareCommand;
-@Test(groups = {"functional", "transaction"}, sequential = true, testName = "cluster.ReplicationQueueTxTest")
+@Test(groups = {"functional", "transaction"}, testName = "cluster.ReplicationQueueTxTest")
public class ReplicationQueueTxTest
{
Cache cache, cache2;
@@ -43,23 +46,23 @@
public void testTransactionalReplication() throws Exception
{
+ ReplicationListener cache1Listener = new ReplicationListener(cache);
+ ReplicationListener cache2Listener = new ReplicationListener(cache2);
+
+ cache2Listener.expect(PutKeyValueCommand.class);
// outside of tx scope
cache.put("/a", "k", "v");
+ cache2Listener.waitForReplicationToOccur(5000);
- ReplicationQueueNotifier replicationQueueNotifier = new ReplicationQueueNotifier(cache);
- replicationQueueNotifier.waitUntillAllReplicated(200);
-
assert cache2.get("/a", "k").equals("v");
// now, a transactional call
+ cache1Listener.expect(PrepareCommand.class);
txManager.begin();
cache2.put("/a", "k", "v2");
txManager.commit();
+ cache1Listener.waitForReplicationToOccur(5000);
- ReplicationQueueNotifier replicationQueueNotifier2 = new ReplicationQueueNotifier(cache2);
- replicationQueueNotifier2.waitUntillAllReplicated(200);
-
-
assert cache.get("/a", "k").equals("v2");
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/eviction/ElementSizePolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/ElementSizePolicyTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/ElementSizePolicyTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -18,6 +18,7 @@
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.util.internals.EvictionWatcher;
+import org.jboss.cache.util.internals.EvictionController;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -103,7 +104,9 @@
}
System.out.println(cache);
- assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString("/org/jboss/test/data/8")) : "Eviction event not received!";
+ EvictionController evController = new EvictionController(cache);
+ evController.startEviction();
+
TestingUtil.sleepThread(200); // small grace period
System.out.println(cache);
@@ -136,7 +139,7 @@
List<Fqn> fqnsThatShouldBeEvicted = new ArrayList<Fqn>();
for (int i = 10; i < 20; i++) fqnsThatShouldBeEvicted.add(Fqn.fromString("/org/jboss/data/" + i));
- EvictionWatcher watcher = new EvictionWatcher(cache, fqnsThatShouldBeEvicted);
+ EvictionController evictionController = new EvictionController(cache);
String rootStr = "/org/jboss/data/";
for (int i = 0; i < 20; i++)
{
@@ -149,7 +152,7 @@
}
}
- assert watcher.waitForEviction(30, TimeUnit.SECONDS) : "Eviction events never received!";
+ evictionController.startEviction();
for (int i = 0; i < 20; i++)
{
Modified: core/trunk/src/test/java/org/jboss/cache/lock/ReadWriteLockWithUpgradeTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/ReadWriteLockWithUpgradeTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/lock/ReadWriteLockWithUpgradeTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -25,7 +25,7 @@
* @author <a href="mailto:cavin_song@yahoo.com">Cavin Song</a> April 22, 2004
* @version 1.0
*/
-@Test(groups = { "functional" }, sequential = true, testName = "lock.ReadWriteLockWithUpgradeTest")
+@Test(groups = { "functional" }, testName = "lock.ReadWriteLockWithUpgradeTest")
public class ReadWriteLockWithUpgradeTest
{
static final ReadWriteLockWithUpgrade lock_ = new ReadWriteLockWithUpgrade();
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/AsyncReplTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -42,7 +42,7 @@
* @author Ben Wang
* @version $Revision$
*/
-@Test(groups = {"functional", "jgroups"}, sequential = true, testName = "marshall.AsyncReplTest")
+@Test(groups = {"functional", "jgroups"}, testName = "marshall.AsyncReplTest")
public class AsyncReplTest extends RegionBasedMarshallingTestBase
{
CacheSPI<Object, Object> cache1, cache2;
@@ -284,7 +284,7 @@
Fqn fqn = Fqn.fromRelativeElements(base, custom1);
replListener2.expectAny();
cache1.put(fqn, "key", "value");
- replListener2.waitForReplicationToOccur(1000);
+ replListener2.waitForReplicationToOccur(10000);
Fqn fqn2 = Fqn.fromRelativeElements(base, custom2);
Object val = cache2.get(fqn2, "key");
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheLoaderMarshallingJDBCTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/CacheLoaderMarshallingJDBCTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/CacheLoaderMarshallingJDBCTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -27,7 +27,7 @@
* @author <a href="mailto:brian.stansberry@jboss.org">Brian Stansberry</a>
* @since 2.1.0
*/
-@Test(groups = "functional", sequential = true, testName = "marshall.CacheLoaderMarshallingJDBCTest")
+@Test(groups = "functional", testName = "marshall.CacheLoaderMarshallingJDBCTest")
public class CacheLoaderMarshallingJDBCTest extends RegionBasedMarshallingTestBase
{
private static final String className = "org.jboss.cache.marshall.MyUUID";
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CustomCollectionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/CustomCollectionTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/CustomCollectionTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -24,7 +24,7 @@
* @author <a href="mailto:galder.zamarreno@jboss.com">Galder Zamarreno</a>
* @author <a href="mailto:manik AT jboss DOT org">Manik Surtani (manik AT jboss DOT org)</a>
*/
-@Test(groups = {"functional"}, sequential = true, testName = "marshall.CustomCollectionTest")
+@Test(groups = {"functional"}, testName = "marshall.CustomCollectionTest")
public class CustomCollectionTest extends RegionBasedMarshallingTestBase implements Serializable
{
private transient Cache<Object, Object> cache1 = null;
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/RegionBasedMarshallingTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/RegionBasedMarshallingTestBase.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/RegionBasedMarshallingTestBase.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -4,7 +4,6 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-@Test(groups = {"functional"}, testName = "marshall.RegionBasedMarshallingTestBase")
public abstract class RegionBasedMarshallingTestBase
{
protected static final String ADDRESS_CLASSNAME = "org.jboss.cache.marshall.data.Address";
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -27,7 +27,7 @@
* @author <a href="mailto:manik AT jboss DOT org">Manik Surtani</a>
* @since 2.0.0
*/
-@Test(groups = {"functional", "jgroups"}, sequential = true, testName = "marshall.ReturnValueMarshallingTest")
+@Test(groups = {"functional", "jgroups"}, testName = "marshall.ReturnValueMarshallingTest")
public class ReturnValueMarshallingTest extends RegionBasedMarshallingTestBase
{
protected boolean useMarshalledValues = false;
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/SyncReplTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -36,7 +36,7 @@
* @author Ben Wang
* @version $Revision$
*/
-@Test(groups = {"functional", "jgroups"}, sequential = true, testName = "marshall.SyncReplTest")
+@Test(groups = {"functional", "jgroups"}, testName = "marshall.SyncReplTest")
public class SyncReplTest extends RegionBasedMarshallingTestBase
{
Modified: core/trunk/src/test/java/org/jboss/cache/notifications/BuddyGroupChangeNotificationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/notifications/BuddyGroupChangeNotificationTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/notifications/BuddyGroupChangeNotificationTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -18,18 +18,16 @@
import org.testng.annotations.Test;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
/**
* @author Manik Surtani (<a href="mailto:manik AT jboss DOT org">manik AT jboss DOT org</a>)
* @since 2.1.0
*/
-@Test(groups = "functional", sequential = true, testName = "notifications.BuddyGroupChangeNotificationTest")
+@Test(groups = "functional", testName = "notifications.BuddyGroupChangeNotificationTest")
public class BuddyGroupChangeNotificationTest extends BuddyReplicationTestsBase
{
Cache c1, c2, c3;
- Listener listener;
- static CountDownLatch latch1 = new CountDownLatch(1);
- static CountDownLatch latch2 = new CountDownLatch(1);
static boolean stage2 = false;
static boolean notificationsReceived = true;
@@ -42,7 +40,7 @@
BuddyReplicationConfig brc = new BuddyReplicationConfig();
brc.setEnabled(true);
conf.setBuddyReplicationConfig(brc);
-
+
c1 = cf.createCache(conf, false);
c2 = cf.createCache(conf.clone(), false);
c3 = cf.createCache(conf.clone(), false);
@@ -53,17 +51,12 @@
// make sure views are received and groups are formed first
TestingUtil.blockUntilViewsReceived(60000, c1, c2, c3);
-
- Cache[] caches = new Cache[]{c1, c2, c3};
-
- listener = new Listener(caches);
-
- c2.addCacheListener(listener);
}
@AfterMethod
public void tearDown()
{
+ System.out.println("***** BuddyGroupChangeNotificationTest.tearDown");
TestingUtil.killCaches(c1, c2, c3);
c1 = null;
c2 = null;
@@ -71,67 +64,26 @@
}
@Test(timeOut = 60000)
- public void testChangingGroups() throws InterruptedException
+ public void testChangingGroups() throws Exception
{
// initial state
- assertIsBuddy(c1, c2, true);
- assertIsBuddy(c2, c3, true);
- assertIsBuddy(c3, c1, true);
+ waitForBuddy(c1, c2, true, 60000);
+ waitForBuddy(c2, c3, true, 60000);
+ waitForBuddy(c3, c1, true, 60000);
// kill c3
c3.stop();
- latch1.await();
- assertIsBuddy(c1, c2, true);
- assertIsBuddy(c2, c1, true);
+ waitForBuddy(c1, c2, true, 60000);
+ waitForBuddy(c2, c1, true, 60000);
stage2 = true;
c3.start();
- latch2.await();
- assertIsBuddy(c1, c2, true);
- assertIsBuddy(c2, c3, true);
- assertIsBuddy(c3, c1, true);
+ waitForBuddy(c1, c2, true, 60000);
+ waitForBuddy(c2, c3, true, 60000);
+ waitForBuddy(c3, c1, true, 60000);
assert notificationsReceived;
}
-
- @CacheListener
- public static class Listener
- {
- Cache[] caches;
- int numActiveCaches;
-
- public Listener(Cache[] caches)
- {
- this.caches = caches;
- }
-
- @ViewChanged
- public void viewChanged(ViewChangedEvent e)
- {
- numActiveCaches = e.getNewView().getMembers().size();
- }
-
- @BuddyGroupChanged
- public void buddyChanged(BuddyGroupChangedEvent e)
- {
- System.out.println("Received event " + e);
- if (!e.isPre())
- {
- BuddyGroup bg = e.getBuddyGroup();
-
- boolean passed = bg.getDataOwner().equals(caches[1].getLocalAddress()) &&
- bg.getBuddies().size() == 1 &&
- bg.getBuddies().contains(caches[(numActiveCaches == 3) ? 2 : 0].getLocalAddress());
-
- notificationsReceived = notificationsReceived && passed;
-
- if (stage2)
- latch2.countDown();
- else
- latch1.countDown();
- }
- }
- }
}
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -194,6 +194,7 @@
c.setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, false);
+ cache.getConfiguration().setSerializationExecutorPoolSize(0);
if (start)
{
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -23,7 +23,7 @@
/**
* @author xenephon
*/
-@Test(groups = {"functional", "transaction", "optimistic"}, sequential = true, testName = "optimistic.AsyncFullStackInterceptorTest")
+@Test(groups = {"functional", "transaction", "optimistic"}, testName = "optimistic.AsyncFullStackInterceptorTest")
public class AsyncFullStackInterceptorTest extends AbstractOptimisticTestCase
{
private int groupIncreaser = 0;
Modified: core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -27,7 +27,7 @@
* @version $Revision$
*/
-@Test(groups = {"functional"}, sequential = true, testName = "passivation.ConcurrentPassivationTest")
+@Test(groups = {"functional"}, testName = "passivation.ConcurrentPassivationTest")
public class ConcurrentPassivationTest
{
private CacheSPI cache;
Modified: core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java 2008-11-12 05:03:13 UTC (rev 7122)
+++ core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java 2008-11-12 17:47:12 UTC (rev 7123)
@@ -4,9 +4,14 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.RPCManager;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.commands.ReplicableCommand;
+import org.jboss.cache.commands.WriteCommand;
+import org.jboss.cache.commands.legacy.write.*;
+import org.jboss.cache.commands.write.*;
import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
+import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.io.ByteBuffer;
import org.jboss.cache.marshall.AbstractMarshaller;
@@ -21,10 +26,7 @@
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -52,6 +54,19 @@
{
private CountDownLatch latch = new CountDownLatch(1);
private Set<Class<? extends ReplicableCommand>> expectedCommands;
+ private Configuration config;
+ private static Map <Class<? extends WriteCommand>, Class<? extends WriteCommand>> mvcc2PessMap =
+ new HashMap<Class<? extends WriteCommand>, Class<? extends WriteCommand>>();
+ static
+ {
+ mvcc2PessMap.put(ClearDataCommand.class, PessClearDataCommand.class);
+ mvcc2PessMap.put(MoveCommand.class, PessMoveCommand.class);
+ mvcc2PessMap.put(PutDataMapCommand.class, PessPutDataMapCommand.class);
+ mvcc2PessMap.put(PutForExternalReadCommand.class, PessPutForExternalReadCommand.class);
+ mvcc2PessMap.put(PutKeyValueCommand.class, PessPutKeyValueCommand.class);
+ mvcc2PessMap.put(RemoveKeyCommand.class, PessRemoveKeyCommand.class);
+ mvcc2PessMap.put(RemoveNodeCommand.class, PessRemoveNodeCommand.class);
+ }
/**
* Builds a listener that will observe the given cache for recieving replication commands.
@@ -63,7 +78,7 @@
CommandAwareRpcDispatcher realDispatcher = (CommandAwareRpcDispatcher) TestingUtil.extractField(rpcManager, "rpcDispatcher");
RpcDispatcher.Marshaller2 realMarshaller = (RpcDispatcher.Marshaller2) realDispatcher.getMarshaller();
RpcDispatcher.Marshaller2 delegate = null;
- if ( (realMarshaller instanceof RegionMarshallerDelegate) || (realMarshaller instanceof MarshallerDelegate) )
+ if ((realMarshaller instanceof RegionMarshallerDelegate) || (realMarshaller instanceof MarshallerDelegate))
{
throw new RuntimeException("Illegal state");
}
@@ -74,8 +89,44 @@
realDispatcher.setMarshaller(delegate);
realDispatcher.setRequestMarshaller(delegate);
realDispatcher.setResponseMarshaller(delegate);
+ this.config = cache.getConfiguration();
}
+ /**
+ * Based on cache's configuration, will know for what specific commands to expect to be replicated.
+ * E.g. async replication with a tx, would expect only a PrepareCommand (async is 1PC). sync repl with tx would expect
+ * a prepare and a commit (sync is 2pc).
+ * @param inTx do you expect replication to occur as result of a tx.commit?
+ */
+ public void smartExpect(Class<? extends WriteCommand> writeCommand, boolean inTx)
+ {
+ if (config.getCacheMode().equals(Configuration.CacheMode.INVALIDATION_ASYNC) || config.getCacheMode().equals(Configuration.CacheMode.INVALIDATION_SYNC))
+ {
+ expect(InvalidateCommand.class);
+ return;
+ }
+ if (inTx)
+ {
+ expect(PrepareCommand.class);
+ if (config.getCacheMode().isSynchronous())
+ {
+ expect(CommitCommand.class);
+ }
+ return;
+ }
+ if (config.getNodeLockingScheme().equals(Configuration.NodeLockingScheme.PESSIMISTIC))
+ {
+ expect(getPessCommand(writeCommand));
+ }
+ }
+
+ private Class<? extends ReplicableCommand> getPessCommand(Class<? extends WriteCommand> writeCommand)
+ {
+ Class<? extends ReplicableCommand> result = mvcc2PessMap.get(writeCommand);
+ if (result == null) throw new IllegalStateException("Unknown command: " + writeCommand);
+ return result;
+ }
+
private class MarshallerDelegate implements RpcDispatcher.Marshaller2
{
RpcDispatcher.Marshaller2 marshaller;
17 years, 1 month
JBoss Cache SVN: r7122 - enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES.
by jbosscache-commits@lists.jboss.org
Author: mospina
Date: 2008-11-12 00:03:13 -0500 (Wed, 12 Nov 2008)
New Revision: 7122
Modified:
enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Architecture.po
enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Introduction.po
Log:
translation for Pojo cache in progress
Modified: enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Architecture.po
===================================================================
--- enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Architecture.po 2008-11-11 23:42:29 UTC (rev 7121)
+++ enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Architecture.po 2008-11-12 05:03:13 UTC (rev 7122)
@@ -1,36 +1,38 @@
+# translation of Architecture.po to
# Language /tmp/mike/JBEAP420/Cache translations for JBEAP package.
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
# Automatically generated, 2007.
#
msgid ""
msgstr ""
-"Project-Id-Version: JBEAP 420\n"
+"Project-Id-Version: Architecture\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-21 04:57+0000\n"
-"PO-Revision-Date: 2001-02-09 01:25+0100\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2008-11-12 11:30+1000\n"
+"Last-Translator: Angela Garcia\n"
+"Language-Team: <en(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
#. Tag: title
#: Architecture.xml:5
#, no-c-format
msgid "Architecture"
-msgstr ""
+msgstr "Arquitectura"
#. Tag: para
#: Architecture.xml:6
#, no-c-format
msgid "Following explains the concepts and top-level design of PojoCache."
-msgstr ""
+msgstr "A continuación explicaremos los conceptos y el diseño de alto nivel de PojoCache."
#. Tag: title
#: Architecture.xml:9
#, no-c-format
msgid "Dynamic AOP interception"
-msgstr ""
+msgstr "Intercepción AOP dinámica"
#. Tag: para
#: Architecture.xml:10
@@ -49,6 +51,11 @@
"modification will invoke the corresponding <literal>CacheInterceptor</"
"literal> instance. Below is a schematic illustration of this process."
msgstr ""
+"JBossAop proporciona una API (<literal>appendInterceptor</literal>) para añadir un "
+"interceptor en tiempo de ejecución. PojoCache utiliza esta funcionalidad extensivamente para proporcionar transparencia para el usuario. Toda clase POJO con \"aspectos\" particulares tendrá una instancia <literal>org.jboss.aop.InstanceAdvisor</literal> asociada. Durante una operación <literal>putObject(FQN fqn, Object pojo)</literal> (API se explica a continuación), PojoCache examinará para ver si ya hay un <literal>org."
+"jboss.cache.aop.CacheInterceptor</literal> adjunto, (observe que un "
+"<literal>CacheInterceptor</literal> es la entrada de PojoCache al contenido en caché administrado dinámicamente). Si no lo hay entonces se añadirá uno al objeto <literal>InstanceAdvisor</literal>. Después cualquier modificación al campo POJO invocará la instancia <literal>CacheInterceptor</"
+"literal> correspondiente. A continuación encontrará una ilustración esquemática de este proceso."
#. Tag: para
#: Architecture.xml:13
@@ -58,7 +65,7 @@
"level read write. From the perspective of PojoCache, field level "
"interception is the appropriate mechanism to synchronize with the backend "
"cache store. Please note that,"
-msgstr ""
+msgstr "JBossAop tiene la habilidad de interceptar tanto llamadas a nivel de método como escrituras lecturas a nivel de campos. Desde la perspectiva de PojoCache, la intercepción a nivel de campos es el mecanismo apropiado para sincronizar con el almacenamiento caché backend. Observe que "
#. Tag: para
#: Architecture.xml:16
@@ -68,6 +75,8 @@
"regardless whether it is <literal>public</literal>, <literal>protected</"
"literal>, or <literal>private</literal>"
msgstr ""
+"la intercepción a nivel de campo aplica a todos los calificadores de acceso. Es decir sin importar si es <literal>public</literal>, <literal>protected</"
+"literal> o <literal>private</literal>"
#. Tag: para
#: Architecture.xml:19
@@ -78,6 +87,9 @@
"result, any field with these 3 qualifiers will not be replicated or "
"persisted."
msgstr ""
+"nos saltamos la interception para campos con calificadores <literal>final</literal>, "
+"<literal>static</literal> y <literal>transient</literal>. Por lo tanto cualquier campo con estos tres calificadores no será replicado o "
+"persistido."
#. Tag: para
#: Architecture.xml:23
@@ -93,18 +105,21 @@
"because the value in cache and memory should have been synchronized during "
"write operation. As a result, the field value from the cache is returned."
msgstr ""
+"Las figuras a continuación ilustran las operaciones para realizar una lectura y escritura de campo.Una vez que un POJO es administrado por el caché (i.e., después de que se ha llamado un método <literal>putObject</"
+"literal>), Aop invocará <literal>CacheInterceptor</"
+"literal> automáticamente cada vez que hay una lectura o escritura de un campo. Sin embargo, también debe observar la diferencia entre estas figuras. Mientras que la operación de escritura de un campo irá primero al caché y luego invoca la actualización en-memoria, la invocación de lectura de campo no involucra referencia en memoria. Esto se debe a que el valor en el caché y en la memoria debieron haber sido sincronizados durante la operación de escritura. Por lo tanto, se retorna el valor del campo del caché."
#. Tag: title
#: Architecture.xml:27
#, no-c-format
msgid "Dynamic AOP interception for field write"
-msgstr ""
+msgstr "Intercepción AOP dinámica para escritura de campos"
#. Tag: title
#: Architecture.xml:35
#, no-c-format
msgid "Dynamic AOP Interception for field read"
-msgstr ""
+msgstr "Intercepción AOP dinámica para lectura de campos"
#. Tag: title
#: Architecture.xml:42 Architecture.xml:85
@@ -130,7 +145,7 @@
#: Architecture.xml:46
#, no-c-format
msgid "The mapping rule is as follows:"
-msgstr ""
+msgstr "La regla de mapeo es la siguiente:"
#. Tag: para
#: Architecture.xml:51
@@ -666,3 +681,4 @@
"items to a Set is slower than a List or Map, since Set does not allow "
"duplicate entries."
msgstr ""
+
Modified: enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Introduction.po
===================================================================
--- enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Introduction.po 2008-11-11 23:42:29 UTC (rev 7121)
+++ enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Introduction.po 2008-11-12 05:03:13 UTC (rev 7122)
@@ -1,30 +1,32 @@
+# translation of Introduction.po to
# Language /tmp/mike/JBEAP420/Cache translations for JBEAP package.
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
# Automatically generated, 2007.
#
msgid ""
msgstr ""
-"Project-Id-Version: JBEAP 420\n"
+"Project-Id-Version: Introduction\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-21 04:57+0000\n"
-"PO-Revision-Date: 2001-02-09 01:25+0100\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2008-11-12 15:01+1000\n"
+"Last-Translator: Angela Garcia\n"
+"Language-Team: <en(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
#. Tag: title
#: Introduction.xml:5
#, no-c-format
msgid "Introduction"
-msgstr ""
+msgstr "Introduccion"
#. Tag: title
#: Introduction.xml:6
#, no-c-format
msgid "Overview"
-msgstr ""
+msgstr "Sinopsis"
#. Tag: para
#: Introduction.xml:7
@@ -38,6 +40,10 @@
"on, the object will then need to implement the <literal>Serializable</"
"literal> interface. In addition, it has known limitations:"
msgstr ""
+"Los dos componentes en JBossCache, plain cache (implementado como TreeCache) y "
+"PojoCache (implementado como PojoCache) son transaccionales, en-memoria, "
+"replicados y persistentes. Sin embargo, TreeCache usualmente se utiliza como un sistema de caché sencillo. Es decir que almacena directamente las referencias de objetos y tiene un APi similar a <literal>HashMap</literal>. Si la replicación o la persistencia se encuentran prendidas entonces el objeto necesitará implementar la interfaz <literal>Serializable</"
+"literal>. Además tiene limitaciones conocidas:"
#. Tag: para
#: Introduction.xml:10
@@ -46,7 +52,7 @@
"Users will have to manage the cache specifically; e.g., when an object is "
"updated, a user will need a corresponding API call to update the cache "
"content."
-msgstr ""
+msgstr "Los usuarios tendrán que administrar el caché especificamente, por ejemplo, cuando se actualiza un objeto, un usuario necesitará una llamada API correspondiente para actualizar el contenido del caché. "
#. Tag: para
#: Introduction.xml:13
@@ -54,7 +60,7 @@
msgid ""
"If the object size is huge, even a single field update would trigger the "
"whole object serialization. Thus, it can be unnecessarily expensive."
-msgstr ""
+msgstr "Si el tamaño del objeto es gigantesco, incluso la actualización de un solo campo dispararía toda la serialización de objetos. Por lo tanto puede llegar a ser innecesariamente caro. "
#. Tag: para
#: Introduction.xml:16
@@ -67,13 +73,13 @@
"replication. If we have two <literal>Person</literal> instances that share "
"the same <literal>Address</literal> , upon replication, it will be split "
"into two separate <literal>Address</literal> instances (instead of just one)."
-msgstr ""
+msgstr "La estructura del objeto no puede tener una relación gráfica. Es decir, el objeto no puede tener sub-objetos compartidos (referenciados múltiplemente) o referenciados a sí mismos (cíclico). De otra manera, la relación se romperá con la serialización. Por ejemplo, la figura 1 ilustra este problema durante la replicación. Si tenemos dos instancias <literal>Person</literal> que comparten la misma <literal>Address</literal> , en la replicación, será separada en dos instancias <literal>Address</literal> separadas (en lugar de solo una). "
#. Tag: title
#: Introduction.xml:21
#, no-c-format
msgid "Illustration of shared objects problem during replication"
-msgstr ""
+msgstr "Ilustración del problema de los objetos compartidos durante la replicación"
#. Tag: para
#: Introduction.xml:28
@@ -83,13 +89,14 @@
"By \"object-oriented\", we mean that PojoCache provides tight integration "
"with the object-oriented Java language paradigm, specifically,"
msgstr ""
+"Por otro lado, PojoCache, on the other hand es un caché \"orientado a objetos\" detallado. "
+"Lo que queremos decir con \"orientado a objetos\" es que PojoCache proporciona una integración fuerte con el paradigma del lenguaje Java orientado a objetos especificamente,"
#. Tag: para
#: Introduction.xml:31
#, no-c-format
-msgid ""
-"no need to implement <literal>Serializable</literal> interface for the POJOs."
-msgstr ""
+msgid "no need to implement <literal>Serializable</literal> interface for the POJOs."
+msgstr "no es necesario implementar la interfaz <literal>Serializable</literal> para los POJOs."
#. Tag: para
#: Introduction.xml:34
@@ -97,7 +104,7 @@
msgid ""
"replication (or even persistency) is done on a per-field basis (as opposed "
"to the whole object binary level)."
-msgstr ""
+msgstr "replicación (o incluso persistencia) se realiza campo por campo (contrario a todo el nivel binario de objetos)."
#. Tag: para
#: Introduction.xml:37
@@ -106,13 +113,13 @@
"the object relationship and identity are preserved automatically in a "
"distributed, replicated environment. It enables transparent usage behavior "
"and increases software performance."
-msgstr ""
+msgstr "la relación de objetos e identidad se preservan de manera automática en un entorno distribuido y replicado. Habilita el comportamiento del uso transparente e incrementa el rendimiento del software. "
#. Tag: para
#: Introduction.xml:41
#, no-c-format
msgid "In PojoCache, these are the typical development and programming steps:"
-msgstr ""
+msgstr "En PojoCache, estos son los pasos comunes de desarrollo y programación:"
#. Tag: para
#: Introduction.xml:44
@@ -122,14 +129,13 @@
"xml file (i.e., <literal>jboss-aop.xml</literal>), or through annotation "
"inside the POJO. Depending on your preference, you can either pre-instrument "
"your POJO (compile time) or have JBossAop do it at load time."
-msgstr ""
+msgstr "Declare POJO para que sea \"preparado\" (en Aop parlance) ya sea por medio de un archivo xml externo (i.e., <literal>jboss-aop.xml</literal>), o por medio de una anotación dentro del POJO. Dependiendo de su preferencia puede pre-instrumentar su POJO (durante la compilación) o hacer que JBossAop lo haga en el momento de carga."
#. Tag: para
#: Introduction.xml:47
#, no-c-format
-msgid ""
-"Use <literal>putObject</literal> Api to put your POJO under cache management."
-msgstr ""
+msgid "Use <literal>putObject</literal> Api to put your POJO under cache management."
+msgstr "Use la Api <literal>putObject</literal> para poner su POJO bajo administración del caché."
#. Tag: para
#: Introduction.xml:50
@@ -137,13 +143,13 @@
msgid ""
"Operate on POJO directly. Cache will then manage your replication or "
"persistency automatically."
-msgstr ""
+msgstr "Opere en POJO directamente. Después caché administrará su replicación o su persistencia de manera automática."
#. Tag: para
#: Introduction.xml:54
#, no-c-format
msgid "More details on these steps will be given in later chapters."
-msgstr ""
+msgstr "En capítulos posteriores encontrará más detalles sobre estos pasos."
#. Tag: para
#: Introduction.xml:57
@@ -157,6 +163,9 @@
"transaction automatically. When the transaction is either committed or "
"rolled back, your POJO operations will act accordingly."
msgstr ""
+"<literal>PojoCache</literal> también extiende la funcionalidad de TreeCache a objetos. Es decir las características de TreeCache tal como transacción, "
+"replicación, política de eliminación y cargador de caché se ha extendido al nivel de POJO. Por ejemplo, cuando opera en un POJO (digamos <literal>pojo.setName()"
+"</literal>) bajo un contexto de transacción entonces participará en esa transacción automáticamente. Cuando se hayan guardado los cambios de la transacción o cuando se hayan deshecho los cambios, sus operaciones POJO actuaran de acuerdo a esto."
#. Tag: para
#: Introduction.xml:60
@@ -169,18 +178,21 @@
"the cache states. Of course, users will need to consider the extra cost "
"(albeit slight) in doing this."
msgstr ""
+"Finalmente, <literal>PojoCache</literal> también se puede utilizar como un <literal>TreeCache</literal> sencillo. Por ejemplo, un usuario puede utilizar la API <literal>TreeCache</literal> [e.g., <literal>get(String fqn)</literal> "
+"y <literal>set(String fqn, String key, String value)</literal> ] para administrar los estados del caché. Los usuarios tendrán que considerar el costo extra "
+"(aunque leve) al implementar esto."
#. Tag: title
#: Introduction.xml:63
#, no-c-format
msgid "Features"
-msgstr ""
+msgstr "Características"
#. Tag: para
#: Introduction.xml:64
#, no-c-format
msgid "Here are the current features and benefits of PojoCache:"
-msgstr ""
+msgstr "Estas son las características y beneficios actuales de PojoCache:"
#. Tag: para
#: Introduction.xml:69
@@ -198,6 +210,9 @@
"<ulink url=\"TreeCache.html\">JBossCache</ulink> for more details on cache "
"mode."
msgstr ""
+"Replicación detallada. El modo de replicación soportado es el mismo que el de TreeCache: <literal>LOCAL</literal> , <literal>REPL_SYNC</literal> , "
+"y <literal>REPL_ASYNC</literal>. El nivel de replicación es detallado y se realiza automáticamente una vez que el POJO es mapeado en el almacenamiento caché interno. Cuando se actualiza un campo POJO entonces se envía una petición de replicación sólo al nodo correspondiente a ese atributo modificado (en lugar de todo el objeto). Este puede aumentar el rendimiento potencial durante el proceso de replicación; e.g., actualizando una sola clave en un HashMap grande solo replicara ese solo campo en lugar de ¡todo el mapa! Consulte la documentación de "
+"<ulink url=\"TreeCache.html\">JBossCache</ulink> para obtener mayores detalles sobre el modo caché."
#. Tag: para
#: Introduction.xml:74
@@ -444,3 +459,4 @@
"jboss-cache.jar with jboss-cache-jdk50.jar and jboss-aop.jar with jboss-aop-"
"jdk50.jar from lib-50 directory."
msgstr ""
+
17 years, 1 month
JBoss Cache SVN: r7121 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-11 18:42:29 -0500 (Tue, 11 Nov 2008)
New Revision: 7121
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
Log:
Log what looks like an error condition at WARN vs DEBUG
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:41:12 UTC (rev 7120)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:42:29 UTC (rev 7121)
@@ -550,7 +550,7 @@
}
catch (Exception e)
{
- log.debug("Exception while reading value of attribute " + name, e);
+ log.warn("Exception while reading value of attribute " + name, e);
}
}
else
17 years, 1 month
JBoss Cache SVN: r7120 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-11 18:41:12 -0500 (Tue, 11 Nov 2008)
New Revision: 7120
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
Log:
Reduce voluminous object analysis logging to TRACE as it gets performed 4 times over lifecycle of a cache that uses CacheJmxWrapper
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:38:09 UTC (rev 7119)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:41:12 UTC (rev 7120)
@@ -139,9 +139,9 @@
if (mbean != null && mbean.description() != null && mbean.description().trim().length() > 0)
{
description = mbean.description();
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("@MBean description set - " + mbean.description());
+ log.trace("@MBean description set - " + mbean.description());
}
MBeanAttributeInfo info = new MBeanAttributeInfo(MBEAN_DESCRITION,
"java.lang.String",
@@ -369,9 +369,9 @@
}
}
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("@Attr found for method " + method.getName() + " and registered as " + attributeName);
+ log.trace("@Attr found for method " + method.getName() + " and registered as " + attributeName);
}
AttributeEntry ae = atts.get(attributeName);
@@ -459,9 +459,9 @@
if (!isAlreadyExposed)
{
ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("@Operation found for method " + method.getName());
+ log.trace("@Operation found for method " + method.getName());
}
}
}
@@ -510,9 +510,9 @@
false);
atts.put(fieldName, new FieldAttributeEntry(info, field));
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("@Attr found for field " + field.getName());
+ log.trace("@Attr found for field " + field.getName());
}
}
}
17 years, 1 month
JBoss Cache SVN: r7119 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-11 18:38:09 -0500 (Tue, 11 Nov 2008)
New Revision: 7119
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
Log:
Reduce per-invocation logging levels from DEBUG to TRACE
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:29:13 UTC (rev 7118)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:38:09 UTC (rev 7119)
@@ -178,14 +178,14 @@
if (name == null || name.length() == 0)
throw new NullPointerException("Invalid attribute requested " + name);
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("getAttribute called for " + name);
+ log.trace("getAttribute called for " + name);
}
Attribute attr = getNamedAttribute(name);
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("getAttribute value found " + attr.getValue());
+ log.trace("getAttribute value found " + attr.getValue());
}
return attr.getValue();
}
@@ -223,9 +223,9 @@
{
Attribute attr = (Attribute) list.get(i);
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("Attribute name " + attr.getName() + " new value is " + attr.getValue());
+ log.trace("Attribute name " + attr.getName() + " new value is " + attr.getValue());
}
if (setNamedAttribute(attr))
@@ -234,9 +234,9 @@
}
else
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("Failed to update attribute name " + attr.getName()
+ log.trace("Failed to update attribute name " + attr.getName()
+ " with value "
+ attr.getValue());
}
@@ -250,9 +250,9 @@
{
try
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("Invoke method called on " + name);
+ log.trace("Invoke method called on " + name);
}
Class<?>[] classes = new Class[sig.length];
for (int i = 0; i < classes.length; i++)
@@ -535,9 +535,9 @@
try
{
result = new Attribute(name, entry.invoke(null));
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("Attribute " + name
+ log.trace("Attribute " + name
+ " has r="
+ i.isReadable()
+ ",w="
@@ -564,9 +564,9 @@
private boolean setNamedAttribute(Attribute attribute)
{
boolean result = false;
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("Invoking set on attribute " + attribute.getName()
+ log.trace("Invoking set on attribute " + attribute.getName()
+ " with value "
+ attribute.getValue());
}
17 years, 1 month
JBoss Cache SVN: r7118 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-11 18:29:13 -0500 (Tue, 11 Nov 2008)
New Revision: 7118
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
Log:
Make logging guard levels consistent with level that is actually logged
Add some brackets around multi-line if block bodies
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:20:54 UTC (rev 7117)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/ResourceDMBean.java 2008-11-11 23:29:13 UTC (rev 7118)
@@ -89,7 +89,7 @@
attrInfo = new MBeanAttributeInfo[atts.size()];
int i = 0;
- if (log.isInfoEnabled())
+ if (log.isTraceEnabled())
{
log.trace("Processing class " + instance.getClass());
log.trace("Number of attributes: " + atts.size());
@@ -99,7 +99,7 @@
{
info = entry.getInfo();
attrInfo[i++] = info;
- if (log.isInfoEnabled())
+ if (log.isTraceEnabled())
{
log.trace("Attribute " + info.getName()
+ "[r="
@@ -117,7 +117,7 @@
opInfo = new MBeanOperationInfo[ops.size()];
ops.toArray(opInfo);
- if (log.isInfoEnabled())
+ if (log.isTraceEnabled())
{
if (ops.size() > 0)
log.trace("Operations are:");
@@ -234,7 +234,7 @@
}
else
{
- if (log.isWarnEnabled())
+ if (log.isDebugEnabled())
{
log.debug("Failed to update attribute name " + attr.getName()
+ " with value "
@@ -306,10 +306,12 @@
if (!methodName.startsWith("get") && !methodName.startsWith("set")
&& !methodName.startsWith("is"))
{
- if (log.isWarnEnabled())
+ if (log.isWarnEnabled())
+ {
log.warn("method name " + methodName
+ " doesn't start with \"get\", \"set\", or \"is\""
- + ", but is annotated with @ManagedAttribute: will be ignored");
+ + ", but is annotated with @ManagedAttribute: will be ignored");
+ }
}
else
{
@@ -533,7 +535,8 @@
try
{
result = new Attribute(name, entry.invoke(null));
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled())
+ {
log.debug("Attribute " + name
+ " has r="
+ i.isReadable()
@@ -542,7 +545,8 @@
+ ",is="
+ i.isIs()
+ " and value "
- + result.getValue());
+ + result.getValue());
+ }
}
catch (Exception e)
{
@@ -560,10 +564,12 @@
private boolean setNamedAttribute(Attribute attribute)
{
boolean result = false;
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled())
+ {
log.debug("Invoking set on attribute " + attribute.getName()
+ " with value "
- + attribute.getValue());
+ + attribute.getValue());
+ }
AttributeEntry entry = atts.get(attribute.getName());
if (entry != null)
17 years, 1 month