Skip to content

Instantly share code, notes, and snippets.

@rherrmann
rherrmann / EqualsTester.java
Last active August 29, 2022 07:10
Utility class to help unit testing equals() and hashCode(), see also http://www.codeaffine.com/2012/06/25/how-do-you-test-equals-and-hashcode/
/*******************************************************************************
* Copyright (c) 2012 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Frank Appel - code review, idea for assertEquals( T, Object, Object )
/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Matt Morrissette - allow to use non-static inner IgnoreConditions
@rherrmann
rherrmann / mvn-auto-value.txt
Created March 12, 2014 21:12
Output of 'mvn clean verify' for AutoValue
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AutoValue 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ auto-value ---
[INFO] Deleting C:\Users\Ruediger\git\auto\value\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ auto-value ---
/*******************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
******************************************************************************/
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.ui.util;
@rherrmann
rherrmann / PeriodicUIUpdater.java
Created October 5, 2014 13:52
Helper class to periodically run code that updates SWT widgets
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.util;
@rherrmann
rherrmann / GitInternalsLearningTest.java
Last active October 11, 2020 07:11
'Learning Tests' that use the JGit API to explore the internals of Git commits: http://www.codeaffine.com/2014/10/20/git-internals/
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit;
@rherrmann
rherrmann / InitLearningTest.java
Last active August 29, 2015 14:20
'Learning Tests' that use the JGit API to create new Git repositories: http://www.codeaffine.com/2015/05/06/jgit-initialize-repository/
/***************************************************************************************************
* Copyright (c) 2015 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available
* at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit.example;
@rherrmann
rherrmann / CloneLearningTest.java
Last active July 21, 2023 19:15
'Learning Tests' that uses the JGit API to clone existing repositories: http://www.codeaffine.com/2015/11/30/jgit-clone-repository/
package com.codeaffine.jgit.example;
import static java.util.Collections.singleton;
import static org.eclipse.jgit.api.ListBranchCommand.ListMode.ALL;
import static org.eclipse.jgit.transport.RemoteConfig.getAllRemoteConfigs;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.util.List;
@rherrmann
rherrmann / JGitCommandsLearningTest.java
Last active February 21, 2023 03:40
Accompanying source code for Getting Started with JGit: http://www.codeaffine.com/2015/12/15/getting-started-with-jgit/
/***************************************************************************************************
* Copyright (c) 2015 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit.example;