Examples of SgsTestNode


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

    @Test
    public void testMyAccessCoordinator() throws Exception {
  properties.setProperty(ACCESS_COORDINATOR_PROPERTY,
             MyAccessCoordinator.class.getName());
  SgsTestNode node = new SgsTestNode(
      "TestKernelSetAccessCoordinator", null, properties);
        Identity taskOwner = node.getProxy().getCurrentOwner();
        TransactionScheduler txnScheduler =
      node.getSystemRegistry().getComponent(TransactionScheduler.class);
  final DataService dataService = node.getDataService();
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.setBinding("a", new DummyManagedObject());
    }
      }, taskOwner);
  assertTrue(MyAccessCoordinator.getUsed());
  node.shutdown(false);
    }
View Full Code Here

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

    @Override
    protected void beforeEachTest(Properties addProps) throws Exception {
        // no server node required
        props = getProps(null, addProps);
        node = new SgsTestNode(appName, null, props);

        graphDriver = (LPADriver)
                finderField.get(node.getNodeMappingService());
        groupDriver = graphDriver;
        listener = graphDriver.getGraphListener();
View Full Code Here

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

        super.afterEachTest();
        props = getProps(null);
        for (Map.Entry<Object, Object> entry : addProps.entrySet()) {
            props.put(entry.getKey(), entry.getValue());
        }
        node =  new SgsTestNode(appName, null, props);
        graphDriver = (LPADriver)
                finderField.get(node.getNodeMappingService());
        groupDriver = graphDriver;
        listener = graphDriver.getGraphListener();
        builder = graphDriver.getGraphBuilder();
View Full Code Here

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

    public void testGraphBuilderBadCount() throws Exception {
        props = getProps(serverNode);
        props.setProperty(AbstractAffinityGraphBuilder.PERIOD_COUNT_PROPERTY,
                          "0");

        SgsTestNode newNode = null;
        try {
            newNode = new SgsTestNode(appName, null, props);
        } catch (InvocationTargetException e) {
            // Try to unwrap any nested exceptions - they will be wrapped
            // because the kernel instantiating via reflection
            Throwable cause = e.getCause();
            while (cause instanceof InvocationTargetException) {
                cause = cause.getCause();
            }
            if (cause instanceof Exception) {
                throw (Exception) cause;
            } else {
                throw e;
            }
        } finally {
            if (newNode != null) {
                newNode.shutdown(false);
            }
        }
    }
View Full Code Here

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

    private void doTestRead(boolean detectMods) throws Exception {
  Properties props = getNodeProps();
  props.setProperty(DataServiceImplClass + ".detect.modifications",
        String.valueOf(detectMods));
  props.setProperty("com.sun.sgs.txn.timeout", "10000");
  serverNode = new SgsTestNode("TestDataServicePerformance", null, props);
  final DataService service = serverNode.getDataService();
        TransactionScheduler txnScheduler = serverNode.getSystemRegistry().
            getComponent(TransactionScheduler.class);
        Identity taskOwner = serverNode.getProxy().getCurrentOwner();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

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

    @Test
    public void testReadForUpdate() throws Exception {
  Properties props = getNodeProps();
  props.setProperty("com.sun.sgs.txn.timeout", "10000");
  serverNode = new SgsTestNode("TestDataServicePerformance", null, props);
  final DataService service = serverNode.getDataService();
        TransactionScheduler txnScheduler = serverNode.getSystemRegistry().
            getComponent(TransactionScheduler.class);
        Identity taskOwner = serverNode.getProxy().getCurrentOwner();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

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

    @Test
    public void testMarkForUpdate() throws Exception {
  Properties props = getNodeProps();
  props.setProperty("com.sun.sgs.txn.timeout", "10000");
  serverNode = new SgsTestNode("TestDataServicePerformance", null, props);
  final DataService service = serverNode.getDataService();
        TransactionScheduler txnScheduler = serverNode.getSystemRegistry().
            getComponent(TransactionScheduler.class);
        Identity taskOwner = serverNode.getProxy().getCurrentOwner();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

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

  Properties props = getNodeProps();
  props.setProperty(DataServiceImplClass + ".detect.modifications",
        String.valueOf(detectMods));
  props.setProperty(DataStoreImplClass + ".flush.to.disk",
        String.valueOf(flush));
  serverNode = new SgsTestNode("TestDataServicePerformance", null, props);
  final DataService service = serverNode.getDataService();
        TransactionScheduler txnScheduler = serverNode.getSystemRegistry().
            getComponent(TransactionScheduler.class);
        Identity taskOwner = serverNode.getProxy().getCurrentOwner();
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

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

    public void testRelocateClientSession() throws Exception {
  String newNodeHost = "newNode";
  DummyClient client = createClientToRelocate(newNodeHost);
  int objectCount = getObjectCount();
  try {
      SgsTestNode newNode = additionalNodes.get(newNodeHost);
      client.relocate(newNode.getAppPort(), true, true);
      // need to wait here to get the true object count to make sure
      // that objects and bindings aren't cleaned up.
      Thread.sleep(WAIT_TIME);
      assertEquals(objectCount, getObjectCount());
      checkBindings(1);
View Full Code Here

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

  throws Exception
    {
  String newNodeHost = "newNode";
  DummyClient client = createClientToRelocate(newNodeHost);
  try {
      SgsTestNode newNode = additionalNodes.get(newNodeHost);
      client.relocate(newNode.getAppPort(), true, true);
      sendMessagesFromNodeToClient(serverNode, client, 4, 0);
      sendMessagesFromNodeToClient(newNode, client, 4, 10);
  } finally {
      client.disconnect();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.