Package com.sun.sgs.app.util

Examples of com.sun.sgs.app.util.ScalableHashMap


    }

    private AudioManagerConnectionHandler() {
        super();

  ScalableHashMap<BigInteger, String> sessionCallIDMap = new ScalableHashMap();

  sessionCallIDMapRef = AppContext.getDataManager().createReference(sessionCallIDMap);

  ScalableHashMap<String, ManagedReference<AudioCallStatusListener>> callIDListenerMap = new ScalableHashMap();

  callIDListenerMapRef = AppContext.getDataManager().createReference(callIDListenerMap);
    }
View Full Code Here


    @Test public void testConstructorNoArg() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      new ScalableHashMap<Integer,Integer>();
        assertEquals(6, getMaxTreeDepth(test));
        assertEquals(6, getMaxTreeDepth(test));
        dataService.setBinding("test", test);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(6, getMaxTreeDepth(test));
        assertEquals(6, getMinTreeDepth(test));
    }
      }, taskOwner);
View Full Code Here

    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(control, test);
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testPutOldValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(Boolean.TRUE, bar);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.put(Boolean.TRUE, Boolean.FALSE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.put(Boolean.TRUE, Boolean.FALSE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testPutOldKeyNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(bar, Boolean.TRUE);
    }
      }, taskOwner);
  try {
      txnScheduler.runTask(
          new TestAbstractKernelRunnable() {
        public void run() throws Exception {
      dataService.removeObject(
          dataService.getBinding("bar"));
      ScalableHashMap test =
          (ScalableHashMap) dataService.getBinding("test");
      assertEquals(null, test.put(new Bar(1), Boolean.FALSE));
      assertEquals(Boolean.FALSE, test.get(new Bar(1)));
      throw new RuntimeException("Intentional Abort");
        }
    }, taskOwner);
  } catch (RuntimeException re) {}
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.put(new Bar(1), Boolean.FALSE));
        assertEquals(Boolean.FALSE, test.get(new Bar(1)));
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testGetValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(Boolean.TRUE, bar);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.get(Boolean.TRUE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.get(Boolean.TRUE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testGetKeyNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(bar, Boolean.TRUE);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.get(new Bar(1)));
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.get(new Bar(1)));
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testContainsKeyKeyNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap(16);
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(bar, 1);
        test.put(new Bar(2), 2);
        }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertFalse(test.containsKey(new Bar(1)));
        assertEquals(2, test.size());
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertFalse(test.containsKey(new Bar(1)));
        assertEquals(2, test.size());
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testContainsKeyValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap(16);
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(1, bar);
        test.put(2, new Bar(2));
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertTrue(test.containsKey(1));
        assertEquals(2, test.size());
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertTrue(test.containsKey(1));
        assertEquals(2, test.size());
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testContainsValueValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(1, bar);
        test.put(2, new Bar(2));
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertFalse(test.containsValue(new Bar(1)));
        assertEquals(2, test.size());
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertFalse(test.containsValue(new Bar(1)));
        assertEquals(2, test.size());
    }
      }, taskOwner);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.util.ScalableHashMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.