Fixed issue in assigning database name when it shouldnt be set (CouchDB)
diff --git a/core/src/main/java/org/apache/metamodel/membrane/controllers/DataSourceController.java b/core/src/main/java/org/apache/metamodel/membrane/controllers/DataSourceController.java
index 194bbe4..7540cf5 100644
--- a/core/src/main/java/org/apache/metamodel/membrane/controllers/DataSourceController.java
+++ b/core/src/main/java/org/apache/metamodel/membrane/controllers/DataSourceController.java
@@ -65,11 +65,6 @@
map.putAll(dataContextDefinition.getProperties());
map.put(DataContextPropertiesImpl.PROPERTY_DATA_CONTEXT_TYPE, dataContextDefinition.getType());
- if (!map.containsKey(DataContextPropertiesImpl.PROPERTY_DATABASE)) {
- // add the data source ID as database name if it is not already set.
- map.put(DataContextPropertiesImpl.PROPERTY_DATABASE, dataSourceId);
- }
-
final DataContextProperties properties = new DataContextPropertiesImpl(map);
final String dataContextIdentifier = tenantRegistry.getTenantContext(tenantId).getDataSourceRegistry()
diff --git a/core/src/test/java/org/apache/metamodel/membrane/controllers/TenantInteractionScenarioTest.java b/core/src/test/java/org/apache/metamodel/membrane/controllers/TenantInteractionScenarioTest.java
index b410e01..8a56934 100644
--- a/core/src/test/java/org/apache/metamodel/membrane/controllers/TenantInteractionScenarioTest.java
+++ b/core/src/test/java/org/apache/metamodel/membrane/controllers/TenantInteractionScenarioTest.java
@@ -77,7 +77,7 @@
// create datasource
{
final MvcResult result = mockMvc.perform(MockMvcRequestBuilders.put("/tenant1/mydata").content(
- "{'type':'pojo','table-defs':'hello_world (greeting VARCHAR, who VARCHAR); foo (bar INTEGER, baz DATE);'}"
+ "{'type':'pojo','database':'mydata','table-defs':'hello_world (greeting VARCHAR, who VARCHAR); foo (bar INTEGER, baz DATE);'}"
.replace('\'', '"')).contentType(MediaType.APPLICATION_JSON)).andExpect(
MockMvcResultMatchers.status().isOk()).andReturn();
@@ -185,8 +185,8 @@
// query metadata from information_schema
{
final MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get("/tenant1/mydata/q?sql={sql}",
- "SELECT greeting, who AS who_is_it FROM hello_world")).andExpect(MockMvcResultMatchers.status()
- .isOk()).andReturn();
+ "SELECT greeting, who AS who_is_it FROM hello_world"))
+ .andExpect(MockMvcResultMatchers.status().isOk()).andReturn();
final String content = result.getResponse().getContentAsString();
final Map<?, ?> map = new ObjectMapper().readValue(content, Map.class);
diff --git a/pom.xml b/pom.xml
index 4a9ec09..1c1c32c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@
<url>http://metamodel.apache.org</url>
<inceptionYear>2017</inceptionYear>
<packaging>pom</packaging>
-
+
<profiles>
<profile>
<id>all</id>
@@ -66,6 +66,51 @@
</profile>
</profiles>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <licenses>
+ <license
+ implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
+ <licenseFamilyCategory>ASL20</licenseFamilyCategory>
+ <licenseFamilyName>Apache Software License, 2.0</licenseFamilyName>
+ <notes>Single licensed ASL v2.0</notes>
+ <patterns>
+ <pattern>Licensed to the Apache Software Foundation (ASF) under
+ one
+ or more contributor license agreements.</pattern>
+ </patterns>
+ </license>
+ </licenses>
+ <excludeSubProjects>false</excludeSubProjects>
+ <excludes>
+ <exclude>KEYS</exclude>
+ <exclude>**/*.md</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/.gitignore/**</exclude>
+ <exclude>.git/**</exclude>
+ <exclude>.gitattributes</exclude>
+ <exclude>**/.project</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>**/.settings/**</exclude>
+ <exclude>**/.vscode/**</exclude>
+ <exclude>**/.travis.yml</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/*.iml/**</exclude>
+ <exclude>**/*.iws/**</exclude>
+ <exclude>**/*.ipr/**</exclude>
+ <exclude>**/.idea/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
<dependencyManagement>
<dependencies>
<dependency>
diff --git a/postman-tests/environments/docker-toolbox.postman_environment.json b/postman-tests/environments/docker-toolbox.postman_environment.json
index c3e3d30..e04cb2e 100644
--- a/postman-tests/environments/docker-toolbox.postman_environment.json
+++ b/postman-tests/environments/docker-toolbox.postman_environment.json
@@ -1,6 +1,6 @@
{
"id": "556c1331-5e87-4201-2767-8089cdb8e523",
- "name": "Membrane boot2docker",
+ "name": "Membrane docker-toolbox",
"values": [
{
"enabled": true,
diff --git a/postman-tests/environments/localhost.postman_environment.json b/postman-tests/environments/localhost.postman_environment.json
index 5dc0d0f..527d430 100644
--- a/postman-tests/environments/localhost.postman_environment.json
+++ b/postman-tests/environments/localhost.postman_environment.json
@@ -1,6 +1,6 @@
{
"id": "fa99af7e-2115-254e-649e-7a2742704dbb",
- "name": "Membrane local",
+ "name": "Membrane localhost",
"values": [
{
"enabled": true,