svn commit: r1466100 - /struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java

2013-04-09 Thread mcucchiara
Author: mcucchiara
Date: Tue Apr  9 16:19:50 2013
New Revision: 1466100

URL: http://svn.apache.org/r1466100
Log:
Used the commons library api where possible

Modified:

struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java

Modified: 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java?rev=1466100&r1=1466099&r2=1466100&view=diff
==
--- 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java
 (original)
+++ 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/TestUtils.java
 Tue Apr  9 16:19:50 2013
@@ -20,11 +20,11 @@
  */
 package org.apache.struts2.json;
 
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Assert;
 
-import java.io.InputStream;
 import java.net.URL;
-import java.util.StringTokenizer;
 
 /**
  * Utility methods for test classes
@@ -42,14 +42,7 @@ public class TestUtils {
  * @return the normalized string
  */
 public static String normalize(Object obj, boolean appendSpace) {
-StringTokenizer st = new StringTokenizer(obj.toString().trim(), " 
\t\r\n");
-StringBuffer buffer = new StringBuffer(128);
-
-while (st.hasMoreTokens()) {
-buffer.append(st.nextToken());
-}
-
-return buffer.toString();
+return StringUtils.normalizeSpace(obj.toString());
 }
 
 public static String normalize(URL url) throws Exception {
@@ -87,17 +80,6 @@ public class TestUtils {
 if (url == null)
 throw new Exception("unable to verify a null URL");
 
-StringBuffer buffer = new StringBuffer(128);
-InputStream in = url.openStream();
-byte[] buf = new byte[4096];
-int nbytes;
-
-while ((nbytes = in.read(buf)) > 0) {
-buffer.append(new String(buf, 0, nbytes));
-}
-
-in.close();
-
-return buffer.toString();
+return IOUtils.toString(url.openStream());
 }
 }




[CONF] Confluence Changes in the last 24 hours

2013-04-09 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache Ambari (Incubating) (https://cwiki.apache.org/confluence/display/AMBARI)

Pages
-
Ambari Development edited by  yusaku  (02:27 PM)
https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Development

Distinctive Functionality Necessities of various Tires created by 
ktxia...@gmail.com (01:43 AM)
https://cwiki.apache.org/confluence/display/AMBARI/2013/04/09/Distinctive+Functionality+Necessities+of+various+Tires

Galvanised mild steel pipe and buff the great strains out with a buffer 
grinding disc created by ktxia...@gmail.com (01:17 AM)
https://cwiki.apache.org/confluence/display/AMBARI/2013/04/09/Galvanised+mild+steel+pipe+and+buff+the+great+strains+out+with+a+buffer+grinding+disc


Comments
https://cwiki.apache.org/confluence/display/AMBARI/Adding+a+New+Service+to+an+Existing+Cluster
 (1)

Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL)

Pages
-
Camel 2.10.0 Release edited by  muellerc  (04:02 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.10.0+Release

Camel 2.11.0 Release edited by  muellerc  (03:41 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.11.0+Release



Apache Cloudstack (https://cwiki.apache.org/confluence/display/CLOUDSTACK)

Pages
-
Isolation in Advanced Zone Functional Spec edited by  yasker  (11:27 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Isolation+in+Advanced+Zone+Functional+Spec

Mapping model for CloudStack zone and Vmware datacenter edited by  sateeshc  
(08:49 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Mapping+model+for+CloudStack+zone+and+Vmware+datacenter

CloudStack Documentation Contributors Overview edited by  jzb  (08:24 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+Documentation+Contributors+Overview

2.19 Add more than one Private GW to a VPC created by chandanp (07:26 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/2.19+Add+more+than+one+Private+GW+to+a+VPC

QuickCloud edited by  chiradeep  (06:30 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/QuickCloud

Storage Backup Object Store Plugin Framework edited by  minc  (06:29 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Storage+Backup+Object+Store+Plugin+Framework

How to build on master branch edited by  chiradeep  (04:37 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+on+master+branch

Student Projects edited by  sebgoa  (04:15 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Student+Projects

Home edited by  jzb  (02:46 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home

FS for Granular Global Configuration Parameters edited by  
harikrishna.patn...@citrix.com  (02:25 PM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+for+Granular+Global+Configuration+Parameters

Granular Global Configuration Parameters created by prashantkm (04:46 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Granular+Global+Configuration+Parameters

Support ACL deny rules edited by  kis...@cloud.com  (07:42 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Support+ACL+deny+rules

Limit Resources per domain or accounts Test Results edited by  sailajam  (07:25 
AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+per+domain+or+accounts+Test+Results

Draft Support of Netscaler as External LoadBalancing Provider in VPC edited by  
rajesh.batt...@citrix.com  (07:02 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Draft+Support+of+Netscaler+as+External+LoadBalancing+Provider+in+VPC

Non-Contiguous Vlan ranges created by kiran.kon...@citrix.com (05:27 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Non-Contiguous+Vlan+ranges

ACLs on private GW edited by  jayapal  (04:52 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/ACLs+on+private+GW

configurable setting to use linked clones or full clones on VMware edited by  
prashantkm  (01:13 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/configurable+setting+to+use+linked+clones+or+full+clones+on+VMware

Egress firewall rules feature support for external device Juniper SRX edited by 
 jayapal  (01:10 AM)
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Egress+firewall+rules+feature+support+for+external+device+Juniper+SRX



Apache cTAKES (https://cwiki.apache.org/confluence/display/CTAKES)

Pages
-
cTAKES 3.0 User Install Guide edited by  bleeker  (03:33 PM)
https://cwiki.apache.org/confluence/display/CTAKES/cTAKES+3.0+User+Install+Guide



A