Package com.sun.sgs.test.util

Examples of com.sun.sgs.test.util.TestAbstractKernelRunnable


     * @throws java.lang.Exception
     */
    @Test
    public void testRemoveFromEndOfListWithIterator() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    List<String> shadow = new ArrayList<String>();
    ScalableList<String> list = new ScalableList<String>(3, 1);
               
                // Populate the lists
View Full Code Here


     * @throws java.lang.Exception
     */
    @Test
    public void testRemoveFromBeginningOfListWithIterator() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    List<String> shadow = new ArrayList<String>();
    ScalableList<String> list = new ScalableList<String>(3, 1);
               
                // Populate the lists
View Full Code Here

     * @throws java.lang.Exception
     */
    @Test
    public void testSetAfterInvalidPrevious() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 1);

                // Populate the list
    for (int i = 0; i < 5; i++) {
View Full Code Here

     * @throws java.lang.Exception
     */
    @Test
    public void testSetAfterInvalidNext() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 1);

                // Populate the list
    for (int i = 0; i < 5; i++) {
View Full Code Here

     * @throws java.lang.Exception
     */
    @Test
    public void testSetAfterValidThenInvalidPrevious() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 1);

                // Populate the list
    for (int i = 0; i < 5; i++) {
View Full Code Here

     * @throws java.lang.Exception
     */
    @Test
    public void testSetAfterValidThenInvalidNext() throws Exception {
        // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 1);

                // Populate the list
    for (int i = 0; i < 5; i++) {
View Full Code Here

  int originalCount = getObjectCount();
  System.err.println("originalCount: " + originalCount);
  final String name = "list" + Long.toString(System.currentTimeMillis());

  // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ScalableList<Integer> d = new ScalableList<Integer>(3, 3);
    AppContext.getDataManager().setBinding(name, d);
      }
  }, taskOwner);

  int countAfterCreate = getObjectCount();
  System.err.println("countAfterCreate: " + countAfterCreate);

  // add some contents
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ScalableList<Integer> d =
      uncheckedCast(AppContext.getDataManager().getBinding(
        name));
    for (int i = 0; i < elementsToAdd; i++) {
        d.add(i);
    }
      }
  }, taskOwner);

  int countAfterAdds = getObjectCount();
  System.err.println("countAfterAdds: " + countAfterAdds);

  // remove object
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    DataManager dm = AppContext.getDataManager();
    ScalableList<Integer> d = uncheckedCast(dm.getBinding(name));
    dm.removeObject(d);
    dm.removeBinding(name);
View Full Code Here

      throws Exception {
  final String name =
    "list" + Long.toString(System.currentTimeMillis());

  // create list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ScalableList<Integer> d = new ScalableList<Integer>();
    AppContext.getDataManager().setBinding(name, d);
      }
  }, taskOwner);

  int countAfterCreate = getObjectCount();
  System.err.println("countAfterCreate: " + countAfterCreate);

  // add some objects
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ScalableList<Integer> d =
      uncheckedCast(AppContext.getDataManager().getBinding(
        name));
    for (int i = 0; i < elementsToAdd; i++) {
        d.add(i);
    }
      }
  }, taskOwner);

  int countAfterAdds = getObjectCount();
  System.err.println("countAfterAdds: " + countAfterAdds);

  // clear the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    DataManager dm = AppContext.getDataManager();
    ScalableList<Integer> d = uncheckedCast(dm.getBinding(name));
    d.clear();
      }
  }, taskOwner);

  // removal is asynchronous, so wait. When we compare, there should
  // be as many objects as there were immediately after the list
  // was created.
  Thread.sleep(50 * elementsToAdd);
  int countAfterClear = getObjectCount();
  System.err.println("countAfterClear: " + countAfterClear);
  assertEquals(countAfterCreate, countAfterClear);

  // delete object
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    DataManager dm = AppContext.getDataManager();
    ScalableList<Integer> d = uncheckedCast(dm.getBinding(name));
    dm.removeObject(d);
    dm.removeBinding(name);
View Full Code Here

    }
   
    @Test
    public void testManagedAppListener() throws Exception {
        startupServer(ManagedAppListener.class);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {

    ManagedAppListener listener =
                        (ManagedAppListener) dataService.getServiceBinding(
                        StandardProperties.APP_LISTENER);
View Full Code Here

    }
   
    @Test
    public void testUnmanagedAppListener() throws Exception {
        startupServer(UnmanagedAppListener.class);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {

                ManagedSerializable<AppListener> obj =
                        Objects.uncheckedCast(dataService.getServiceBinding(
                                              StandardProperties.APP_LISTENER));
View Full Code Here

TOP

Related Classes of com.sun.sgs.test.util.TestAbstractKernelRunnable

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.