Fixed issue in assigning database name when it shouldnt be set (CouchDB) Project: http://git-wip-us.apache.org/repos/asf/metamodel-membrane/repo Commit: http://git-wip-us.apache.org/repos/asf/metamodel-membrane/commit/40d0564f Tree: http://git-wip-us.apache.org/repos/asf/metamodel-membrane/tree/40d0564f Diff: http://git-wip-us.apache.org/repos/asf/metamodel-membrane/diff/40d0564f
Branch: refs/heads/master Commit: 40d0564f1c60fdbc4871ea8599b8ed928ff2d2c3 Parents: a6033aa Author: Kasper Sørensen <i.am.kasper.soren...@gmail.com> Authored: Sun Aug 20 01:15:12 2017 -0700 Committer: Kasper Sørensen <i.am.kasper.soren...@gmail.com> Committed: Sun Aug 20 01:21:21 2017 -0700 ---------------------------------------------------------------------- .../controllers/DataSourceController.java | 5 --- .../TenantInteractionScenarioTest.java | 6 +-- pom.xml | 47 +++++++++++++++++++- .../docker-toolbox.postman_environment.json | 2 +- .../localhost.postman_environment.json | 2 +- 5 files changed, 51 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/metamodel-membrane/blob/40d0564f/core/src/main/java/org/apache/metamodel/membrane/controllers/DataSourceController.java ---------------------------------------------------------------------- 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 @@ public class DataSourceController { 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() http://git-wip-us.apache.org/repos/asf/metamodel-membrane/blob/40d0564f/core/src/test/java/org/apache/metamodel/membrane/controllers/TenantInteractionScenarioTest.java ---------------------------------------------------------------------- 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 @@ public class TenantInteractionScenarioTest { // 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 @@ public class TenantInteractionScenarioTest { // 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); http://git-wip-us.apache.org/repos/asf/metamodel-membrane/blob/40d0564f/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 4a9ec09..1c1c32c 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ under the License. <url>http://metamodel.apache.org</url> <inceptionYear>2017</inceptionYear> <packaging>pom</packaging> - + <profiles> <profile> <id>all</id> @@ -66,6 +66,51 @@ under the License. </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> http://git-wip-us.apache.org/repos/asf/metamodel-membrane/blob/40d0564f/postman-tests/environments/docker-toolbox.postman_environment.json ---------------------------------------------------------------------- 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, http://git-wip-us.apache.org/repos/asf/metamodel-membrane/blob/40d0564f/postman-tests/environments/localhost.postman_environment.json ---------------------------------------------------------------------- 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,