|
| 1 | +# This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | +# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | +# file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 4 | + |
| 5 | +# These tests are dedicated to test the required cluster-specific functionalities of TypeDB drivers. The files in this package |
| 6 | +# can be used to test any client application which aims to support all the operations presented in this file for the |
| 7 | +# complete user experience. The following steps are suitable and strongly recommended for both CORE and CLOUD drivers. |
| 8 | + |
| 9 | +# NOTE: It's hard to cover many cluster-specific features in behavior tests, so pay more attention to more flexible |
| 10 | +# integration testing. |
| 11 | + |
| 12 | +#noinspection CucumberUndefinedStep |
| 13 | +Feature: Driver Cluster |
| 14 | + |
| 15 | + Background: Open connection, create driver, create database |
| 16 | + Given typedb starts |
| 17 | + Given connection is open: false |
| 18 | + Given connection opens with default authentication |
| 19 | + Given connection is open: true |
| 20 | + Given connection has 0 databases |
| 21 | + Given connection create database: typedb |
| 22 | + Given connection has database: typedb |
| 23 | + |
| 24 | + ####################### |
| 25 | + # ADDRESS TRANSLATION # |
| 26 | + ####################### |
| 27 | + |
| 28 | + Scenario: Driver can work with connection with address translation |
| 29 | + Given connection closes |
| 30 | + Given connection is open: false |
| 31 | + When connection opens with default address translation with default authentication |
| 32 | + Then connection is open: true |
| 33 | + |
| 34 | + Then connection has 1 user |
| 35 | + When create user with username 'user', password 'password' |
| 36 | + Then connection has 2 users |
| 37 | + |
| 38 | + Then connection has 1 database |
| 39 | + When connection create database: second |
| 40 | + Then connection has 2 databases |
| 41 | + |
| 42 | + When connection open schema transaction for database: typedb |
| 43 | + When typeql schema query |
| 44 | + """ |
| 45 | + define |
| 46 | + entity person @abstract, owns name; |
| 47 | + attribute name, value string; |
| 48 | + """ |
| 49 | + Then transaction commits |
| 50 | + Then connection get database(typedb) has schema: |
| 51 | + """ |
| 52 | + define |
| 53 | + entity person @abstract, owns name; |
| 54 | + attribute name, value string; |
| 55 | + """ |
| 56 | + |
| 57 | + When connection open read transaction for database: typedb |
| 58 | + When get answers of typeql read query |
| 59 | + """ |
| 60 | + match entity $p; |
| 61 | + """ |
| 62 | + Then answer size is: 1 |
| 63 | + |
0 commit comments