Skip to content

Instantly share code, notes, and snippets.

@matthias-dirickx
matthias-dirickx / postgresql-schema-compare.sh
Created December 7, 2021 10:23
Compare schema's of two databases. Variables need to be added to the script by passing them as variables or loading them in another way. Description in gist comments.
#!/usr/bin/bash
#Rrequired_parameters to be supplied
# - target_db
# - target_db_new
# - target_port
# - pg_user
# Produced output
# - List of all tables that were added (in new db, but not in old)
# - List of all tables that were removed ( in old db, but not in new)
@matthias-dirickx
matthias-dirickx / XmlSupport.java
Created May 6, 2020 15:33
Limited xml support with SAXON at the foundation to get xpath and xquery results for verification purposes in a test context.
/**
MIT License
Copyright (c) 2020 Matthias Dirickx
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@matthias-dirickx
matthias-dirickx / TestContext.java
Created April 10, 2020 15:45
Guard test context over classes. Designed to be thread-safe, but not guarnateed to be threadsafe. In response to the need to having a flexible test context without adding DI (which might often be the better option if I have to believe the google search results to this issue).
package be.mdi.test.utils;
import java.util.HashMap;
public class TestContext {
/*
* TestContext Class Methods
@matthias-dirickx
matthias-dirickx / PropertyManager.java
Created October 27, 2019 21:41
Lightweight property manager for java that can handle ${place.holders} and resolves as a singleton returning a HashMap<String, String>
/*
* PropertyManager
*
* Copyright (C) 2019 matthias.dirickx@outlook.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@matthias-dirickx
matthias-dirickx / LocalStorageManager.cs
Last active November 20, 2023 03:14
Local storage manager after the example as found in https://gist.github.com/roydekleijn/5073579
using OpenQA.Selenium;
//Did not yet test this code
//I'll update if needed (and if I think of it), but this is the gist of it (pun intended)
namespace LocalStorageManager
{
class LocalStorageManager
{
private IJavaScriptExecutor js;
/**
@Author : Matthias Dirickx
@Description : Collecting statuses and copying them to a file - based on the 'set endpoint' script from Pradeep Bishnoi
https://learnsoapui.wordpress.com/2012/04/27/want-to-change-endpoInteger-url-in-a-projecttestsuitestestcases/
* This script retrieves the static statuses from all items in a project and then exports those results to a simple html file.
* There is no extra css file or other stuff included. So you can happily pass around the html without worrying about making available additional resources.
*Assumptions:
* - there is a variable testDataPath
* - The variable testDataPath is set as JAVA String (backslashes are doubled because of escape function)
@matthias-dirickx
matthias-dirickx / ElementTextMatcher.java
Last active February 4, 2019 11:12
Matching text of Selneium WebElements - Redundant with constructor because sometimes I wanted to check a list of x elements against the same value.
/*
Test utilities
Copyright (C) 2019
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,