Skip to content

Instantly share code, notes, and snippets.

View Christopher-Barham-AKQA's full-sized avatar

Christopher B Christopher-Barham-AKQA

  • AKQA
  • München
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / SomePojoValidatorTest.java
Created September 7, 2012 12:16
SomePojoValidatorTest.java unit test for Hibernate Validator
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import java.util.Locale;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / assertConcurrent.md
Created August 28, 2012 09:45
assertConcurrent - junit assert method
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / AppTest.java
Created August 28, 2012 09:36
Example jUnit test that demos/uses most of the hamcrest matchers
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.any;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.anything;
import static org.hamcrest.Matchers.describedAs;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.equalToIgnoringWhiteSpace;
import static org.hamcrest.Matchers.instanceOf;
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / gist:3487015
Created August 27, 2012 09:47
Eclipse Template Unit Test Import
Eclipse Template Unit Test Import
In Eclipse go Preferences>Java>Edito>Templates>New
• Name: jimp
• context: Java
• Description: Unit test imports
• Pattern:
import static java.lang.String.format;
import static org.mockito.BDDMockito.*;
import static org.junit.Assume.*;
#Organize Import Order
#Wed Mar 28 14:36:55 CEST 2012
4=com
3=org
2=javax
1=java
0=\#
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Audi" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / pom.xml
Created August 24, 2012 12:52 — forked from tomsoete/pom.xml
Spring Best Practices Maven Pom
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.audi.sample</groupId>
<artifactId>sample</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
@Christopher-Barham-AKQA
Christopher-Barham-AKQA / EqualsHashCodeTestCase.java
Created August 21, 2012 15:47
EqualsHashCodeTestCase.java
package com.pobox.cbarham.testhelpers;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import junit.framework.AssertionFailedError;
package com.pobox.cbarham.testhelpers;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;