nullbuster-cvs Mailing List for NullBuster
Brought to you by:
osdchicago,
sl4mmy
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Kent R. S. <sl...@us...> - 2005-07-31 17:28:05
|
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>nullbuster</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1"><span id="added">build.xml</span></a></tt></td><td align="right" id="added">+78</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/build.xml?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
</table>
<pre class="comment">
Basic build file
</pre>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster">nullbuster</a></span><br />
<div class="fileheader" id="added"><big><b>build.xml</b></big> <small id="info">added at <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/build.xml?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N build.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ build.xml 31 Jul 2005 17:27:56 -0000 1.1
@@ -0,0 +1,78 @@
</small></pre><pre class="diff" id="added">+<?xml version="1.0"?>
+<project name="NullBuster" default="test">
+ <description>NullBuster</description>
+
+ <property name="bootclasspath" value="" />
+ <property name="javacFailOnError" value="false" />
+ <property name="javacDebugInfo" value="yes" />
+ <property name="javacVerbose" value="false" />
+ <property name="javacSource" value="1.4" />
+ <property name="javacTarget" value="1.4" />
+ <property name="compilerArg" value="" />
+
+ <target name="clean">
+ <delete dir="build" />
+ </target>
+
+ <target name="compile" depends="init">
+ <mkdir dir="${build.classes.dir}" />
+
+ <javac destdir="${build.classes.dir}" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}">
+ <src path="${src.dir}" />
+ <exclude name="**/*Test.java" />
+ </javac>
+ </target>
+
+ <target name="init">
+ <property name="build.dir" location="build" />
+ <property name="build.classes.dir" location="${build.dir}/classes" />
+ <property name="src.dir" location="src" />
+ <property name="test.src.dir" location="${src.dir}" />
+ <property name="test.dir" location="${build.dir}/test" />
+ <property name="test.classes.dir" location="${test.dir}/classes" />
+ <property name="test.data.dir" location="${test.dir}/data" />
+ <property name="test.reports.dir" location="${test.dir}/reports" />
+
+ <property name="dist.dir" location="dist" />
+ <property name="doc.dir" location="doc" />
+
+ <property name="junit.jar" location="${ant.home}/../org.junit_3.8.1/junit.jar" />
+
+ <path id="test.classpath">
+ <pathelement path="${junit.jar}" />
+ <pathelement path="${build.classes.dir}" />
+ <pathelement path="${test.classes.dir}" />
+ </path>
+ </target>
+
+ <target name="test" depends="compile">
+ <mkdir dir="${test.classes.dir}" />
+ <mkdir dir="${test.data.dir}" />
+ <mkdir dir="${test.reports.dir}" />
+
+ <javac destdir="${test.classes.dir}" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}">
+ <classpath refid="test.classpath" />
+ <src path="${test.src.dir}" />
+ <include name="**/*Test.java" />
+ </javac>
+
+ <copy todir="${build.classes.dir}" failonerror="true">
+ <fileset dir="${src.dir}" excludes="**/*.java" />
+ </copy>
+
+ <junit printsummary="yes" fork="yes" errorProperty="test.failed" failureProperty="test.failed">
+ <classpath refid="test.classpath" />
+ <formatter type="xml" />
+ <batchtest todir="${test.data.dir}">
+ <fileset dir="${test.classes.dir}" includes="**/*Test.class" />
+ </batchtest>
+ </junit>
+
+ <junitreport todir="${test.data.dir}">
+ <fileset dir="${test.data.dir}" includes="TEST-*.xml" />
+ <report format="frames" todir="${test.reports.dir}" />
+ </junitreport>
+
+ <fail if="test.failed" message="JUnit tests failed; see reports" />
+ </target>
+</project>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>
|
|
From: Kent R. S. <sl...@us...> - 2005-07-31 10:22:41
|
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>nullbuster/src/java/net/sourceforge/nullbuster</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1"><span id="added">NullBusterTest.java</span></a></tt></td><td align="right" id="added">+71</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBusterTest.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr class="alt"><td><tt><a href="#file2"><span id="added">NullBusterSample.java</span></a></tt></td><td align="right" id="added">+34</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBusterSample.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td><tt><a href="#file3"><span id="added">NullBuster.java</span></a></tt></td><td align="right" id="added">+79</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBuster.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td></td><td align="right" id="added">+184</td><td></td><td></td></tr>
</table>
<small id="info">3 added files</small><br />
<pre class="comment">
Initial commit
</pre>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster">nullbuster</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src">src</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java">java</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net">net</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge">sourceforge</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster">nullbuster</a></span><br />
<div class="fileheader" id="added"><big><b>NullBusterTest.java</b></big> <small id="info">added at <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBusterTest.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N NullBusterTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NullBusterTest.java 31 Jul 2005 10:22:32 -0000 1.1
@@ -0,0 +1,71 @@
</small></pre><pre class="diff" id="added">+package net.sourceforge.nullbuster;
+
+import junit.framework.TestCase;
+
+/**
+ * Ensures correctness of NullBuster.
+ *
+ * @author Kent R. Spillner <ksp...@ac...>
+ */
+public class NullBusterTest extends TestCase {
+ private static final String NO_SUCH_METHOD_FAILURE = "no such method";
+
+ private static final String SECURITY_FAILURE = "do not have access to method";
+
+ private NullBusterSample nullBusterSample;
+
+ private NullBuster nullBuster;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ nullBusterSample = new NullBusterSample();
+ nullBuster = new NullBuster(nullBusterSample);
+ }
+
+ public void testMethodsWithNoParameters() {
+ assertTrue(nullBuster("sampleWithNoParameters", null));
+ }
+
+ public void testMethodsWithOnlyNativeTypeParameters() {
+ assertTrue(nullBuster("sampleWithOnlyNativeTypeParameters",
+ new Class[] { Boolean.TYPE, Byte.TYPE, Character.TYPE,
+ Double.TYPE, Float.TYPE, Integer.TYPE, Long.TYPE,
+ Short.TYPE }));
+ }
+
+ public void testBrokenMethodsWithOneObjectTypeParameter() {
+ assertFalse(nullBuster("brokenSampleWithOneObjectTypeParameter",
+ new Class[] { Object.class }));
+ }
+
+ public void testWorkingMethodsWithOneObjectTypeParameter() {
+ assertTrue(nullBuster("workingSampleWithOneObjectTypeParameter",
+ new Class[] { Object.class }));
+ }
+
+ public void testBrokenMethodsWithNativeAndObjectParameters() {
+ assertFalse(nullBuster("brokenSampleWithNativeAndObjectTypeParameters",
+ new Class[] { Integer.TYPE, Object.class }));
+ }
+
+ public void testWorkingMethodsWithNativeAndObjectParameters() {
+ assertTrue(nullBuster("workingSampleWithNativeAndObjectTypeParameters",
+ new Class[] { Integer.TYPE, Object.class }));
+ }
+
+ private boolean nullBuster(String methodName, Class[] parameterTypes) {
+ try {
+ return nullBuster.bust(nullBusterSample.getClass().getMethod(
+ methodName, parameterTypes));
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ fail(SECURITY_FAILURE);
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ fail(NO_SUCH_METHOD_FAILURE);
+ }
+
+ return false;
+ }
+}
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname" id="added"><a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster">nullbuster</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src">src</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java">java</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net">net</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge">sourceforge</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster">nullbuster</a></span><br />
<div class="fileheader" id="added"><big><b>NullBusterSample.java</b></big> <small id="info">added at <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBusterSample.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N NullBusterSample.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NullBusterSample.java 31 Jul 2005 10:22:32 -0000 1.1
@@ -0,0 +1,34 @@
</small></pre><pre class="diff" id="added">+package net.sourceforge.nullbuster;
+
+/**
+ * For testing NullBuster.
+ *
+ * @author Kent R. Spillner <ksp...@ac...>
+ */
+public class NullBusterSample {
+ public void sampleWithNoParameters() {
+ System.out.println("sampleWithNoParameters() called");
+ }
+
+ public void sampleWithOnlyNativeTypeParameters(boolean bo, byte by,
+ char ch, double d, float f, int i, long l, short s) {
+ }
+
+ public void brokenSampleWithOneObjectTypeParameter(Object obj) {
+ }
+
+ public void workingSampleWithOneObjectTypeParameter(Object obj) {
+ if (obj == null)
+ throw new IllegalArgumentException(
+ "Parameter Object obj can not be null");
+ }
+
+ public void brokenSampleWithNativeAndObjectTypeParameters(int i, Object obj) {
+ }
+
+ public void workingSampleWithNativeAndObjectTypeParameters(int i, Object obj) {
+ if (obj == null)
+ throw new IllegalArgumentException(
+ "Parameter Object obj can not be null");
+ }
+}
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname" id="added"><a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster">nullbuster</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src">src</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java">java</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net">net</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge">sourceforge</a>/<a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster">nullbuster</a></span><br />
<div class="fileheader" id="added"><big><b>NullBuster.java</b></big> <small id="info">added at <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/src/java/net/sourceforge/nullbuster/NullBuster.java?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N NullBuster.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NullBuster.java 31 Jul 2005 10:22:32 -0000 1.1
@@ -0,0 +1,79 @@
</small></pre><pre class="diff" id="added">+package net.sourceforge.nullbuster;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Understands proper IllegalArgumentException compliance.
+ *
+ * @author Kent R. Spillner <ksp...@ac...>
+ */
+public class NullBuster {
+ private static final Map NATIVE_TYPES_DEFAULT_VALUES = new HashMap() {
+ {
+ put(Boolean.TYPE, new Boolean(false));
+ put(Byte.TYPE, new Byte((byte) 0));
+ put(Character.TYPE, new Character('\0'));
+ put(Double.TYPE, new Double(0.0));
+ put(Float.TYPE, new Float(0.0f));
+ put(Integer.TYPE, new Integer(0));
+ put(Long.TYPE, new Long(0l));
+ put(Short.TYPE, new Short((short) 0));
+ }
+ };
+
+ private Object obj;
+
+ public NullBuster(Object obj) {
+ this.obj = obj;
+ }
+
+ public boolean bust(Method method) {
+ try {
+ Object[] arguments = createArgumentsFromMethodParameters(method
+ .getParameterTypes());
+
+ boolean nullParameters = false;
+ nullParameters = Arrays.asList(arguments).contains(null);
+
+ // Only bother testing methods with Object parameters
+ if (nullParameters)
+ method.invoke(obj, arguments);
+ else
+ return true;
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // Methods ought to throw IAEs if they are passed any null arguments
+ if (e.getCause() instanceof IllegalArgumentException)
+ return true;
+
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
+ private Object[] createArgumentsFromMethodParameters(Class[] parameterTypes) {
+ Object[] arguments = new Object[parameterTypes.length];
+
+ for (int i = 0; i < parameterTypes.length; i++) {
+ arguments[i] = getDefaultValueForType(parameterTypes[i]);
+ }
+
+ return arguments;
+ }
+
+ private Object getDefaultValueForType(Class parameterType) {
+ if (NATIVE_TYPES_DEFAULT_VALUES.containsKey(parameterType))
+ return NATIVE_TYPES_DEFAULT_VALUES.get(parameterType);
+ else
+ return null;
+ }
+}
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>
|
|
From: Kent R. S. <sl...@us...> - 2005-06-08 06:02:45
|
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>nullbuster</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">.cvsignore</a></tt></td><td align="right" id="added">+3</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup">1.1.1.1</a> <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore.diff?r1=1.1.1.1&r2=1.2">-></a> <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a></td></tr>
</table>
<pre class="comment">
Ignore temp build directories
</pre>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a
href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster">nullbuster</a></span><br />
<div class="fileheader"><big><b>.cvsignore</b></big> <small id="info"><a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup">1.1.1.1</a> <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore.diff?r1=1.1.1.1&r2=1.2">-></a> <a href="http://cvs.sourceforge.net/viewcvs.py/nullbuster/nullbuster/.cvsignore?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.1.1.1 -r1.2
--- .cvsignore 8 Jun 2005 05:54:07 -0000 1.1.1.1
+++ .cvsignore 8 Jun 2005 06:02:37 -0000 1.2
@@ -1,3 +1,6 @@
</small></pre><pre class="diff" id="context"> .DS_Store
.classpath
.project
</pre><pre class="diff" id="added">+bin
+build
+dist
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>
|