Package com.sun.sgs.test.util

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


     *
     * @throws Exception
     */
    @Test
    public void testAddingAllUsingCollectionContainingNull() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(6, 6);
    list.add("A");

    Collection<String> c = new ArrayList<String>();
View Full Code Here


     * @throws Exception
     */
    @Test
    public void testAddingAllInMiddleUsingCollectionContainingNull()
      throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(6, 6);
    list.add("A");
    list.add("C");
    Collection<String> c = new ArrayList<String>();
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testIsEmptyShouldReturnFalse() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(6, 6);
    list.add("A");
    assertFalse(list.isEmpty());

View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testIndexOfNonExistentUsingRemovals() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(6, 6);
    list.add("A");
    list.add("B");
    list.add("C");
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testLastIndexOfNonExistentUsingRemovals() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(6, 6);
    list.add("A");
    list.add("B");
    list.add("C");
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testRemoveWithInvalidIndex() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 3);
    list.add("A");
    list.add("B");
    list.add("C");
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testSubListExceptions() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 3);
    list.add("A");
    list.add("B");
    list.add("C");
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testSetWithInvalidIndex() throws Exception {
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list = new ScalableList<String>(3, 3);
    list.add("A");
    list.add("B");
    list.add("C");
View Full Code Here

    @Test
    public void testRetrievingAndModifyingListFromDataService()
      throws Exception {
  final String name = "testScalableList";

  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {

    ScalableList<String> d = new ScalableList<String>(3, 3);
    for (int i = 0; i < 10; ++i)
        d.add(Integer.toString(i));
    AppContext.getDataManager().setBinding(name, d);
      }
  }, taskOwner);

  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {

    ScalableList<String> d =
      uncheckedCast((AppContext.getDataManager()
        .getBinding(name)));
View Full Code Here

    public void testSeriazableWithRemovals() throws Exception {
  final String name = "testScalableList";
  final int total = 5;

  // create the list
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {

    ScalableList<String> list = new ScalableList<String>();
    for (int i = 0; i < 10; i++)
        list.add(Integer.toString(i));
    AppContext.getDataManager().setBinding(name, list);
      }
  }, taskOwner);

  // remove some elements
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list =
      uncheckedCast(AppContext.getDataManager().getBinding(
        name));
    for (int i = 0; i < 5; i++) {
        list.remove(0);
    }
      }
  }, taskOwner);

  // check that the changes were made
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() throws Exception {
    ScalableList<String> list =
      uncheckedCast(AppContext.getDataManager().getBinding(
        name));
    Iterator<String> iter = list.iterator();
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.