This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/profile.d/maven-settings.sh Maven related stuff | |
export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1 | |
export M2=$M2_HOME/bin | |
export PATH=$M2:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/profile.d/java-settings.sh | |
OLD | |
# export JAVA_HOME=/usr/java/jdk1.7.0_51 | |
# export PATH=$JAVA_HOME/bin:$PATH | |
export JAVA_HOME=/usr/java/jdk1.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Java ### | |
*.class | |
# Package Files # | |
*.jar | |
*.war | |
*.ear | |
### IntelliJ ### | |
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/profile.d/pgsql-data-settings.sh | |
export PGDATA=/usr/local/pgsql/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code | |
public static <T, V> Collection<V> safeGetCollectionFromMap(Map<T, ? extends Collection<V>> map, T key) { | |
if (map.get(key) != null) { | |
return map.get(key); | |
} else { | |
return Lists.newLinkedList(); | |
} | |
} | |
// The tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId> put the group id </groupId> | |
<artifactId> put the artifact id </artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name> the name </name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/hbase/hbase-0.94.18/bin/start.sh | |
/opt/hbase/hbase-0.94.18/bin/stop.sh | |
/opt/hbase/hbase-0.94.18/bin/rolling-restart.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DbCleanupRule implements TestRule { | |
private final DbConnectionManager connection; | |
public DbCleanupRule(DbConnectionManager connection) { | |
this.connection = connection; | |
} | |
@Override | |
public Statement apply(Statement base, Description description) { | |
return new DbCleanupStatement(base, connection); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DbConnectionRule extends ExternalResource { | |
private DbConnectionManager connection; | |
public DbConnectionRule() { | |
} | |
@Override | |
protected void before() throws Throwable { | |
ClassPathXmlApplicationContext ctx = null; | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ContextConfiguration(locations = { "/META-INF/one-dao-TEST-ctx.xml", "/META-INF/two-TEST-ctx.xml" }) | |
public class ExampleDaoTest extends AbstractJUnit4SpringContextTests { | |
@ClassRule | |
public static DbCleanupRule connectionRule = new DbCleanupRule (); | |
@Rule | |
public DbCleanupRule dbCleanupRule = new DbCleanupRule(connectionRule.getDbConnecttion()); | |
@Autowired |