Package org.infinispan.client.hotrod

Examples of org.infinispan.client.hotrod.RemoteCacheManager


               infinispanRemoteCacheManagerConfiguredFromConfigurationProperties);
   }

   @Test
   public final void shouldCreateARemoteCacheManagerConfiguredUsingSettersIfPropertiesAreDefined() {
      final RemoteCacheManager infinispanRemoteCacheManagerConfiguredUsingSetters = this.applicationContext
               .getBean(INFINISPAN_REMOTE_CACHE_MANAGER_CONFIGURED_USING_SETTERS_BEAN_NAME,
                        RemoteCacheManager.class);

      assertNotNull(
               "Spring application context should contain a SpringRemoteCacheManager configured using properties having bean name = \""
View Full Code Here


   @BeforeClass
   public void setupRemoteCacheFactory() {
      hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19733);
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.addServer().host("localhost").port(hotrodServer.getPort());
      remoteCacheManager = new RemoteCacheManager(builder.build());
   }
View Full Code Here

            throws Exception {
      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();

      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
      assertPropertiesSubset(
               "The configuration properties used by the RemoteCacheManager returned by getObject() should be equal "
                        + "to RemoteCacheManager's default settings since neither property 'configurationProperties' "
                        + "nor property 'configurationPropertiesFileLocation' has been set. However, those two are not equal.",
               new RemoteCacheManager().getProperties(), remoteCacheManager.getProperties());
      objectUnderTest.destroy();
   }
View Full Code Here

    */
   @Test
   public final void destroyShouldStopTheProducedCache() throws Exception {
      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      objectUnderTest.afterPropertiesSet();
      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();

      objectUnderTest.destroy();

      assertFalse(
               "destroy() should have stopped the RemoteCacheManager instance previously produced by "
                        + "AbstractRemoteCacheManagerFactory. However, the produced RemoteCacheManager is still running. ",
               remoteCacheManager.isStarted());
   }
View Full Code Here

      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      final Properties configurationProperties = loadConfigurationProperties(HOTROD_CLIENT_PROPERTIES_LOCATION);
      objectUnderTest.setConfigurationProperties(configurationProperties);
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
      assertPropertiesSubset(
               "The configuration properties used by the RemoteCacheManager returned von getObject() should be equal "
                        + "to those passed into InfinispanRemoteCacheMangerFactoryBean via setConfigurationProperties(props). "
                        + "However, those two are not equal.", configurationProperties,
               remoteCacheManager.getProperties());
      objectUnderTest.destroy();
   }
View Full Code Here

            throws Exception {
      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      objectUnderTest.setConfigurationPropertiesFileLocation(HOTROD_CLIENT_PROPERTIES_LOCATION);
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();
      assertPropertiesSubset(
               "The configuration properties used by the RemoteCacheManager returned by getObject() should be equal "
                        + "to those passed into InfinispanRemoteCacheMangerFactoryBean via setConfigurationPropertiesFileLocation(propsFileLocation). "
                        + "However, those two are not equal.",
               loadConfigurationProperties(HOTROD_CLIENT_PROPERTIES_LOCATION),
               remoteCacheManager.getProperties());
      objectUnderTest.destroy();
   }
View Full Code Here

   public final void shouldProduceAStoppedCacheIfStartAutomaticallyIsSetToFalse() throws Exception {
      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      objectUnderTest.setStartAutomatically(false);
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManagerExpectedToBeInStateStopped = objectUnderTest
               .getObject();

      assertFalse(
               "AbstractRemoteCacheManagerFactory should have produced a RemoteCacheManager that is initially in state stopped "
                        + "since property 'startAutomatically' has been set to false. However, the produced RemoteCacheManager is already started.",
               remoteCacheManagerExpectedToBeInStateStopped.isStarted());
      objectUnderTest.destroy();
   }
View Full Code Here

      objectUnderTest.setTransportFactory(expectedTransportFactory);
      objectUnderTest.setStartAutomatically(false); // Otherwise, RemoteCacheManager will try to
                                                    // actually use our DummyTransportFactory
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();

      assertEquals("setTransportFactory(" + expectedTransportFactory
               + ") should have overridden property 'transportFactory'. However, it didn't.",
               expectedTransportFactory, remoteCacheManager.getProperties().get(TRANSPORT_FACTORY));
      objectUnderTest.destroy();
   }
View Full Code Here

      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      final String expectedServerListString = "testhost:4632";
      objectUnderTest.setServerList(expectedServerList);
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();

      assertEquals("setServerList(" + expectedServerList
               + ") should have overridden property 'serverList'. However, it didn't.",
               expectedServerListString, remoteCacheManager.getProperties().get(SERVER_LIST));
      objectUnderTest.destroy();
   }
View Full Code Here

      final InfinispanRemoteCacheManagerFactoryBean objectUnderTest = new InfinispanRemoteCacheManagerFactoryBean();
      objectUnderTest.setMarshaller(expectedMarshaller);
      objectUnderTest.setStartAutomatically(false);
      objectUnderTest.afterPropertiesSet();

      final RemoteCacheManager remoteCacheManager = objectUnderTest.getObject();

      assertEquals("setMarshaller(" + expectedMarshaller
               + ") should have overridden property 'marshaller'. However, it didn't.",
               expectedMarshaller, remoteCacheManager.getProperties().get(MARSHALLER));
      objectUnderTest.destroy();
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.RemoteCacheManager

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.