wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngalla...@apache.org
Subject svn commit: r1022974 [1/2] - in /incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j: compat/tests/ tests/
Date Fri, 15 Oct 2010 15:51:00 GMT
Author: ngallardo
Date: Fri Oct 15 15:50:59 2010
New Revision: 1022974

URL: http://svn.apache.org/viewvc?rev=1022974&view=rev
Log:
WINK-320 \nFixing build issues with some JSON4J test.  Thanks to Luciano Resende for the patch.

Modified:
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONArrayTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONObjectTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONStringerTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONWriterTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONArrayTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONObjectTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONParserTests.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/OrderedJSONObjectTest.java
    incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/XMLTests.java

Modified: incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONArrayTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONArrayTest.java?rev=1022974&r1=1022973&r2=1022974&view=diff
==============================================================================
--- incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONArrayTest.java (original)
+++ incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONArrayTest.java Fri Oct 15 15:50:59 2010
@@ -6,15 +6,15 @@
  * to you 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 distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.wink.json4j.compat.tests;
@@ -37,7 +37,7 @@ public class ApacheJSONArrayTest extends
      * Test the noargs contructor.
      */
     public void test_new() {
-        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
         JSONFactory factory = JSONFactory.newInstance();
         JSONArray jArray = factory.createJSONArray();
         assertTrue(jArray != null);
@@ -52,7 +52,7 @@ public class ApacheJSONArrayTest extends
         Exception ex = null;
         // Load from empty object string.
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jArray = factory.createJSONArray("[]");
         } catch (Exception ex1) {
@@ -72,7 +72,7 @@ public class ApacheJSONArrayTest extends
         Exception ex = null;
         // Load a basic JSON string
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jArray = factory.createJSONArray("[\"foo\", \"bar\", \"bool\", true]");
         } catch (Exception ex1) {
@@ -92,8 +92,8 @@ public class ApacheJSONArrayTest extends
         Exception ex = null;
         // read in a basic JSON file of a toplevel array that has all the various types in it.
         try {
-            Reader rdr = new InputStreamReader(new FileInputStream("jsonfiles/utf8_basic_array.json"), "UTF-8");
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            Reader rdr = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_basic_array.json"), "UTF-8");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jArray = factory.createJSONArray(rdr);
             rdr.close();
@@ -112,9 +112,9 @@ public class ApacheJSONArrayTest extends
     public void test_newFromStringFailure() {
         JSONArray jArray = null;
         Exception ex = null;
-        // Load a basic JSON string that's corrupt 
+        // Load a basic JSON string that's corrupt
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jArray = factory.createJSONArray("[\"foo\", bar}, \"bool\", true]");
         } catch (Exception ex1) {
@@ -130,7 +130,7 @@ public class ApacheJSONArrayTest extends
     public void test_putLong() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put((long)1);
@@ -151,7 +151,7 @@ public class ApacheJSONArrayTest extends
     public void test_putInt() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put(1);
@@ -172,7 +172,7 @@ public class ApacheJSONArrayTest extends
     public void test_putShort() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put((short)1);
@@ -193,7 +193,7 @@ public class ApacheJSONArrayTest extends
     public void test_putDouble() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put((double)1.123);
@@ -214,7 +214,7 @@ public class ApacheJSONArrayTest extends
     public void test_putBoolean() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put(true);
@@ -235,7 +235,7 @@ public class ApacheJSONArrayTest extends
     public void test_putString() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put("Hello World.");
@@ -256,7 +256,7 @@ public class ApacheJSONArrayTest extends
     public void test_putNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put((Object)null);
@@ -275,7 +275,7 @@ public class ApacheJSONArrayTest extends
     public void test_putJSONObject() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put(factory.createJSONObject());
@@ -296,7 +296,7 @@ public class ApacheJSONArrayTest extends
     public void test_putJSONArray() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray();
             jArray.put(factory.createJSONArray());
@@ -317,7 +317,7 @@ public class ApacheJSONArrayTest extends
     public void test_getLong() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[1]");
             assertTrue(jArray.getLong(0) == (long)1);
@@ -334,7 +334,7 @@ public class ApacheJSONArrayTest extends
     public void test_getLongNgative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[-1]");
             assertTrue(jArray.getLong(0) == (long)-1);
@@ -351,7 +351,7 @@ public class ApacheJSONArrayTest extends
     public void test_getInt() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[1]");
             assertTrue(jArray.getInt(0) == 1);
@@ -368,7 +368,7 @@ public class ApacheJSONArrayTest extends
     public void test_getIntNegative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[-1]");
             assertTrue(jArray.getInt(0) == -1);
@@ -385,7 +385,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDouble() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[1]");
             assertTrue(jArray.getDouble(0) == (double)1);
@@ -402,7 +402,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDoubleNegative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[-1]");
             assertTrue(jArray.getDouble(0) == (double)-1);
@@ -419,7 +419,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDoubleWithDecimal() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[100.959]");
             assertTrue(jArray.getDouble(0) == (double)100.959);
@@ -436,7 +436,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDoubleNegativeWithDecimal() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[-100.959]");
             assertTrue(jArray.getDouble(0) == (double)-100.959);
@@ -453,7 +453,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDoubleWithExponential() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[100959e-3]");
             assertTrue(jArray.getDouble(0) == (double)100.959);
@@ -470,7 +470,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDoubleNegativeWithExponential() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[-100959e-3]");
             assertTrue(jArray.getDouble(0) == (double)-100.959);
@@ -487,7 +487,7 @@ public class ApacheJSONArrayTest extends
     public void test_getString() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"some string\"]");
             assertTrue(jArray.getString(0).equals("some string"));
@@ -504,7 +504,7 @@ public class ApacheJSONArrayTest extends
     public void test_getBoolean() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[true]");
             assertTrue(jArray.getBoolean(0));
@@ -521,7 +521,7 @@ public class ApacheJSONArrayTest extends
     public void test_getBoolean_StringValue() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"true\"]");
             assertTrue(jArray.getBoolean(0));
@@ -538,7 +538,7 @@ public class ApacheJSONArrayTest extends
     public void test_getNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.get(0) == null);
@@ -550,7 +550,7 @@ public class ApacheJSONArrayTest extends
     }
 
     /**************************************************************************/
-    /* The following tests all test failure scenarios due to type mismatching.*/  
+    /* The following tests all test failure scenarios due to type mismatching.*/
     /**************************************************************************/
 
     /**
@@ -559,7 +559,7 @@ public class ApacheJSONArrayTest extends
     public void test_getLong_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"1\"]");
             assertTrue(jArray.getLong(0) == (long)1);
@@ -575,7 +575,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDouble_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"1\"]");
             assertTrue(jArray.getDouble(0) == 1);
@@ -591,7 +591,7 @@ public class ApacheJSONArrayTest extends
     public void test_getInt_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"1\"]");
             assertTrue(jArray.getLong(0) == (int)1);
@@ -607,7 +607,7 @@ public class ApacheJSONArrayTest extends
     public void test_getString_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getString(0) == "null");
@@ -623,7 +623,7 @@ public class ApacheJSONArrayTest extends
     public void test_getBoolean_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[\"1\"]");
             assertTrue(jArray.getBoolean(0) == true);
@@ -640,7 +640,7 @@ public class ApacheJSONArrayTest extends
     public void test_getLong_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getLong(0) == (long)1);
@@ -656,7 +656,7 @@ public class ApacheJSONArrayTest extends
     public void test_getInt_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getLong(0) == (int)1);
@@ -672,7 +672,7 @@ public class ApacheJSONArrayTest extends
     public void test_getDouble_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getDouble(0) == (double)1);
@@ -688,7 +688,7 @@ public class ApacheJSONArrayTest extends
     public void test_getString_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getString(0) == "1");
@@ -704,7 +704,7 @@ public class ApacheJSONArrayTest extends
     public void test_getBoolean_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[null]");
             assertTrue(jArray.getBoolean(0) == true);
@@ -720,7 +720,7 @@ public class ApacheJSONArrayTest extends
     public void test_JoinNoDelimiter() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[1, true, false, null, \"My String\", [1,2,3], {\"foo\":\"bar\"}]");
             String joined = jArray.join("");
@@ -738,7 +738,7 @@ public class ApacheJSONArrayTest extends
     public void test_JoinDelimiter() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONArray jArray = factory.createJSONArray("[1, true, false, null, \"My String\", [1,2,3], {\"foo\":\"bar\"}]");
             String joined = jArray.join("|");

Modified: incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONObjectTest.java?rev=1022974&r1=1022973&r2=1022974&view=diff
==============================================================================
--- incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONObjectTest.java (original)
+++ incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONObjectTest.java Fri Oct 15 15:50:59 2010
@@ -6,15 +6,15 @@
  * to you 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 distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.wink.json4j.compat.tests;
@@ -37,7 +37,7 @@ public class ApacheJSONObjectTest extend
      * Test the noargs contructor.
      */
     public void test_new() {
-        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
         JSONFactory factory = JSONFactory.newInstance();
         JSONObject jObject = factory.createJSONObject();
         assertTrue(jObject != null);
@@ -52,7 +52,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
         // Load from empty object string.
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject("{}");
         }catch(Exception ex1){
@@ -72,7 +72,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
         // Load a basic JSON string
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject("{\"foo\":\"bar\", \"bool\": true}");
         }catch(Exception ex1){
@@ -92,8 +92,8 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
         // read in a basic JSON file that has all the various types in it.
         try{
-            Reader rdr = new InputStreamReader(new FileInputStream("jsonfiles/utf8_basic.json"), "UTF-8");
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            Reader rdr = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_basic.json"), "UTF-8");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject(rdr);
             rdr.close();
@@ -120,7 +120,7 @@ public class ApacheJSONObjectTest extend
 
         // Load a JSON object from a map with JSONable values.
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject(map);
         }catch(Exception ex1){
@@ -138,7 +138,7 @@ public class ApacheJSONObjectTest extend
     public void test_compact() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"foo\":\"bar\", \"bool\": true}");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -159,7 +159,7 @@ public class ApacheJSONObjectTest extend
 
         try {
             // Verify a malformed JSON string (no closure), fails parse.
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"foo\":\"bar\", \"bool\": true");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -180,7 +180,7 @@ public class ApacheJSONObjectTest extend
 
         try {
             // Verify a malformed JSON string (no quotes on attributes), fails parse.
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{foo:\"bar\", bool: true}");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -199,7 +199,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"foo\":\"bar\", \"bool\": true}");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -219,7 +219,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"foo\":\"bar\", \"bool\": false, \"null\": null}");
             assertTrue(jObject.has("foo"));
@@ -239,7 +239,7 @@ public class ApacheJSONObjectTest extend
     public void test_putLong() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("long", (long)1);
@@ -260,7 +260,7 @@ public class ApacheJSONObjectTest extend
     public void test_putInt() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("int", 1);
@@ -281,7 +281,7 @@ public class ApacheJSONObjectTest extend
     public void test_putShort() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("short", (short)1);
@@ -302,7 +302,7 @@ public class ApacheJSONObjectTest extend
     public void test_putDouble() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("double", (double)1.123);
@@ -323,7 +323,7 @@ public class ApacheJSONObjectTest extend
     public void test_putBoolean() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("bool", true);
@@ -344,7 +344,7 @@ public class ApacheJSONObjectTest extend
     public void test_putString() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("string", "Hello World.");
@@ -365,7 +365,7 @@ public class ApacheJSONObjectTest extend
     public void test_putJSONObject() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("object", factory.createJSONObject());
@@ -386,7 +386,7 @@ public class ApacheJSONObjectTest extend
     public void test_putJSONArray() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("array", factory.createJSONArray());
@@ -407,7 +407,7 @@ public class ApacheJSONObjectTest extend
     public void test_append() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("string", "Hello World.");
@@ -431,7 +431,7 @@ public class ApacheJSONObjectTest extend
     public void test_appendtoNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             jObject.put("null", (Object)null);
@@ -465,7 +465,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
         try {
             System.out.println("In: test_appendArray");
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject();
             JSONArray array = factory.createJSONArray();
@@ -493,7 +493,7 @@ public class ApacheJSONObjectTest extend
     public void test_getLong() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"long\":1}");
             assertTrue(jObject.getLong("long") == 1);
@@ -510,7 +510,7 @@ public class ApacheJSONObjectTest extend
     public void test_getLongNgative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"long\":-1}");
             assertTrue(jObject.getLong("long") == -1);
@@ -527,7 +527,7 @@ public class ApacheJSONObjectTest extend
     public void test_getInt() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"int\":1}");
             assertTrue(jObject.getInt("int") == 1);
@@ -544,7 +544,7 @@ public class ApacheJSONObjectTest extend
     public void test_getIntNegative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"int\":-1}");
             assertTrue(jObject.getInt("int") == -1);
@@ -561,7 +561,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDouble() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":1}");
             assertTrue(jObject.getDouble("double") == 1);
@@ -578,7 +578,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDoubleNegative() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":-1}");
             assertTrue(jObject.getDouble("double") == -1);
@@ -595,7 +595,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDoubleWithDecimal() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":100.959}");
             assertTrue(jObject.getDouble("double") == 100.959);
@@ -612,7 +612,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDoubleNegativeWithDecimal() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":-100.959}");
             assertTrue(jObject.getDouble("double") == -100.959);
@@ -629,7 +629,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDoubleWithExponential() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":100959e-3}");
             assertTrue(jObject.getDouble("double") == 100.959);
@@ -646,7 +646,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDoubleNegativeWithExponential() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":-100959e-3}");
             assertTrue(jObject.getDouble("double") == -100.959);
@@ -663,7 +663,7 @@ public class ApacheJSONObjectTest extend
     public void test_getString() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"string\":\"some string\"}");
             assertTrue(jObject.getString("string").equals("some string"));
@@ -680,7 +680,7 @@ public class ApacheJSONObjectTest extend
     public void test_getBoolean() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"bool\":true}");
             assertTrue(jObject.getBoolean("bool"));
@@ -698,7 +698,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"bool\":\"true\"}");
             assertTrue(jObject.getBoolean("bool"));
@@ -710,7 +710,7 @@ public class ApacheJSONObjectTest extend
     }
 
     /**************************************************************************/
-    /* The following tests all test failure scenarios due to type mismatching.*/  
+    /* The following tests all test failure scenarios due to type mismatching.*/
     /**************************************************************************/
 
     /**
@@ -719,7 +719,7 @@ public class ApacheJSONObjectTest extend
     public void test_getLong_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"long\":\"1\"}");
             assertTrue(jObject.getLong("long") == 1);
@@ -735,7 +735,7 @@ public class ApacheJSONObjectTest extend
     public void test_getDouble_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":\"1\"}");
             assertTrue(jObject.getDouble("double") == 1);
@@ -751,7 +751,7 @@ public class ApacheJSONObjectTest extend
     public void test_getInt_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"int\":\"1\"}");
             assertTrue(jObject.getLong("int") == 1);
@@ -767,7 +767,7 @@ public class ApacheJSONObjectTest extend
     public void test_getString_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"string\":null}");
             assertTrue(jObject.getString("string") == "1");
@@ -783,7 +783,7 @@ public class ApacheJSONObjectTest extend
     public void test_getBoolean_typeMisMatch() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"bool\":1}");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -799,7 +799,7 @@ public class ApacheJSONObjectTest extend
     public void test_getLong_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"long\":null}");
             assertTrue(jObject.getLong("long") == 1);
@@ -815,7 +815,7 @@ public class ApacheJSONObjectTest extend
     public void test_getInt_typeMisMatchNull() {
         Exception ex = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"int\":null}");
             assertTrue(jObject.getLong("int") == 1);
@@ -832,7 +832,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"double\":null}");
             assertTrue(jObject.getDouble("double") == 1);
@@ -849,7 +849,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"string\":null}");
             assertTrue(jObject.getString("string") == "1");
@@ -866,7 +866,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
 
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"bool\":null}");
             assertTrue(jObject.getBoolean("bool") == true);
@@ -883,7 +883,7 @@ public class ApacheJSONObjectTest extend
         Exception ex = null;
         HashMap map = new HashMap();
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject("{\"foo\": \"bar\", \"number\": 1, \"bool\":null}");
             Iterator keys = jObject.keys();
@@ -902,13 +902,13 @@ public class ApacheJSONObjectTest extend
     }
 
     /**
-     * Test the iterator of the sorted keys.  
+     * Test the iterator of the sorted keys.
      */
     public void test_sortedKeys() {
         HashMap map = new HashMap();
         JSONObject jObject = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject("{\"foo\": \"bar\", \"number\": 1, \"bool\":null}");
         } catch (Exception ex) {
@@ -934,7 +934,7 @@ public class ApacheJSONObjectTest extend
         JSONObject jObject = null;
         JSONObject jObject2 = null;
         try {
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             jObject = factory.createJSONObject("{\"foo\": \"bar\", \"number\": 1, \"bool\":true}");
             jObject2 = factory.createJSONObject(jObject.toString());
@@ -964,8 +964,8 @@ public class ApacheJSONObjectTest extend
     public void test_utf8_korean() {
         Exception ex = null;
         try {
-            Reader reader = new InputStreamReader(new FileInputStream(new File("jsonfiles/utf8_helloworld_ko.json")), "UTF-8");
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            Reader reader = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_helloworld_ko.json"), "UTF-8");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject(reader);
             reader.close();
@@ -978,15 +978,15 @@ public class ApacheJSONObjectTest extend
     }
 
     /**
-     * Verify a UTF 8 file with character codes in the lower part will parse and 
+     * Verify a UTF 8 file with character codes in the lower part will parse and
      * serialize correctly in escaped unicode format (which is valid JSON and easier
      * to debug)
      */
     public void test_utf8_lowerchar() {
         Exception ex = null;
         try {
-            Reader reader = new InputStreamReader(new FileInputStream(new File("jsonfiles/utf8_lowerchar.json")), "UTF-8");
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            Reader reader = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_lowerchar.json"), "UTF-8");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONObject jObject = factory.createJSONObject(reader);
             reader.close();

Modified: incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONStringerTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONStringerTest.java?rev=1022974&r1=1022973&r2=1022974&view=diff
==============================================================================
--- incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONStringerTest.java (original)
+++ incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONStringerTest.java Fri Oct 15 15:50:59 2010
@@ -6,15 +6,15 @@
  * to you 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 distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.wink.json4j.compat.tests;
@@ -40,7 +40,7 @@ public class ApacheJSONStringerTest exte
      * Test the contructor.
      */
     public void test_new() {
-        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
         JSONFactory factory = JSONFactory.newInstance();
         JSONStringer jStringer = factory.createJSONStringer();
     }
@@ -51,7 +51,7 @@ public class ApacheJSONStringerTest exte
     public void test_WriteEmptyObject() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.object();
@@ -73,7 +73,7 @@ public class ApacheJSONStringerTest exte
     public void test_WriteEmptyObjectClose() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.object();
@@ -96,7 +96,7 @@ public class ApacheJSONStringerTest exte
     public void test_WriteEmptyArray() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.array();
@@ -118,7 +118,7 @@ public class ApacheJSONStringerTest exte
     public void test_WriteObjectComplex() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.object();
@@ -165,7 +165,7 @@ public class ApacheJSONStringerTest exte
     public void test_WriteArrayComplex() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.array();
@@ -208,7 +208,7 @@ public class ApacheJSONStringerTest exte
     public void test_OptsAfterCloseFail() {
         Exception ex = null;
         try{
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONStringer jStringer = factory.createJSONStringer();
             jStringer.array();

Modified: incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONWriterTest.java?rev=1022974&r1=1022973&r2=1022974&view=diff
==============================================================================
--- incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONWriterTest.java (original)
+++ incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/compat/tests/ApacheJSONWriterTest.java Fri Oct 15 15:50:59 2010
@@ -6,15 +6,15 @@
  * to you 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 distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.wink.json4j.compat.tests;
@@ -38,7 +38,7 @@ public class ApacheJSONWriterTest extend
      */
     public void test_new() {
         StringWriter w = new StringWriter();
-        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+        System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
         JSONFactory factory = JSONFactory.newInstance();
         JSONWriter jWriter = factory.createJSONWriter(w);
     }
@@ -50,7 +50,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -73,7 +73,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -96,7 +96,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.array();
@@ -119,7 +119,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.array();
@@ -143,7 +143,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -168,7 +168,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -193,7 +193,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -218,7 +218,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -243,7 +243,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -268,7 +268,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -293,7 +293,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -305,7 +305,7 @@ public class ApacheJSONWriterTest extend
             jWriter.endObject();
             jWriter.close();
             String str = w.toString();
-            
+
             // Verify it parses.
             JSONObject test = factory.createJSONObject(str);
             assertTrue(str.equals("{\"foo\":{\"foo\":true}}"));
@@ -323,7 +323,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -334,7 +334,7 @@ public class ApacheJSONWriterTest extend
             jWriter.endObject();
             jWriter.close();
             String str = w.toString();
-            
+
             // Verify it parses.
             JSONObject test = factory.createJSONObject(str);
             assertTrue(str.equals("{\"foo\":[true]}"));
@@ -352,7 +352,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -385,7 +385,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -418,7 +418,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -468,7 +468,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.array();
@@ -516,7 +516,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
@@ -536,13 +536,13 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.object();
             jWriter.key("foo");
             jWriter.value(true);
-            
+
             // This should die with IllegalStateException...
             jWriter.value(false);
             jWriter.endObject();
@@ -559,10 +559,10 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
-            
+
             // This should die.
             jWriter.key("foo");
         }catch(Exception ex1){
@@ -578,10 +578,10 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
-            
+
             // This should die.
             jWriter.value("foo");
         }catch(Exception ex1){
@@ -597,7 +597,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.array();
@@ -617,7 +617,7 @@ public class ApacheJSONWriterTest extend
         Exception ex = null;
         try{
             StringWriter w = new StringWriter();
-            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.common.model.json.impl.ApacheJSONFactory");
+            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
             JSONFactory factory = JSONFactory.newInstance();
             JSONWriter jWriter = factory.createJSONWriter(w);
             jWriter.array();

Modified: incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONArrayTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONArrayTest.java?rev=1022974&r1=1022973&r2=1022974&view=diff
==============================================================================
--- incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONArrayTest.java (original)
+++ incubator/wink/trunk/wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONArrayTest.java Fri Oct 15 15:50:59 2010
@@ -6,29 +6,29 @@
  * to you 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 distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
- * under the License.    
+ * under the License.
  */
 
 package org.apache.wink.json4j.tests;
 
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import java.io.*;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.HashMap;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
 import java.util.Date;
 
-import org.apache.wink.json4j.*;
-import org.apache.wink.json4j.utils.*;
+import junit.framework.TestCase;
+
+import org.apache.wink.json4j.JSONArray;
+import org.apache.wink.json4j.JSONException;
+import org.apache.wink.json4j.JSONObject;
 
 /**
  * Tests for the basic Java JSONArray model
@@ -51,7 +51,7 @@ public class JSONArrayTest extends TestC
         Exception ex = null;
         try {
             String[] strArray = new String[] {"hello", "world", null, "after null"};
-            
+
             JSONArray jArray = new JSONArray(strArray);
             assertTrue(jArray.length() == 4);
             assertTrue(jArray.getString(0).equals("hello"));
@@ -108,7 +108,7 @@ public class JSONArrayTest extends TestC
         Exception ex = null;
         // read in a basic JSON file of a toplevel array that has all the various types in it.
         try {
-            Reader rdr = new InputStreamReader(new FileInputStream("jsonfiles/utf8_basic_array.json"), "UTF-8");
+            Reader rdr = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_basic_array.json"), "UTF-8");
             jObject = new JSONArray(rdr);
             rdr.close();
         } catch (Exception ex1) {
@@ -129,7 +129,7 @@ public class JSONArrayTest extends TestC
         // read in a basic JSON file of a toplevel array that has all the various types in it.
         // Inputstreams are read as UTF-8 by the underlying parser.
         try {
-            InputStream is = new FileInputStream("jsonfiles/utf8_basic_array.json");
+            InputStream is = this.getClass().getClassLoader().getResourceAsStream("utf8_basic_array.json");
             jObject = new JSONArray(is);
             is.close();
         } catch (Exception ex1) {
@@ -147,7 +147,7 @@ public class JSONArrayTest extends TestC
     public void test_newFromStringFailure() {
         JSONArray jObject = null;
         Exception ex = null;
-        
+
         // Load a basic JSON string that's not valid in strict (unquoted string)
         try {
             jObject = new JSONArray("[\"foo\", bar, \"bool\", true]", true);
@@ -569,10 +569,10 @@ public class JSONArrayTest extends TestC
         }
         assertTrue(ex == null);
     }
-     
+
 
     /**************************************************************************/
-    /* The following tests all test failure scenarios due to type mismatching.*/  
+    /* The following tests all test failure scenarios due to type mismatching.*/
     /**************************************************************************/
 
     /**



Mime
View raw message