Skip to content

Instantly share code, notes, and snippets.

@ttddyy
ttddyy / build.gradle
Created March 3, 2012 22:24
run multiple jetty before tests in gradle
// start multiple jetties before test
//
// useful for parallel web end-to-end testing
//
import org.gradle.api.plugins.jetty.JettyRun
apply plugin: 'java'
apply plugin: 'jetty'
repositories {
@ttddyy
ttddyy / build.gradle
Created March 25, 2012 15:45
run jetty on dependency resolved war file in gradle
// Run Jetty on dependency resolved war file
//
// you can run multiple wars with different configuration by
// adding more task definitions.
//
import org.gradle.api.plugins.jetty.JettyRunWar
apply plugin: 'java'
apply plugin: 'jetty'
@ttddyy
ttddyy / HandlerInterceptorsFactory
Created May 3, 2012 01:10
spring3.1: factory bean that allows to map url-path -> handler-interceptors
/**
* Factory bean to generate list of HandlerMappings and MappedHandlers.
*
* MappedHandlers can be specified by url path to interceptors.
*
*/
public class HandlerInterceptorsFactory extends AbstractFactoryBean<List<Object>> {
private List<HandlerInterceptor> handlerInterceptors = new ArrayList<HandlerInterceptor>();
@ttddyy
ttddyy / TestNGUtils.java
Created June 14, 2012 04:40
util method for programmatically run and verify TestNG test classes
public class TestNGUtils {
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
public static void runAndVerify(Class<?>... testClasses) {
if (ObjectUtils.isEmpty(testClasses)) {
throw new AssertionError("no test class specified.");
}
@ttddyy
ttddyy / ec2-printconfig.py
Created December 12, 2012 01:40
a python script to display ec2 name and ip address as ssh-config or hosts file.
#! /usr/bin/env python
import argparse
import os
import sys
import boto.ec2
def parse_args():
<dependency>
<groupId>net.ttddyy</groupId>
<artifactId>datasource-proxy</artifactId>
<version>1.2</version>
</dependency>
@ttddyy
ttddyy / pom.xml
Created April 21, 2015 00:52
maven dependency for datasource-proxy-1.3
<dependency>
<groupId>net.ttddyy</groupId>
<artifactId>datasource-proxy</artifactId>
<version>1.3</version>
</dependency>
@ttddyy
ttddyy / SpringExtensionTestsLauncher.java
Created November 22, 2015 16:44
launcher to run junit5 tests
package org.springframework.test.context.junit5;
import org.junit.gen5.console.ColoredPrintingTestListener;
import org.junit.gen5.engine.TestPlanSpecification;
import org.junit.gen5.launcher.Launcher;
import org.junit.gen5.launcher.listeners.SummaryCreatingTestListener;
import org.junit.gen5.launcher.listeners.TestExecutionSummary;
import java.io.PrintWriter;
package net.ttddyy.dsproxy.example;
import net.ttddyy.dsproxy.ExecutionInfo;
import net.ttddyy.dsproxy.QueryInfo;
import net.ttddyy.dsproxy.listener.QueryExecutionListener;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
@ttddyy
ttddyy / xenon-release-prepare.sh
Created March 22, 2016 21:45
Prepare release for xenon
#! /bin/sh -xe
# Prepare release for xenon
# - create a branch "prepare-release-${RELEASE_VERSION}"
# - update CHANGELOG.md versions
# - update pom versions
# - create local commits for release and next dev versions
#
# TODO: change to receive args and validate
#