Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #181 from antonioalf/branch-0.5
Browse files Browse the repository at this point in the history
add new feature for mongo delegate operations
  • Loading branch information
mafernandez-stratio committed Nov 16, 2015
2 parents 63e3323 + 8d03ff7 commit cca6505
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ Feature: Test crossdata shell attach/add operations
Then I expect a 'Some required properties are missing' message

Scenario: Attach valid connector
Given I run the shell command "ATTACH CONNECTOR MongoConnector TO testCluster WITH OPTIONS {'DefaultLimit': '1000'};"
Given I run the shell command "ATTACH CONNECTOR MongoConnector TO testCluster WITH OPTIONS {};"
Then I expect a 'Connected to cluster successfully' message

Scenario: Attach same valid connector
Given I run the shell command "ATTACH CONNECTOR MongoConnector TO testCluster WITH OPTIONS {'DefaultLimit': '1000'};"
Given I run the shell command "ATTACH CONNECTOR MongoConnector TO testCluster WITH OPTIONS {};"
Then I expect a 'ERROR: Couldn't connect to cluster: The connection to testCluster already exists.' message

Scenario: [CROSSDATA-107] Detach cluster before detaching connector causes corruption in infinispan
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@ignore @unimplemented
Feature: Test delegate operations in mongoDB

Scenario: Attach cluster and connectors
Given I run the shell command "ATTACH CLUSTER testCluster ON DATASTORE Mongo WITH OPTIONS {'Hosts': '[172.31.13.46,172.31.15.233,172.31.5.190]', 'Port': '[27017,27017,27017]'};"
Then I expect a 'Cluster attached successfully' message
Given I run the shell command "ATTACH CONNECTOR MongoConnector TO testCluster WITH OPTIONS {};"
Then I expect a 'Connected to cluster successfully' message
Given I run the shell command "ATTACH CONNECTOR SparkSQLConnector TO testCluster WITH OPTIONS {'DefaultLimit': '1000'};"
Then I expect a 'Connected to cluster successfully' message

Scenario: Create tables
Given I run the shell command "CREATE TABLE myTable ON CLUSTER testCluster (id int primary key, name text);"
Then I expect a 'TABLE created successfully' message
Given I run the shell command "INSERT INTO myTable (id, name) VALUES (1, 'Hugo');"
Then I expect a 'STORED successfully' message
Given I run the shell command "INSERT INTO myTable (id, name) VALUES (2, 'Tony');"
Then I expect a 'STORED successfully' message

Scenario: [CROSSDATA-126] SELECT with JOIN and aliases
Given I run the shell command "SELECT myTable.id, myTable2.id as id FROM myTable JOIN myTable2 ON myTable.id = myTable2.id;"
Then the result has to be:
| id | id |
| 1 | 1 |
| 2 | 2 |

Scenario: [CROSSDATA-129 CROSSDATA-116] SELECT_CASE_WHEN
Given I run the shell command "SELECT "id", CASE WHEN "id" < 2 THEN 'Hugo' WHEN "id" > 1 THEN 'Tony' ELSE 'Pepe' END FROM myTable;"
Then the result has to be:
| id | |
| 1 | Hugo |
| 2 | Tony |

Scenario: [CROSSDATA-130] SELECT NOT BETWEEN IN PRIMARY KEY
Given I run the shell command "select * from myTable where id not between 3 and 4;"
Then the result has to be:
| id | name |
| 1 | Hugo |
| 2 | Tony |

Scenario: [CROSSDATA-131] SELECT NOT LIKE IN NOT PRIMARY KEY
Given I run the shell command "select * from myTable where name not like 'Hugo';"
Then the result has to be:
| id | name |
| 2 | Tony |

Scenario: [CROSSDATA-133] SELECT NOT IN
Given I run the shell command "select * from myTable where id not in [3,4];"
Then the result has to be:
| id | name |
| 1 | Hugo |
| 2 | Tony |

Scenario: [CROSSDATA-134] SELECT SUM NOT IN
Given I run the shell command "ALTER TABLE myTable ADD amount INT"
When I run the shell command "SELECT sum(amount) FROM myTable WHERE id NOT IN [1];"
Then the result has to be:
| sum |
| 2 |

Scenario: [CROSSDATA-135] SELECT SUM DISTINCT
When I run the shell command "SELECT sum(amount) FROM myTable WHERE id <> 2;"
Then the result has to be:
| sum |
| 1 |

Scenario: [CROSSDATA-136] SELECT SUM NOT BETWEEN
When I run the shell command "SELECT sum(amount) FROM myTable WHERE id NOT BETWEEN 0 AND 1;"
Then the result has to be:
| sum |
| 2 |

0 comments on commit cca6505

Please sign in to comment.