public HostConfiguration(Map externalProperties, List<Server> servers, String persistenceUnit, final KunderaMetadata kunderaMetadata) { buildHosts(externalProperties, servers, persistenceUnit, kunderaMetadata); }
public void onValidation(final String host, final String port) { super.onValidation(host, port); } }
@Test public void testPartialOverridingOfPUProperties() { Map<String, Object> puMap = new HashMap<String, Object>(); puMap.put("kundera.keyspace", "KunderaKeyspace"); puMap.put("kundera.port", "9160"); puMap.put("kundera.client.lookup.class", "com.impetus.client.cassandra.thrift.ThriftClientFactory"); puMap.put(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0); emf = Persistence.createEntityManagerFactory("partialPropertyOverridePU", puMap); em = emf.createEntityManager(); HostConfiguration hostConfig = new CassandraHostConfiguration(puMap, CassandraPropertyReader.csmd, "partialPropertyOverridePU", ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance()); Assert.assertEquals(hostConfig.getHosts().get(0).getHost(), "localhost"); Assert.assertEquals(hostConfig.getHosts().get(0).getPort(), 9160); }
buildHosts(hosts, portAsString, this.hostsList); buildHosts(servers, this.hostsList);