From fb36918d854d5561d90bb8728ef1698bc545f42f Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Fri, 8 May 2015 23:30:41 -0500 Subject: [PATCH 1/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d91f7c2..64c0014 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,10 @@ https://github.com/douglascrockford/JSON-java
*These tests are a work in progress. Help from interested developers is welcome.*
More coverage is needed, but more importantly, improvements to test quality is needed.
+You will need the following libraries for testing: Test harness: http://junit.org
Coverage: http://www.eclemma.org/
+Mockery: https://github.com/mockito/mockito Eclipse is the recommended development environment. Run individual tests or JunitTestSuite using *EclEmma Coverage*, or execute the TestRunner application directly.
From 0a995318e7faad8835d11ad73f47004bcbff3d64 Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sat, 9 May 2015 15:24:21 -0500 Subject: [PATCH 2/2] Delete MyBean.java --- MyBean.java | 80 ----------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 MyBean.java diff --git a/MyBean.java b/MyBean.java deleted file mode 100644 index 1b9e6f0..0000000 --- a/MyBean.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.json.junit; - -import java.io.*; - -// bean must be serializable -public class MyBean implements Serializable { - // bean properties should be private - private static final long serialVersionUID = 1L; - private int intKey; - private double doubleKey; - private String stringKey; - private String complexStringKey; - private boolean trueKey; - private boolean falseKey; - - /** - * Throw in a few public properties in order to test building - * from an Object. - */ - public String publicStr; - public int publicInt; - - // bean needs a default ctor - public MyBean() { - intKey = 42; - doubleKey = -23.45e7; - stringKey = "hello world!"; - complexStringKey = "h\be\tllo w\u1234orld!"; - trueKey = true; - falseKey = false; - - publicStr = "abc"; - publicInt = 42; - } - - // need getters, but don't need setters - public int getIntKey() { - return intKey; - } - public double getDoubleKey() { - return doubleKey; - } - public String getStringKey() { - return stringKey; - } - public String getComplexStringKey() { - return complexStringKey; - } - public boolean isTrueKey() { - return trueKey; - } - public boolean isFalseKey() { - return falseKey; - } - - /** - * Just a random invalid JSON getter, not even backed up by a property - */ - public StringReader getStringReaderKey() { - return (new StringReader("") { - /** - * TODO: Need to understand why returning a string - * turns this into an empty JSONObject, - * but not overriding turns this into a string. - */ - @Override - public String toString(){ - return "Whatever"; - } - }); - } - // bean hashcode is recommended - public int hashCode() { - return super.hashCode(); - } - // bean equals is recommended - public boolean equals(Object obj) { - return super.equals(obj); - } -}