Skip to content

Commit 19e680c

Browse files
authored
Merge pull request #5 from xebialabs-community/refreshDatabase
Adding an automated test for refresh database
2 parents f555c30 + 60ed1a8 commit 19e680c

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/main/resources/delphix/DelphixClient.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#
1010
import json
1111

12+
from delphixpy.web.database import database
1213
from delphixpy.web.selfservice import bookmark
1314
from delphixpy.web.selfservice import branch
1415

@@ -62,4 +63,7 @@ def delphix_deletebookmark(self, variables):
6263
bookmark_ref = find_bookmark_ref(self.engine, path['template_name'], path['container_name'], path['branch_name'], path['bookmark_name'])
6364
bookmark.delete(self.engine, bookmark_ref)
6465

65-
print "Bookmark '%s' deleted" % variables['bookmark_path']
66+
print "Bookmark '%s' deleted" % variables['bookmark_path']
67+
68+
def delphix_refreshdatabase(self, variables):
69+
return database.refresh(self.engine, variables['vdb'], None)

src/main/resources/synthetic.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444

4545
<!-- Database actions -->
4646
<type type="delphix.refreshDatabase" extends="delphix.Task">
47-
4847
<property name="vdb" category="input" description="Reference to a container (vdb) object" />
49-
5048
</type>
5149

5250
<type type="delphix.Snapshot" extends="delphix.Task">

src/main/resources/delphix/refreshDatabase.py renamed to src/test/jython/itests/Database_refresh_test.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
99
#
1010

11-
# Refreshes a database
1211

13-
from delphixpy.web.database import database
14-
from delphix.lib.DelphixSession import DelphixSession
1512

16-
engine = DelphixSession.create(server).server_session
17-
result = database.refresh(engine, vdb, None)
13+
import unittest
14+
from itests import DelphixServerCi
15+
from delphix.DelphixClient import DelphixClient
16+
from delphix.lib.DlpxException import DlpxException
17+
18+
19+
class RefreshDatabase(unittest.TestCase):
20+
21+
22+
def test_refresh_database(self):
23+
client = DelphixClient.create_client(DelphixServerCi())
24+
variables = {"vdb": "somevirtualdatabase" }
25+
client.delphix_refreshdatabase(variables)

0 commit comments

Comments
 (0)