This repository has been archived by the owner on Apr 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leo Simons
committed
Nov 14, 2009
0 parents
commit 0641829
Showing
18 changed files
with
601 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Leo Simons <mail at leosimons dot com> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2009 The JHTTP Authors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
License for jHttp (the MIT license): | ||
----------------------------------------------------------------------------- | ||
Copyright (c) 2009 The jHttp Authors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
|
||
Licenses for dependencies: | ||
----------------------------------------------------------------------------- | ||
* lib/testng-5.10-jdk15.jar is licensed under lib/testng-5.10-jdk15.LICENSE.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
jHttp is a java http client library. | ||
|
||
Get: | ||
git clone git://github.com/lsimons/jhttp.git | ||
|
||
Build: | ||
./build.sh | ||
./build.sh integration-test | ||
./build.sh help | ||
|
||
Use: | ||
API entrypoint is net.jhttp.Http: | ||
|
||
import net.jhttp.Http; | ||
|
||
public class Sample { | ||
public static void main(String[] args) { | ||
String body = | ||
|
||
Http.client().GET("http://www.example.org/").responseBody(); | ||
|
||
|
||
System.out.println(body); | ||
} | ||
} | ||
|
||
See the javadocs in doc/api for details. | ||
|
||
At a glance: | ||
* MIT license (in LICENSE.txt). | ||
* requires java 1.5 or later. | ||
* no runtime dependencies. | ||
* 100% test coverage. | ||
* extensive integration tests. | ||
* complete and accurate javadocs. | ||
* detailed release notes (in RELEASE_NOTES.txt). | ||
|
||
Contribute: | ||
* Clone the master repo. | ||
|
||
git clone git://github.com/lsimons/jhttp.git | ||
|
||
* Make changes. | ||
* Add yourself to AUTHORS. | ||
* Push your changes back to your own github account. | ||
* Send a pull request to lsimons. | ||
* Read http://help.github.com/forking/ for more help. | ||
|
||
Support: | ||
Sorry, none available. Read the docs, read the source code or try google. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
JHTTP RELEASE NOTES | ||
=================== | ||
|
||
Version 0.1.0 - Released November 14, 2009 | ||
------------------------------------------ | ||
* this version contains no functionality | ||
* build and packaging setup |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
if [[ "$1" == "-v" ]]; then | ||
set -x | ||
shift | ||
fi | ||
|
||
# settings | ||
basedir=`dirname $0` | ||
basedir=$(cd "$basedir" && pwd) | ||
currdir=`pwd` | ||
|
||
project="jhttp" | ||
srcdir="$basedir/src" | ||
testdir="$basedir/test" | ||
testrptdir="$currdir/test-output" | ||
libdir="$basedir/lib" | ||
classdir="$currdir/build/classes" | ||
testclassdir="$currdir/build/test-classes" | ||
distdir="$currdir/build" | ||
|
||
read version < "$basedir/VERSION" || : echo ignored | ||
cmd=${1:-build} | ||
|
||
# validate | ||
usage() { | ||
echo "./build.sh [-v] [help|clean|compile|test|integration-test|jar|dist|build]" | ||
} | ||
|
||
cmdok=0 | ||
for okcmd in help clean compile test integration-test jar dist build; do | ||
if [[ "$cmd" == "$okcmd" ]]; then | ||
cmdok=1 | ||
break | ||
fi | ||
done | ||
[[ $cmdok -ne 1 ]] && usage && exit 1 | ||
[[ "$cmd" == "help" ]] && usage && exit 0 | ||
if [[ "$cmd" == "clean" ]]; then | ||
rm -rf "$classdir" "$testclassdir" "$testrptdir" "$distdir" | ||
exit 0 | ||
fi | ||
|
||
echo "preparing..." | ||
CP="$CLASSPATH" | ||
for l in `find $libdir -type f -name '*.jar' | sort -r`; do | ||
CP="$l:$CP" | ||
done | ||
CP="$classdir:$CP" | ||
|
||
|
||
|
||
echo "compiling..." | ||
rm -rf "$classdir" | ||
mkdir -p "$classdir" | ||
cd "$srcdir" | ||
javac -nowarn -Xlint:-deprecation -source 1.5 -target 1.5 \ | ||
-d "$classdir" \ | ||
-cp "$CP" \ | ||
`find . -name '*.java'` || (echo "BUILD FAILED! (compile error)"; exit 1) | ||
|
||
# resources | ||
#for d in `find . -type d`; do | ||
# mkdir -p "$classdir/$dir" | ||
#done | ||
# | ||
#cp -r `find . -type f -not -name '*.java'` \ | ||
# "$classdir" | ||
|
||
[[ "$cmd" == "compile" ]] && echo "...done" && exit 0 | ||
|
||
|
||
|
||
echo "compiling tests..." | ||
rm -rf "$testclassdir" | ||
mkdir -p "$testclassdir" | ||
cd "$testdir" | ||
TCP="$testclassdir:$CP" | ||
|
||
javac -nowarn -Xlint:-deprecation -source 1.5 -target 1.5 \ | ||
-d "$testclassdir" \ | ||
-cp "$TCP" \ | ||
`find . -type f -name '*.java'` || (echo "BUILD FAILED! (test compile error)"; exit 1) | ||
|
||
|
||
|
||
echo "testing..." | ||
cd "$distdir" | ||
testngxml="$testdir/testng-checkin.xml" | ||
[[ "$cmd" == "test" ]] && testngxml="$testngxml $testdir/testng-func.xml" | ||
[[ "$cmd" == "integration-test" ]] && testngxml="$testdir/testng-integration.xml" | ||
|
||
rm -rf "$testrptdir" | ||
set +e | ||
java -ea -cp "$TCP" \ | ||
org.testng.TestNG \ | ||
-sourcedir "$testdir" \ | ||
$testngxml | ||
if [[ $? -ne 0 ]]; then | ||
echo " test report is ${currdir}/test-output/index.html" | ||
echo "BUILD FAILED! (test failure)" | ||
exit 1 | ||
fi | ||
set -e | ||
echo " test report is ${currdir}/test-output/index.html" | ||
echo "...tests ok" | ||
|
||
[[ "$cmd" == "test" \ | ||
|| "$cmd" == "integration-test" \ | ||
|| "$cmd" == "build" ]] && echo "...done" && exit 0 | ||
|
||
|
||
|
||
echo "jarring..." | ||
cd "$classdir" | ||
mkdir -p "META-INF" | ||
cp "$basedir/JAR_LICENSE.txt" "META-INF/LICENSE.txt" | ||
|
||
mkdir -p "$distdir" | ||
jar cf "$distdir/$project-$version.jar" * | ||
|
||
[[ "$cmd" == "jar" ]] && echo "...done" && exit 0 | ||
|
||
|
||
|
||
echo "packaging..." | ||
rm -rf "$distdir/$project-$version" | ||
mkdir -p "$distdir/$project-$version" | ||
cp "$distdir/$project-$version.jar" "$distdir/$project-$version" | ||
cd "$basedir" | ||
cp \ | ||
*.txt \ | ||
*.sh \ | ||
VERSION \ | ||
"$distdir/$project-$version" | ||
cp -r \ | ||
src \ | ||
lib \ | ||
test \ | ||
"$distdir/$project-$version" | ||
|
||
cd "$distdir/$project-$version/src" | ||
mkdir -p META-INF | ||
cp "$basedir/JAR_LICENSE.txt" "META-INF/LICENSE.txt" | ||
jar cf "../$project-$version-src.jar" * | ||
rm -rf META-INF | ||
|
||
cd "$distdir" | ||
#jar cf "$project-$version.zip" "$project-$version" | ||
tar czf "$project-$version.tar.gz" "$project-$version" | ||
echo " distribution is $distdir/$project-$version.tar.gz" | ||
|
||
echo "...done" |
Oops, something went wrong.