Skip to content

Instantly share code, notes, and snippets.

View steinim's full-sized avatar

Stein Inge Morisbak steinim

View GitHub Profile
@steinim
steinim / pom.xml
Created September 5, 2011 13:27
Inkludering av bakdør ved bruk av profilen 'dev' - jetty-maven-plugin
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
...
@steinim
steinim / pom.xml
Created September 5, 2011 12:51
Inkludering av bakdør ved bruk av profilen 'dev'
...
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<packagingExcludes>${war.packaging.excludes}</packagingExcludes>
@steinim
steinim / web.xml
Created September 5, 2011 13:11
Inkludering av bakdør ved bruk av profilen 'dev' - web.xml
...
<!-- Filters -->
<filter>
<filter-name>...</filter-name>
<filter-class>...</filter-class>
</filter>
...
${backdoor.filter}
...
<!-- Filter mappings -->
@steinim
steinim / pom.xml
Created September 11, 2011 08:47
Slow task profile with activation property
<profile>
<id>slowTask</id>
<activation>
<property>
<name>!skipSlowTask</name>
</property>
</activation>
<build>
<plugins>
<plugin>
@steinim
steinim / MyIntegrationTest.java
Created September 11, 2011 08:49
Integration test with Spring
@IfProfileValue(name = "integration", value = "true")
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/applicationContext-itest.xml" })
public class MyIntegrationTest {
...
@Test
public void is_this_integration_test_working() {
...
}
...
@steinim
steinim / pom.xml
Created September 11, 2011 08:50
Integration property set to true in parent pom
<properties>
<integration>true</integration>
...
</properties>
@steinim
steinim / pom.xml
Created September 11, 2011 08:51
Surefire plugin configured for running integration tests
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
<argLine>${commandLineArgs}</argLine>
</configuration>
<executions>
<execution>
<id>unit-test</id>
@steinim
steinim / MySlowIntegrationTest.java
Created September 11, 2011 08:52
Slow test with Spring
@IfProfileValue(name = "slowtests", value = "true")
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/applicationContext-itest.xml" })
public class MySlowIntegrationTest {
...
@Test
public void is_this_slowtest_working() {
...
}
...
@steinim
steinim / pom.xml
Created September 11, 2011 08:57
Skipping entire sub-module
...
<profiles>
...
<profile>
<id>test-data-creator</id>
<activation>
<property>
<name>!skip.test-data</name>
</property>
</activation>
@steinim
steinim / git-gc.sh
Created April 18, 2012 13:07
Git garbage collection script
#!/bin/bash
repo_dirs=$( ls -d1 $@ )
for repo_dir in ${repo_dirs[@]}
do
cd $repo_dir
echo "checking if $repo_dir is a git repo"
if [[ -d .git ]]
then
echo "Garbage collecting $repo_dir"
git gc