Skip to content

Instantly share code, notes, and snippets.

@trevershick
trevershick / h2_spring-test-database-config.xml
Created July 2, 2011 20:56
A simple gist that shows how to switch test resource folders based on a profile which allows switching between h2 and oracle for unit and functional tests.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
@trevershick
trevershick / StatementExecutingDataSource.java
Created July 2, 2011 20:35
DataSource wrapper that executes statements on getConnection to fix an issue with Activiti not supporting fully qualified table names.
package com.railinc.spring.jdbc;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
@trevershick
trevershick / RailincDeploymentManager.java
Created July 2, 2011 20:06
Fixes a deployment but in Activiti 3.3-3.6 whereby the deployer looks at the 'oldest' instead of the 'latest' deployment and compares the bar 'to be deployed'.
package com.railinc.activiti.sso;
import java.util.List;
import org.activiti.engine.impl.persistence.entity.DeploymentEntity;
import org.activiti.engine.repository.Deployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RailincDeploymentManager extends