public boolean done() { Thread.yield(); // TODO is this necessary? return r1.getEntry(k2).getValue().equals(client_k2); } public String description() {
public boolean done() { Object val = region2.getEntry(k2).getValue(); return k2.equals(val); } public String description() {
public boolean done() { Object val = r1.getEntry(k2).getValue(); return k2.equals(val); } public String description() {
public Object getValueInVM(Region aRegion, Object key, boolean translateNullToInvalid) { Object value = null; // getEntry will not invoke the loader Region.Entry entry = aRegion.getEntry(key); if (entry != null) { value = entry.getValue(); if (value == null && translateNullToInvalid) { // contains key with null value => Token.INVALID value = Token.INVALID; } } return value; }
public boolean done() { return !r.getEntry("key-3").getValue().equals("key-3"); } public String description() {
public void run2() throws CacheException { Region r = getRootRegion("ProxyDUnitTest"); assertEquals(true, r.containsKey("createKey")); assertEquals("createValue1", r.getEntry("createKey").getValue()); } });
public void run2() throws CacheException { Region region1 = getRootRegion().getSubregion(regionName1); assertEquals(null, region1.getEntry("key-string-1")); assertEquals(null, region1.get("key-string-1")); } });
public void run2() throws CacheException { Region region = getRootRegion().getSubregion(name); Region.Entry entry1 = region.getEntry(key1); assertNotNull(entry1); assertEquals("VALUE1 10", entry1.getValue()); Region.Entry entry2 = region.getEntry(key2); assertNotNull(entry2); assertEquals(new Integer(0xCAFE + 10), entry2.getValue()); Region.Entry entry3 = region.getEntry(key3); assertNotNull(entry3); assertEquals("VALUE3 10", entry3.getValue()); } };
public void run2() throws CacheException { Region r = getRootRegion("ProxyDUnitTest"); assertEquals(true, r.containsKey("putkey")); assertEquals("putvalue1", r.getEntry("putkey").getValue()); r.put("putkey", "putvalue2"); } });
/** * does a put on the client not expecting an exception * @throws Exception */ public static void doPutsOnClientNotExpectingException() throws Exception { Region region1 = cache.getRegion(Region.SEPARATOR + REGION_NAME); region1.put("newKey", "newValue"); assertTrue("newValue".equals(region1.getEntry("newKey").getValue())); } }
public static void checkForNoFullObjectResend() throws Exception { Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME); assertNull(r1.getEntry("KEY").getValue()); }
public static void verifyPut() { try { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); assertNotNull(r); // verify no update assertEquals("key-1", r.getEntry("key-1").getValue()); assertEquals("key-2", r.getEntry("key-2").getValue()); } catch (Exception ex) { fail("failed while verifyPut()", ex); } }
public static void verifyNoUpdates() { try { Region r = cache.getRegion(Region.SEPARATOR+ REGION_NAME); assertNotNull(r); // verify no updates assertEquals("key-1", r.getEntry("key1").getValue()); assertEquals("key-2", r.getEntry("key2").getValue()); } catch (Exception ex) { fail("failed while verifyNoUpdates()", ex); } }
public void afterDestroy(EntryEvent event) { lastEvent = event; if (this.v.isSuspendValidation()) {return;} validate(event); this.v.setPassedValidation(false); assertTrue("IsDestroy Assertion!", this.v.isDestroy()); assertTrue(!event.getRegion().containsKey(this.v.getKey())); assertTrue(!event.getRegion().containsValueForKey(this.v.getKey())); assertNull(event.getRegion().getEntry(event.getKey())); this.v.setPassedValidation(true); } public void afterRegionInvalidate(RegionEvent event) {
public static void put() { try { Region r = cache.getRegion("/" + REGION_NAME); assertNotNull(r); r.put("key-1", "vm2-key-1"); // Verify that no invalidates occurred to this region assertEquals(r.getEntry("key-1").getValue(), "vm2-key-1"); } catch (Exception ex) { fail("failed while r.put()", ex); } }
public void testRegisterInterestResponse_Destroyed_Invalid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); r.put(KEY, "DummyValue"); r.destroy(KEY); server1.invoke(DurableResponseMatrixDUnitTest.class, "invalidateEntry", new Object[] { KEY }); r.registerInterest(KEY, InterestResultPolicy.KEYS_VALUES); assertFalse(r.containsValueForKey(KEY)); // invalidate assertEquals(null, r.getEntry(KEY).getValue()); // invalidate }