From 77e8cc3512f559f1f724b37c5052768a3bf20e38 Mon Sep 17 00:00:00 2001 From: Andrew Wickham Date: Wed, 20 Jun 2018 10:33:40 -0400 Subject: [PATCH] Initial commit --- .vscode/settings.json | 8 + .vscode/tasks.json | 134 ++++++ DbVisualizer/DbVisualizer.psd1 | 125 +++++ DbVisualizer/DbVisualizer.psm1 | 17 + DbVisualizer/Internal/Get-DbvXml.ps1 | 17 + DbVisualizer/Internal/Save-DbvXml.ps1 | 11 + DbVisualizer/Public/Add-DbvConnection.ps1 | 66 +++ DbVisualizer/Public/Merge-DbvConnection.ps1 | 62 +++ DbVisualizer/Public/Merge-DbvDriver.ps1 | 59 +++ DbVisualizer/Public/Merge-DbvPreference.ps1 | 87 ++++ Tests/Add-DbvConnection.Tests.ps1 | 0 Tests/Header.ps1 | 3 + Tests/Merge-DbvConnection.Tests.ps1 | 0 Tests/Merge-DbvDriver.Tests.ps1 | 114 +++++ Tests/Merge-DbvPreference.Tests.ps1 | 156 ++++++ Tests/MockAddDriverMaster.xml | 361 ++++++++++++++ Tests/MockAddDriverTarget.xml | 344 +++++++++++++ Tests/MockMaster.xml | 419 ++++++++++++++++ Tests/MockRemoveDriverMaster.xml | 345 ++++++++++++++ Tests/MockRemoveDriverTarget.xml | 361 ++++++++++++++ Tests/MockTarget.xml | 422 ++++++++++++++++ Tests/MockUpdateDriverMaster.xml | 361 ++++++++++++++ Tests/MockUpdateDriverTarget.xml | 361 ++++++++++++++ Tests/Updated.xml | 494 +++++++++++++++++++ Tests/dbvis.master.xml | 504 ++++++++++++++++++++ Tests/dbvis.xml | 494 +++++++++++++++++++ 26 files changed, 5325 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 DbVisualizer/DbVisualizer.psd1 create mode 100644 DbVisualizer/DbVisualizer.psm1 create mode 100644 DbVisualizer/Internal/Get-DbvXml.ps1 create mode 100644 DbVisualizer/Internal/Save-DbvXml.ps1 create mode 100644 DbVisualizer/Public/Add-DbvConnection.ps1 create mode 100644 DbVisualizer/Public/Merge-DbvConnection.ps1 create mode 100644 DbVisualizer/Public/Merge-DbvDriver.ps1 create mode 100644 DbVisualizer/Public/Merge-DbvPreference.ps1 create mode 100644 Tests/Add-DbvConnection.Tests.ps1 create mode 100644 Tests/Header.ps1 create mode 100644 Tests/Merge-DbvConnection.Tests.ps1 create mode 100644 Tests/Merge-DbvDriver.Tests.ps1 create mode 100644 Tests/Merge-DbvPreference.Tests.ps1 create mode 100644 Tests/MockAddDriverMaster.xml create mode 100644 Tests/MockAddDriverTarget.xml create mode 100644 Tests/MockMaster.xml create mode 100644 Tests/MockRemoveDriverMaster.xml create mode 100644 Tests/MockRemoveDriverTarget.xml create mode 100644 Tests/MockTarget.xml create mode 100644 Tests/MockUpdateDriverMaster.xml create mode 100644 Tests/MockUpdateDriverTarget.xml create mode 100644 Tests/Updated.xml create mode 100644 Tests/dbvis.master.xml create mode 100644 Tests/dbvis.xml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..70b0ac7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + // When enabled, will trim trailing whitespace when you save a file. + "files.trimTrailingWhitespace": true, + + // Enable PSScriptAnalyzer + "powershell.scriptAnalysis.enable": true, + "powershell.scriptAnalysis.settingsPath": "PSScriptAnalyzerSettings.psd1" +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..fe8acad --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,134 @@ +// A task runner that invokes Pester to run all Pester tests under the +// current workspace folder. +// NOTE: This Test task runner requires an updated version of Pester (>=4.0.3) +// in order for the problemMatcher to find failed test information (message, line, file). +// If you don't have that version, you can update Pester from the PowerShell Gallery +// with this command: +// +// PS C:\> Update-Module Pester +// +// If that gives an error like: +// "Module 'Pester' was not installed by using Install-Module, so it cannot be updated." +// then execute: +// +// PS C:\> Install-Module Pester -Scope CurrentUser -Force +// +// NOTE: The Clean, Build and Publish tasks require PSake. PSake can be installed +// from the PowerShell Gallery with this command: +// +// PS C:\> Install-Module PSake -Scope CurrentUser -Force +// +// Available variables which can be used inside of strings: +// ${workspaceFolder} the path of the workspace folder that contains the tasks.json file +// ${workspaceFolderBasename} the name of the workspace folder that contains the tasks.json file without any slashes (/) +// ${file} the current opened file +// ${relativeFile} the current opened file relative to the workspace folder containing the file +// ${fileBasename} the current opened file's basename +// ${fileBasenameNoExtension} the current opened file's basename without the extension +// ${fileDirname} the current opened file's dirname +// ${fileExtname} the current opened file's extension +// ${cwd} the task runner's current working directory on startup +// ${lineNumber} the current selected line number in the active file +{ + "version": "2.0.0", + "windows": { + "options": { + "shell": { + "executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + "args": [ + "-NoProfile", + "-ExecutionPolicy", + "Bypass", + "-Command" + ] + } + } + }, + "linux": { + "options": { + "shell": { + "executable": "/usr/bin/pwsh", + "args": [ + "-NoProfile", + "-Command" + ] + } + } + }, + "osx": { + "options": { + "shell": { + "executable": "/usr/local/bin/pwsh", + "args": [ + "-NoProfile", + "-Command" + ] + } + } + }, + "tasks": [ + { + "label": "Clean", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Clean" + }, + { + "label": "Build", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Build", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Test All", + "type": "shell", + "command": "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}", + "group": { + "kind": "test", + "isDefault": true + }, + "problemMatcher": [ + "$pester" + ] + }, + { + "label": "Test Current", + "type": "shell", + "command": "$testFile = if ('${fileBasename}' -like '*.Tests.ps1') { '${fileBasename}' } else { '${fileBasenameNoExtension}.Tests.ps1' }; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true} -Script ('${workspaceRoot}\\Tests\\' + $testFile)", + "group": { + "kind": "test", + "isDefault": true + }, + "problemMatcher": [ + { + "owner": "powershell", + "fileLocation": [ + "absolute" + ], + "severity": "error", + "pattern": [ + { + "regexp": "^\\s*(?:\\[-\\]\\s+)(.*?)(?:\\s+\\d+\\.?\\d*\\s*m?s)\\s*$", + "message": 1 + }, + { + "regexp": "^\\s+at\\s+[^,]+,\\s*(.*?):\\s+line\\s+(\\d+)$", + "file": 1, + "line": 2 + } + ] + } + ] + }, + { + "label": "Publish", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Publish" + } + ] +} + + +// "command": "$ProgressPreference = 'SilentlyContinue'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true} -Script '${workspaceRoot}/Tests/${fileBasenameNoExtension}.Tests.ps1';", diff --git a/DbVisualizer/DbVisualizer.psd1 b/DbVisualizer/DbVisualizer.psd1 new file mode 100644 index 0000000..565abf8 --- /dev/null +++ b/DbVisualizer/DbVisualizer.psd1 @@ -0,0 +1,125 @@ +# +# Module manifest for module 'DbVisualizer' +# +# Generated by: Andrew Wickham +# +# Generated on: 5/18/2018 +# + +@{ + + # Script module or binary module file associated with this manifest. + RootModule = 'DbVisualizer.psm1' + + # Version number of this module. + ModuleVersion = '0.0.1' + + # Supported PSEditions + # CompatiblePSEditions = @() + + # ID used to uniquely identify this module + GUID = '11fb0233-dd04-4b32-b3c9-23913d32c4c4' + + # Author of this module + Author = 'Andrew Wickham' + + # Company or vendor of this module + CompanyName = 'Westfield' + + # Copyright statement for this module + Copyright = '(c) 2018 Westfield. All rights reserved.' + + # Description of the functionality provided by this module + # Description = '' + + # Minimum version of the Windows PowerShell engine required by this module + # PowerShellVersion = '' + + # Name of the Windows PowerShell host required by this module + # PowerShellHostName = '' + + # Minimum version of the Windows PowerShell host required by this module + # PowerShellHostVersion = '' + + # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # DotNetFrameworkVersion = '' + + # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # CLRVersion = '' + + # Processor architecture (None, X86, Amd64) required by this module + # ProcessorArchitecture = '' + + # Modules that must be imported into the global environment prior to importing this module + # RequiredModules = @() + + # Assemblies that must be loaded prior to importing this module + # RequiredAssemblies = @() + + # Script files (.ps1) that are run in the caller's environment prior to importing this module. + # ScriptsToProcess = @() + + # Type files (.ps1xml) to be loaded when importing this module + # TypesToProcess = @() + + # Format files (.ps1xml) to be loaded when importing this module + # FormatsToProcess = @() + + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + # NestedModules = @() + + # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. + FunctionsToExport = @( + 'Merge-DbvDriver', + 'Merge-DbvPreference' + ) + + # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. + #CmdletsToExport = '*' + + # Variables to export from this module + #VariablesToExport = '*' + + # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. + #AliasesToExport = '*' + + # DSC resources to export from this module + # DscResourcesToExport = @() + + # List of all modules packaged with this module + # ModuleList = @() + + # List of all files packaged with this module + # FileList = @() + + # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + # Tags = @() + + # A URL to the license for this module. + # LicenseUri = '' + + # A URL to the main website for this project. + # ProjectUri = '' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + } # End of PSData hashtable + + } # End of PrivateData hashtable + + # HelpInfo URI of this module + # HelpInfoURI = '' + + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' + + } diff --git a/DbVisualizer/DbVisualizer.psm1 b/DbVisualizer/DbVisualizer.psm1 new file mode 100644 index 0000000..9552d65 --- /dev/null +++ b/DbVisualizer/DbVisualizer.psm1 @@ -0,0 +1,17 @@ +$functionFolders = @('Public', 'Internal') +ForEach ($folder in $functionFolders) +{ + $folderPath = Join-Path -Path $PSScriptRoot -ChildPath $folder + If (Test-Path -Path $folderPath) + { + Write-Verbose -Message "Importing from $folder" + $functions = Get-ChildItem -Path $folderPath -Filter '*.ps1' + ForEach ($function in $functions) + { + Write-Verbose -Message " Importing $($function.BaseName)" + . $($function.FullName) + } + } +} +$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\Public" -Filter '*.ps1').BaseName +Export-ModuleMember -Function $publicFunctions \ No newline at end of file diff --git a/DbVisualizer/Internal/Get-DbvXml.ps1 b/DbVisualizer/Internal/Get-DbvXml.ps1 new file mode 100644 index 0000000..1eea8cd --- /dev/null +++ b/DbVisualizer/Internal/Get-DbvXml.ps1 @@ -0,0 +1,17 @@ +function Get-DbvXml { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [string] $Path + ) + + process { + $content = Get-Content -Path $Path -Raw + + if (-not $content) { + throw "Could not read file: $Path" + } + + [xml]$content + } +} \ No newline at end of file diff --git a/DbVisualizer/Internal/Save-DbvXml.ps1 b/DbVisualizer/Internal/Save-DbvXml.ps1 new file mode 100644 index 0000000..91c5834 --- /dev/null +++ b/DbVisualizer/Internal/Save-DbvXml.ps1 @@ -0,0 +1,11 @@ +function Save-DbvXml { + [CmdletBinding()] + param ( + [System.Xml.XmlDocument] $Xml, + [string] $Path + ) + + process { + $Xml.Save($Path) + } +} \ No newline at end of file diff --git a/DbVisualizer/Public/Add-DbvConnection.ps1 b/DbVisualizer/Public/Add-DbvConnection.ps1 new file mode 100644 index 0000000..1ca6e4a --- /dev/null +++ b/DbVisualizer/Public/Add-DbvConnection.ps1 @@ -0,0 +1,66 @@ +param ( + [Parameter(Mandatory = $true)] + $Alias, + + [Parameter(Mandatory = $true)] + [ValidateSet('Development', 'Test', 'Production')] + $PermissionMode, + + [Parameter(Mandatory = $true)] + [ValidateSet('Db2 LUW', 'Db2 z/OS', 'Netezza', 'SQL Server')] + $Driver, + + [Parameter(Mandatory = $true)] + $Server, + + [Parameter(Mandatory = $true)] + $Port, + + [Parameter(Mandatory = $true)] + $Database +) + +# things to update +<# + +Alias +Notes +Url +Driver +Profile +Type +ServerInfoFormat +Properties +UrlFormat +UrlVariables + +#> + +$databaseXml = @" + + $Alias + + + $Driver + + auto + sqlserver + + 1 + + true + Red.png + Production + + 0 + + + $Driver + $Server + $Port + $Database + + + + +"@ \ No newline at end of file diff --git a/DbVisualizer/Public/Merge-DbvConnection.ps1 b/DbVisualizer/Public/Merge-DbvConnection.ps1 new file mode 100644 index 0000000..87794d9 --- /dev/null +++ b/DbVisualizer/Public/Merge-DbvConnection.ps1 @@ -0,0 +1,62 @@ +<# +.SYNOPSIS +Merges the connections portion of a preferences file into the target. + +.DESCRIPTION +Adds or updates connections from a master dbvis.xml file to a target dbvis.xml file. + +.PARAMETER MasterPath +Path to the XML file to read connections from. + +.PARAMETER TargetPath +Path to the XML file to update. + +.EXAMPLE +Updates the user's DbVisualizer connections from a master file. + +Merge-DbvConnection -MasterPath '\\server\FileShare\dbvis.master.xml' -TargetPath '%AppData%\.dbvis\config70\dbvis.xml' + +#> +function Merge-DbvConnection { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + $MasterPath, + + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + $TargetPath, + + [Parameter()] + $Folder + ) + + process { + $masterXml = Get-DbvXml -Path $MasterPath + $targetXml = Get-DbvXml -Path $TargetPath + + foreach ($masterDatabase in $masterXml.DbVisualizer.Databases.GetEnumerator()) { + Write-Verbose "Processing Database $($masterDatabase.Alias)" + $targetDatabase = $targetXml | + Select-Xml -XPath "//Database[Alias = '$($masterDatabase.Alias)']" | + Select-Object -ExpandProperty Node + + # add connection + if (-not $targetDatabase) { + $targetDatabases = $targetXml | + Select-Xml -XPath '/DbVisualizer/Databases' | + Select-Object -ExpandProperty Node + + $targetDatabases.InnerXml += $masterDatabase.OuterXml + } + # update driver + else { + Write-Verbose "Updating database $($masterDatabase.Alias)" + $targetDatabase.InnerXml = $masterDatabase.InnerXml + } + } + + Save-DbvXml -Xml $targetXml -Path $TargetPath + } +} \ No newline at end of file diff --git a/DbVisualizer/Public/Merge-DbvDriver.ps1 b/DbVisualizer/Public/Merge-DbvDriver.ps1 new file mode 100644 index 0000000..7c73d1e --- /dev/null +++ b/DbVisualizer/Public/Merge-DbvDriver.ps1 @@ -0,0 +1,59 @@ +<# +.SYNOPSIS +Merges the drivers portion of a preferences file into the target. + +.DESCRIPTION +Adds or updates drivers from a master dbvis.xml file to a target dbvis.xml file. + +.PARAMETER MasterPath +Path to the XML file to read drivers from. + +.PARAMETER TargetPath +Path to the XML file to update. + +.EXAMPLE +Updates the user's DbVisualizer driver from a master file. + +Merge-DbvDriver -MasterPath '\\server\FileShare\dbvis.master.xml' -TargetPath '%AppData%\.dbvis\config70\dbvis.xml' + +#> +function Merge-DbvDriver { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + $MasterPath, + + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + $TargetPath + ) + + process { + $masterXml = Get-DbvXml -Path $MasterPath + $targetXml = Get-DbvXml -Path $TargetPath + + foreach ($masterDriver in $masterXml.DbVisualizer.Drivers.GetEnumerator()) { + Write-Verbose "Processing Driver $($masterDriver.Name)" + $targetDriver = $targetXml | + Select-Xml -XPath "//Driver[Name = '$($masterDriver.Name)']" | + Select-Object -ExpandProperty Node + + # add driver + if (-not $targetDriver) { + $targetDrivers = $targetXml | + Select-Xml -XPath '/DbVisualizer/Drivers' | + Select-Object -ExpandProperty Node + + $targetDrivers.InnerXml += $masterDriver.OuterXml + } + # update driver + else { + Write-Verbose "Updating driver $($masterDriver.Name)" + $targetDriver.InnerXml = $masterDriver.InnerXml + } + } + + Save-DbvXml -Xml $targetXml -Path $TargetPath + } +} \ No newline at end of file diff --git a/DbVisualizer/Public/Merge-DbvPreference.ps1 b/DbVisualizer/Public/Merge-DbvPreference.ps1 new file mode 100644 index 0000000..9907d83 --- /dev/null +++ b/DbVisualizer/Public/Merge-DbvPreference.ps1 @@ -0,0 +1,87 @@ +<# +.SYNOPSIS +Merges the connections portion of a preferences file into the target. + +.DESCRIPTION +Adds or updates connections from a master dbvis.xml file to a target dbvis.xml file. + +.PARAMETER MasterPath +Path to the XML file to read connections from. + +.PARAMETER TargetPath +Path to the XML file to update. + +.EXAMPLE +Updates the user's DbVisualizer connections from a master file. + +Merge-DbvConnection -MasterPath '\\server\FileShare\dbvis.master.xml' -TargetPath '%AppData%\.dbvis\config70\dbvis.xml' + +#> +function Merge-DbvPreference { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Drivers', 'Databases', 'Folders')] + [string[]] $Category, + + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + [string] $MasterPath, + + [Parameter(Mandatory = $true)] + [ValidateScript({ Test-Path -Path $_ })] + [string] $TargetPath + ) + + begin { + $masterXml = Get-DbvXml -Path $MasterPath + $targetXml = Get-DbvXml -Path $TargetPath + } + + process { + foreach ($cat in $Category) { + switch ($cat) { + 'Drivers' { + $groupString = 'Drivers' + $singularString = 'Driver' + $compareProperty = 'Name' + $mergeLower = $false + } + 'Databases' { + $groupString = 'Databases' + $singularString = 'Database' + $compareProperty = 'Alias' + $mergeLower = $false + } + 'Folders' { + $groupString = 'Objects' + $singularString = 'Folder' + $compareProperty = 'name' + } + } + + foreach ($masterObject in $masterXml.DbVisualizer.$groupString.GetEnumerator()) { + Write-Verbose "Processing $singularString $($masterObject.$compareProperty)" + $targetObject = $targetXml | + Select-Xml -XPath "//$singularString[$compareProperty = '$($masterObject.$compareProperty)']" | + Select-Object -ExpandProperty Node + + if (-not $targetObject) { + $targetGroup = $targetXml | + Select-Xml -XPath "/DbVisualizer/$groupString" | + Select-Object -ExpandProperty Node + + $targetGroup.InnerXml += $masterObject.OuterXml + } + else { + Write-Verbose "Updating $singularString $($masterObject.$compareProperty)" + $targetObject.InnerXml = $masterObject.InnerXml + } + } + } + } + + end { + Save-DbvXml -Xml $targetXml -Path $TargetPath + } +} \ No newline at end of file diff --git a/Tests/Add-DbvConnection.Tests.ps1 b/Tests/Add-DbvConnection.Tests.ps1 new file mode 100644 index 0000000..e69de29 diff --git a/Tests/Header.ps1 b/Tests/Header.ps1 new file mode 100644 index 0000000..da95a16 --- /dev/null +++ b/Tests/Header.ps1 @@ -0,0 +1,3 @@ +$moduleManifestName = 'DbVisualizer\DbVisualizer.psd1' +$moduleManifestPath = "$PSscriptRoot\..\$moduleManifestName" +Import-Module -FullyQualifiedName $moduleManifestPath -Force \ No newline at end of file diff --git a/Tests/Merge-DbvConnection.Tests.ps1 b/Tests/Merge-DbvConnection.Tests.ps1 new file mode 100644 index 0000000..e69de29 diff --git a/Tests/Merge-DbvDriver.Tests.ps1 b/Tests/Merge-DbvDriver.Tests.ps1 new file mode 100644 index 0000000..b9bd0d7 --- /dev/null +++ b/Tests/Merge-DbvDriver.Tests.ps1 @@ -0,0 +1,114 @@ +. "$PSScriptRoot\Header.ps1" + +Describe 'Merge-DbvDriver Tests' { + InModuleScope -ModuleName 'DbVisualizer' { + Context 'Command Usage' { + $command = Get-Command -Module 'DbVisualizer' -Name 'Merge-DbvDriver' + It 'Should have a MasterPath parameter' { + $command.Parameters.ContainsKey('MasterPath') | Should Be $true + } + + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $false } + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpTargetPath.xml' } -MockWith { $true } + + It 'Should validate MasterPath existence' { + { Merge-DbvDriver -MasterPath 'C:\MadeUpMasterPath.xml' -TargetPath 'C:\MadeUpTargetPath.xml' } | Should Throw + Assert-MockCalled -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -Times 1 + } + + It 'Should have a TargetPath parameter' { + $command.Parameters.ContainsKey('TargetPath') | Should Be $true + } + + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $true } + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpTargetPath.xml' } -MockWith { $false } + + It 'Should validate TargetPath existence' { + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $true } + { Merge-DbvDriver -MasterPath 'C:\MadeUpMasterPath.xml' -TargetPath 'C:\MadeUpTargetPath.xml' } | Should Throw + + Assert-MockCalled -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -Times 1 + } + } + + Context 'Functionality' { + Mock -CommandName Save-DbvXml -MockWith { + $script:updatedXml = $Xml + } + + It 'Adds a driver' { + $masterPath = '.\Tests\MockAddDriverMaster.xml' + $targetPath = '.\Tests\MockAddDriverTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + Merge-DbvDriver -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $targetXml.DbVisualizer.Drivers.OuterXml | Should -Not -Be $masterXml.DbVisualizer.Drivers.OuterXml + + $beforeCount = $targetXml.DbVisualizer.Drivers.Driver.Count + $afterCount = $script:updatedXml.DbVisualizer.Drivers.Driver.Count + $afterCount | Should -BeGreaterThan $beforeCount + } + + It 'Updates a driver' { + $masterPath = '.\Tests\MockUpdateDriverMaster.xml' + $targetPath = '.\Tests\MockUpdateDriverTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + Merge-DbvDriver -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $master = $masterXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + $target = $targetXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + $after = $script:updatedXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + + $master.URLFormat | Should -Not -Be $target.URLFormat + $after.URLFormat | Should -Be $master.URLFormat + } + + It "Doesn't change non-driver settings" { + $masterPath = '.\Tests\MockUpdateDriverMaster.xml' + $targetPath = '.\Tests\MockUpdateDriverTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + $master = $masterXml.DbVisualizer.General.AskQuit + $target = $targetXml.DbVisualizer.General.AskQuit + + $master | Should -Not -Be $target + + Merge-DbvDriver -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $after = $script:updatedXml.DbVisualizer.General.AskQuit + + $target | Should -Be $after + } + + It "Doesn't remove drivers" { + $masterPath = '.\Tests\MockRemoveDriverMaster.xml' + $targetPath = '.\Tests\MockRemoveDriverTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + Merge-DbvDriver -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $master = $masterXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + $target = $targetXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + $after = $script:updatedXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq 'SQL Server (Microsoft)' } + + $master | Should -BeNullOrEmpty + $target | Should -Not -BeNullOrEmpty + $after | Should -Not -BeNullOrEmpty + } + } + } +} \ No newline at end of file diff --git a/Tests/Merge-DbvPreference.Tests.ps1 b/Tests/Merge-DbvPreference.Tests.ps1 new file mode 100644 index 0000000..4502486 --- /dev/null +++ b/Tests/Merge-DbvPreference.Tests.ps1 @@ -0,0 +1,156 @@ +. "$PSScriptRoot\Header.ps1" + +Describe 'Merge-DbvPreference Tests' { + InModuleScope -ModuleName 'DbVisualizer' { + Context 'Command Usage' { + $command = Get-Command -Module 'DbVisualizer' -Name 'Merge-DbvPreference' + It 'Should have a MasterPath parameter' { + $command.Parameters.ContainsKey('MasterPath') | Should Be $true + } + + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $false } + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpTargetPath.xml' } -MockWith { $true } + + It 'Should validate MasterPath existence' { + { Merge-DbvPreference -MasterPath 'C:\MadeUpMasterPath.xml' -TargetPath 'C:\MadeUpTargetPath.xml' } | Should Throw + Assert-MockCalled -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -Times 1 + } + + It 'Should have a TargetPath parameter' { + $command.Parameters.ContainsKey('TargetPath') | Should Be $true + } + + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $true } + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpTargetPath.xml' } -MockWith { $false } + + It 'Should validate TargetPath existence' { + Mock -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -MockWith { $true } + { Merge-DbvPreference -MasterPath 'C:\MadeUpMasterPath.xml' -TargetPath 'C:\MadeUpTargetPath.xml' } | Should Throw + + Assert-MockCalled -CommandName 'Test-Path' -ParameterFilter { $Path -eq 'C:\MadeUpMasterPath.xml' } -Times 1 + } + } + + Context 'Drivers' { + Mock -CommandName Save-DbvXml -MockWith { + $script:updatedXml = $Xml + } + + $masterPath = '.\Tests\MockMaster.xml' + $targetPath = '.\Tests\MockTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + It 'Adds' { + $driverName = 'Netezza' + + $master = $masterXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $master | Should -Not -BeNullOrEmpty + + $target = $targetXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $target | Should -BeNullOrEmpty + + Merge-DbvPreference -Category 'Drivers' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $updated = $script:updatedXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $master.Name | Should -Be $updated.Name + } + + It 'Updates' { + $driverName = 'SQL Server (Microsoft)' + + $master = $masterXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $target = $targetXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $master.URLFormat | Should -Not -Be $target.URLFormat + + Merge-DbvPreference -Category 'Drivers' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $after = $script:updatedXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $after.URLFormat | Should -Be $master.URLFormat + } + + It "Doesn't remove" { + $driverName = 'DB2 z/OS' + + $master = $masterXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $master | Should -BeNullOrEmpty + + $target = $targetXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $target | Should -Not -BeNullOrEmpty + + Merge-DbvPreference -Category 'Drivers' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $updated = $script:updatedXml.DbVisualizer.Drivers.Driver | Where-Object { $_.Name -eq $driverName } + $target.Name | Should -Be $updated.Name + } + } + + Context 'Databases' { + Mock -CommandName Save-DbvXml -MockWith { + $script:updatedXml = $Xml + } + + $masterPath = '.\Tests\MockMaster.xml' + $targetPath = '.\Tests\MockTarget.xml' + + $masterXml = [xml](Get-Content -Path $masterPath -Raw) + $targetXml = [xml](Get-Content -Path $targetPath -Raw) + + It 'Adds' { + $databaseAlias = 'FakeDatabaseToAdd' + + $master = $masterXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $master | Should -Not -BeNullOrEmpty + + $target = $targetXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $target | Should -BeNullOrEmpty + + Merge-DbvPreference -Category 'Databases' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $updated = $script:updatedXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $master.Alias | Should -Be $updated.Alias + } + + It 'Updates' { + $databaseAlias = 'FakeDatabaseToUpdate' + + $master = $masterXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $masterServer = $master.UrlVariables.Driver.UrlVariable | Where-Object { $_.UrlVariableName -eq 'Server' } + + $target = $targetXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $targetServer = $target.UrlVariables.Driver.UrlVariable | Where-Object { $_.UrlVariableName -eq 'Server' } + + $masterServer.'#text' | Should -Not -Be $targetServer.'#text' + + Merge-DbvPreference -Category 'Databases' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $after = $script:updatedXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $afterServer = $after.UrlVariables.Driver.UrlVariable | Where-Object { $_.UrlVariableName -eq 'Server' } + + $afterServer.'#text' | Should -Be $masterServer.'#text' + } + + It "Doesn't remove" { + $databaseAlias = 'FakeDatabaseToNotRemove' + + $master = $masterXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $master | Should -BeNullOrEmpty + + $target = $targetXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $target | Should -Not -BeNullOrEmpty + + Merge-DbvPreference -Category 'Databases' -MasterPath $masterPath -TargetPath $targetPath + Assert-MockCalled -CommandName 'Save-DbvXml' -Times 1 + + $updated = $script:updatedXml.DbVisualizer.Databases.Database | Where-Object { $_.Alias -eq $databaseAlias } + $target.Alias | Should -Be $updated.Alias + } + } + } +} \ No newline at end of file diff --git a/Tests/MockAddDriverMaster.xml b/Tests/MockAddDriverMaster.xml new file mode 100644 index 0000000..6b046bf --- /dev/null +++ b/Tests/MockAddDriverMaster.xml @@ -0,0 +1,361 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + diff --git a/Tests/MockAddDriverTarget.xml b/Tests/MockAddDriverTarget.xml new file mode 100644 index 0000000..28c8772 --- /dev/null +++ b/Tests/MockAddDriverTarget.xml @@ -0,0 +1,344 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + diff --git a/Tests/MockMaster.xml b/Tests/MockMaster.xml new file mode 100644 index 0000000..52310df --- /dev/null +++ b/Tests/MockMaster.xml @@ -0,0 +1,419 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + + + FakeDatabaseToAdd + + + SQL Server (Microsoft) + + auto + sqlserver + + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + FakeServer + 1433 + FakeDatabase + + + + + false + + 22 + + + + + + + + FakeDatabaseToUpdate + + + SQL Server (Microsoft) + + auto + sqlserver + + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + FakeServer2 + 1433 + FakeDatabase + + + + + false + + 22 + + + + + + + + + + + + + + diff --git a/Tests/MockRemoveDriverMaster.xml b/Tests/MockRemoveDriverMaster.xml new file mode 100644 index 0000000..7ed1a57 --- /dev/null +++ b/Tests/MockRemoveDriverMaster.xml @@ -0,0 +1,345 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + diff --git a/Tests/MockRemoveDriverTarget.xml b/Tests/MockRemoveDriverTarget.xml new file mode 100644 index 0000000..6b046bf --- /dev/null +++ b/Tests/MockRemoveDriverTarget.xml @@ -0,0 +1,361 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + diff --git a/Tests/MockTarget.xml b/Tests/MockTarget.xml new file mode 100644 index 0000000..e8e3427 --- /dev/null +++ b/Tests/MockTarget.xml @@ -0,0 +1,422 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + + + FakeDatabaseToUpdate + + + SQL Server (Microsoft) + + auto + sqlserver + + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + FakeServer + 1433 + FakeDatabase + + + + + false + + 22 + + + + + + + + FakeDatabaseToNotRemove + + + SQL Server (Microsoft) + + auto + sqlserver + + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + FakeServer + 1433 + FakeDatabase + + + + + false + + 22 + + + + + + + + + + + + + + diff --git a/Tests/MockUpdateDriverMaster.xml b/Tests/MockUpdateDriverMaster.xml new file mode 100644 index 0000000..6b046bf --- /dev/null +++ b/Tests/MockUpdateDriverMaster.xml @@ -0,0 +1,361 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + diff --git a/Tests/MockUpdateDriverTarget.xml b/Tests/MockUpdateDriverTarget.xml new file mode 100644 index 0000000..a7fb5d9 --- /dev/null +++ b/Tests/MockUpdateDriverTarget.xml @@ -0,0 +1,361 @@ + + + + 2 + 100 + false + false + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 z/OS + true + db2-zos + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + diff --git a/Tests/Updated.xml b/Tests/Updated.xml new file mode 100644 index 0000000..9131b3c --- /dev/null +++ b/Tests/Updated.xml @@ -0,0 +1,494 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 + true + db2 + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + DB2 z/OS + true + db2-zos-testinggggg + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + + + Production Account Inventory + + + SQL Server (Microsoft) + + auto + sqlserver + rSk+E2+Snss= + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + SVPSQLAIAPOLICYPROCESSING1433IAPolicyProcessing + + + false + + 22 + + + + + + + + Test Netezza + + jdbc:netezza://svqnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Test + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza5480SYSTEM + + + false + + 22 + + + + + + + + Production Netezza + + jdbc:netezza://svpnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Red.png + Production + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza5480SYSTEM + + + false + + 22 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/dbvis.master.xml b/Tests/dbvis.master.xml new file mode 100644 index 0000000..f2810bf --- /dev/null +++ b/Tests/dbvis.master.xml @@ -0,0 +1,504 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 + true + db2 + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + DB2 z/OS + true + db2-zos-testinggggg + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + + + Production Account Inventory + + + SQL Server (Microsoft) + + auto + sqlserver + rSk+E2+Snss= + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + SVPSQLAIAPOLICYPROCESSING + 1433 + IAPolicyProcessing + + + + + false + + 22 + + + + + + + + Test Netezza + + jdbc:netezza://svqnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Test + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza + 5480 + SYSTEM + + + + false + + 22 + + + + + + + + Production Netezza + + jdbc:netezza://svpnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Red.png + Production + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza + 5480 + SYSTEM + + + + false + + 22 + + + + + + + + + + + + + + + + + + + diff --git a/Tests/dbvis.xml b/Tests/dbvis.xml new file mode 100644 index 0000000..9131b3c --- /dev/null +++ b/Tests/dbvis.xml @@ -0,0 +1,494 @@ + + + + 2 + 100 + false + true + false + 300 + Default + false + true + true + + false + true + window + + + false + weekly + 1528991410061 + \t + -1 + 1000 + + true + + true + -1 + 15 + 1000 + -1 + false + false + OpenInTab + OpenInNewTab + + false + ExistingFreeNew + OpenInTab + true + yyyy-MM-dd + 221|186|1368|745 + Unformatted + 683|138|800|625|265 + .*/mysql.*bin-g\.jar;ribo.jar;jtds3d.jar;jtds3.jar;jconn3d.jar;uninstaller.jar + false + true + true + false + C:\JDBC;${dbvis.prefsdir}/jdbc;${dbvis.home}\jdbc + (null) + Cp1252 + 60 + graph + + result-set-explainviewer-show-operation-data-command + true + OpenInTab + OpenInNewTab + true + + 555|245|699|436 + true|true|false|false|true|200 + true + true + false + true + true + true + true + true + true + Hierarchic + + Columns + true + false + true + false + false + true + true + -1 + #e7ab75 + + #000000 + Value + Value + #f07074 + #ff0000 + #ffffff + #ffffb4 + #ffff00 + #000000 + #ffffff + + #000000 + Tahoma-plain-11 + false + column + #d9d9d9 + #e8e8e8 + + #808080 + #f0f5fa + + #000000 + #ffffdc + + #000000 + false + true + true + + small + small + small + 150 + No Confirm|No Confirm|No Confirm + Confirm|Confirm|Confirm + No Confirm|Confirm|Confirm + $default$ + true + 400 + false + HH:mm:ss + com.sun.java.swing.plaf.windows.WindowsLookAndFeel + false + + 295 + 442 + true + TruncateValuesVisually + true + true + false + + 300 + Sequential + false + + + \n + Unformatted + Space + true + false + + false + ${connectionname} ${objectname} + true + false + Ask + + true + false + false + false + false + false + false + false + false + true + false + true + true + false + false + true + true + true + false + false + 4 spaces + Keywords Uppercase + 100 + true + true + ' + Any SQL + Keep Unchanged + Keep Unchanged + Keep Unchanged + false + " + SQL + ${dbvis.prefsdir}/ext/profiles;${dbvis.home}/resources/profiles + 284|44|896|630|0 + + rSk+E2+Snss= + + http + useNoProxy + + Solid + 200|150 + 200 + 20 + false + false + + false + true + /* + */ + --/ + / + false + true + false + Grid + LaunchScriptor + Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow|Allow + Allow|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask|Ask + Allow|Allow|Allow|Allow|Ask|Allow|Allow|Ask|Allow|Ask + ShowLogTabIfNoResultSets + ${index}: ${table} [${rows}] + false + false + false + true + true + true + false + false + false + false + ; + ; + true + #ffffff + true + #000000 + true + + + + Consolas-plain-12 + false + #ffffd7 + Alt + default + false + true + 8 + ${index}: ${filename|nofile=Untitled} + true + true + false + + 300 + -- + // + Clear at Disconnect + 60 + + true + false + false + LAST + false + true + false + --/ + / + ; + true + true + Size + Size + false + true + true + true + true + true + false + (null) + true + true + false + default + true + HH:mm:ss + yyyy-MM-dd HH:mm:ss + false + + + + true + || + + ${ + }$ + 10.0.13 + Last + false + true + 0 + 0 + + + + + DB2 + true + db2 + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + DB2 z/OS + true + db2-zos-testinggggg + jdbc:db2://<server>:<port50000>/<database> + com.ibm.db2.jcc.DB2Driver + IBM Data Server Driver for JDBC and SQLJ + 4.24.92 + + + C:\JDBC\db2jcc4.jar + + com.ibm.db2.jcc.DB2Driver + com.ibm.db2.jcc.t2zos.T2zosConfiguration + com.ibm.db2.jcc.uw.DB2StoredProcDriver + COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver + + + + + + Netezza + true + netezza + jdbc:netezza://<server>:<port5480>/<database> + org.netezza.Driver + Netezza JDBC Driver + Release 7.2.1.6-P-1 driver [build 180606-48] + + + C:\JDBC\nzjdbc.jar + + org.netezza.Driver + + + + + + SQL Server (Microsoft) + false + jdbc:sqlserver://<server>:<port1433>;databaseName=<database>;integratedSecurity=true; + com.microsoft.sqlserver.jdbc.SQLServerDriver + Microsoft JDBC Driver 6.4 for SQL Server + 6.4.0.0 + + + C:\JDBC\mssql-jdbc-6.4.0.jre8.jar + + com.microsoft.sqlserver.jdbc.SQLServerDriver + + + + + + + + Production Account Inventory + + + SQL Server (Microsoft) + + auto + sqlserver + rSk+E2+Snss= + 1 + + true + Red.png + Production + + 0 + + + SQL Server (Microsoft) + SVPSQLAIAPOLICYPROCESSING1433IAPolicyProcessing + + + false + + 22 + + + + + + + + Test Netezza + + jdbc:netezza://svqnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Test + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza5480SYSTEM + + + false + + 22 + + + + + + + + Production Netezza + + jdbc:netezza://svpnetezza:5480/SYSTEM;securityLevel=onlySecured; + Netezza + taxw0ad + auto + netezza + 6ZgtpDatLNmeHavEWeaLdA== + 0 + + onlySecured + Red.png + Production + true + SYSTEM + ADMIN + 0 + + 0 + + + Netezza + svqnetezza5480SYSTEM + + + false + + 22 + + + + + + + + + + + + + + + + + + + \ No newline at end of file