Examples of addExpected()


Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

                .getInstances().size());
        assertEquals(2, instance2.getClusterViewService().getClusterView()
                .getInstances().size());

        AssertingTopologyEventListener assertingTopologyEventListener = new AssertingTopologyEventListener();
        assertingTopologyEventListener.addExpected(Type.TOPOLOGY_INIT);
        assertEquals(1, assertingTopologyEventListener.getRemainingExpectedCount());
        instance1.bindTopologyEventListener(assertingTopologyEventListener);
        assertEquals(0, assertingTopologyEventListener.getRemainingExpectedCount());

        // startup instance 3
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        assertEquals(0, assertingTopologyEventListener.getRemainingExpectedCount());

        // startup instance 3
        AcceptsMultiple acceptsMultiple = new AcceptsMultiple(
                Type.TOPOLOGY_CHANGING, Type.TOPOLOGY_CHANGED);
        assertingTopologyEventListener.addExpected(acceptsMultiple);
        assertingTopologyEventListener.addExpected(acceptsMultiple);
        instance3 = Instance.newClusterInstance("thirdInstance", instance1,
                false);
        instance1.runHeartbeatOnce();
        instance2.runHeartbeatOnce();
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        // startup instance 3
        AcceptsMultiple acceptsMultiple = new AcceptsMultiple(
                Type.TOPOLOGY_CHANGING, Type.TOPOLOGY_CHANGED);
        assertingTopologyEventListener.addExpected(acceptsMultiple);
        assertingTopologyEventListener.addExpected(acceptsMultiple);
        instance3 = Instance.newClusterInstance("thirdInstance", instance1,
                false);
        instance1.runHeartbeatOnce();
        instance2.runHeartbeatOnce();
        instance3.runHeartbeatOnce();
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        instance.runHeartbeatOnce();
        logger.info("testTopologyEventListeners: 2nd sleep 2s");
        Thread.sleep(2000);

        AssertingTopologyEventListener assertingTopologyEventListener = new AssertingTopologyEventListener();
        assertingTopologyEventListener.addExpected(Type.TOPOLOGY_INIT);
        instance.bindTopologyEventListener(assertingTopologyEventListener);
        assertEquals(0, assertingTopologyEventListener.getRemainingExpectedCount());

        final String propertyName = UUID.randomUUID().toString();
        propertyValue = UUID.randomUUID().toString();
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        final String propertyName = UUID.randomUUID().toString();
        propertyValue = UUID.randomUUID().toString();
        PropertyProviderImpl pp = new PropertyProviderImpl();
        pp.setProperty(propertyName, propertyValue);

        assertingTopologyEventListener.addExpected(Type.PROPERTIES_CHANGED);

        assertEquals(1, assertingTopologyEventListener.getRemainingExpectedCount());
        assertEquals(0, pp.getGetCnt());
        instance.bindPropertyProvider(pp, propertyName);
        logger.info("testTopologyEventListeners: 3rd sleep 1.5s");
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        assertEquals(0, assertingTopologyEventListener.getRemainingExpectedCount());
        // we can only assume that the getProperty was called at least once - it
        // could be called multiple times though..
        assertTrue(pp.getGetCnt() > 0);

        assertingTopologyEventListener.addExpected(Type.PROPERTIES_CHANGED);

        assertEquals(1, assertingTopologyEventListener.getRemainingExpectedCount());
        pp.setGetCnt(0);
        propertyValue = UUID.randomUUID().toString();
        pp.setProperty(propertyName, propertyValue);
View Full Code Here

Examples of org.apache.sling.discovery.impl.cluster.helpers.AssertingTopologyEventListener.addExpected()

        ClusterView initialClusterView = instance.getClusterViewService()
                .getClusterView();
        assertNotNull(initialClusterView);

        AssertingTopologyEventListener ada = new AssertingTopologyEventListener();
        ada.addExpected(Type.TOPOLOGY_INIT);
        instance.bindTopologyEventListener(ada);
        assertEquals(1, ada.getEvents().size());
        TopologyEvent initEvent = ada.getEvents().remove(0);
        assertNotNull(initEvent);
View Full Code Here

Examples of org.jboss.arquillian.persistence.data.dbunit.dataset.DataSetRegister.addExpected()

   {
      DataSetRegister dataSetRegister = getOrCreateDataSetRegister();
      for (DataSetResourceDescriptor dataSetDescriptor : dataSetDescriptors)
      {
         IDataSet expectedDataSet = createExpectedDataSet(dataSetDescriptor);
         dataSetRegister.addExpected(expectedDataSet);
      }
      dataSetRegisterProducer.set(dataSetRegister);
   }

   private IDataSet createExpectedDataSet(DataSetResourceDescriptor dataSetDescriptor)
View Full Code Here

Examples of org.jboss.arquillian.persistence.dbunit.dataset.DataSetRegister.addExpected()

   private void createExpectedDataSets(Collection<DataSetResourceDescriptor> dataSetDescriptors)
   {
      DataSetRegister dataSetRegister = getOrCreateDataSetRegister();
      for (DataSetResourceDescriptor dataSetDescriptor : dataSetDescriptors)
      {
         dataSetRegister.addExpected(dataSetDescriptor.getContent());
      }
      dataSetRegisterProducer.set(dataSetRegister);
   }

   private DataSetRegister getOrCreateDataSetRegister()
View Full Code Here

Examples of org.jboss.arquillian.persistence.dbunit.dataset.DataSetRegister.addExpected()

   private void createExpectedDataSets(Collection<DataSetResourceDescriptor> dataSetDescriptors)
   {
      DataSetRegister dataSetRegister = getOrCreateDataSetRegister();
      for (DataSetResourceDescriptor dataSetDescriptor : dataSetDescriptors)
      {
         dataSetRegister.addExpected(dataSetDescriptor.getContent());
      }
      dataSetRegisterProducer.set(dataSetRegister);
   }

   private DataSetRegister getOrCreateDataSetRegister()
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.