Skip to content

Instantly share code, notes, and snippets.

View tonit's full-sized avatar

Toni Menzel tonit

View GitHub Profile
@tonit
tonit / gist:995593
Created May 27, 2011 16:14
ops4j infra 2011
New OPS4J Channels in May 2011
Information:
http://ops4j1.jira.com/wiki/ --> Wiki
ops4j@googlegroups.com --> New Mailinglist
ops4j-notify@googlegroups.com --> Notification List
http://twitter.com/ops4j --> Twitter Channel
#OPS4J on freenode: IRC
Development:
@tonit
tonit / gist:987443
Created May 23, 2011 19:52
bndtools problem
zazu:bndtools tonit$ ant build p2
Buildfile: /Users/tonit/devel/oss/bndtools/build.xml
build:
init:
[bndprepare] java.lang.AbstractMethodError
[bndprepare] at aQute.bnd.build.Project.getBundle(Project.java:769)
[bndprepare] at aQute.bnd.build.Project.getBundles(Project.java:424)
[bndprepare] at aQute.bnd.build.Project.parseBuildpath(Project.java:343)
@tonit
tonit / Pax_Exam_Swoosh_Player.java
Created April 1, 2011 09:34
Fully functional alternative Pax Exam Driver. Lets your write fully functional setup-tests "in a tweet".
/*
* Copyright 2011 Toni Menzel.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tonit
tonit / Exam2_API3.java
Created March 28, 2011 12:22
See: you don't write starting or stopping a particular container. Its delegated to the ReactorStrategy
public void reactorRun( StagedExamReactorFactory strategy ) throws Exception
{
TestContainerFactory factory = getFactory();
Option[] options = new Option[]{ junitBundles(), easyMockBundles() };
ExxamReactor reactor = new DefaultExamReactor( factory );
TestProbeProvider probe = makeProbe();
reactor.addProbe( probe );
@tonit
tonit / Exam2_API2.java
Created March 28, 2011 12:19
How to make a test probe. Entry API (PlumbingContext) will change prior 2.0 final.
private TestProbeProvider makeProbe() throws IOException
{
TestProbeBuilder probe = new PlumbingContext().createProbe();
probe.addTests(
SingleTestProbe.class,
getAllMethods( SingleTestProbe.class )
);
return probe.build();
}
@tonit
tonit / Exam2_API1.java
Created March 28, 2011 11:57
Low level api example. How to use a Test Container.
for( TestContainer testContainer : getTestContainerFactory().parse( options ) ) {
try {
testContainer.start();
testContainer.install( p.getStream() );
for( TestAddress test : p.getTests() ) {
testContainer.call( test );
}
} finally {
testContainer.stop();
}
@tonit
tonit / FixCLRFonMac
Created March 22, 2011 08:47
Fixing Mac specific line endings to Unix defaults
find . -type f -name "*.java" -exec perl -pi -e 's/\r/\n/g' \{\} \;
@tonit
tonit / gist:840396
Created February 23, 2011 13:02
hudson-trunk-guice-problem
tarted by user anonymous
Checkout:workspace / /Users/tonit/devel/oss/pax-exam-hudson/work/jobs/Pax Repository/workspace - hudson.remoting.LocalChannel@512f0cf1
Using strategy: Default
Last Built Revision: Revision 79afe211de70aa194dd084938bb5e7636bbafda3 (origin/master)
Checkout:workspace / /Users/tonit/devel/oss/pax-exam-hudson/work/jobs/Pax Repository/workspace - hudson.remoting.LocalChannel@512f0cf1
GitAPI created
Fetching changes from the remote Git repository
Fetching upstream changes from file:///Users/tonit/devel/oss/pax-repository/.git
[workspace] $ git fetch -t file:///Users/tonit/devel/oss/pax-repository/.git +refs/heads/*:refs/remotes/origin/*
[workspace] $ git ls-tree HEAD
@tonit
tonit / svnauthormapping.sh
Created January 7, 2011 12:55
Run this inside svn checkout to create a authors template for git svn clone
#!/usr/bin/env bash
# From http://technicalpickles.com/posts/creating-a-svn-authorsfile-when-migrating-from-subversion-to-git/
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
done
echo "# Now run git svn --authors-file=path/to/authors_file clone SVN_REPO_URL LOCAL_DIR"
First make sure you prepare your environment http://wiki.ops4j.org/display/ops4j/Releasing.
Use Maven 3.
mvn -Prelease,repos.sonatype.staging -Darguments="-Prelease,repos.sonatype.staging" release:prepare
mvn -Prelease,repos.sonatype.staging -Darguments="-Prelease,repos.sonatype.staging" release:perform -Dgoals=deploy -DconnectionUrl=scm:git:file:///Users/tonit/devel/oss/org.ops4j.pax.exam1/
Hint:
1. the -DconnectionUrl is a workaround for bug http://jira.codehaus.org/browse/MRELEASE-605