From dev-return-2353-apmail-oltu-dev-archive=oltu.apache.org@oltu.apache.org Fri Dec 5 18:41:46 2014 Return-Path: X-Original-To: apmail-oltu-dev-archive@www.apache.org Delivered-To: apmail-oltu-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D445106C7 for ; Fri, 5 Dec 2014 18:41:46 +0000 (UTC) Received: (qmail 6931 invoked by uid 500); 5 Dec 2014 18:41:46 -0000 Delivered-To: apmail-oltu-dev-archive@oltu.apache.org Received: (qmail 6899 invoked by uid 500); 5 Dec 2014 18:41:46 -0000 Mailing-List: contact dev-help@oltu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oltu.apache.org Delivered-To: mailing list dev@oltu.apache.org Received: (qmail 6884 invoked by uid 99); 5 Dec 2014 18:41:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Dec 2014 18:41:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 209.85.214.174 as permitted sender) Received: from [209.85.214.174] (HELO mail-ob0-f174.google.com) (209.85.214.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Dec 2014 18:41:40 +0000 Received: by mail-ob0-f174.google.com with SMTP id nt9so1032320obb.19 for ; Fri, 05 Dec 2014 10:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=TEqhrXPOhGm9qbBWMAmpNg2BujY8yRvMVtSNhEMwQ8A=; b=zyS34fsScQQcl+vd9GBnWJR4tKe4nXy57zrEF7uegHnD9JkgcV1uEqIKMMjDmLazLG VraLKA9oI8bEYCr0ILGNA2WsYVpxtmkCaYkEZTrL/gCs0HmDwdqAFeVkekTs+J8vAImp +ubLx9r2bJ/5uqH9YJFiMf6oYL3E4kVufrt51o3D+OaxtUgTjCsRlcYrjOUO4z5eq+oU LzH9bRlPN2F1OukeunzDctBLJnUpSqDpMGi4eUYa+jmT7t/sg3Lm+pjzI3TQIZu4eMCW 2osmYYfq/HyxWum/YenPnLU+RoysZ8vuGZtvx/6kSThRTPTUdDBy40MEfG6MRaEs3zTF Qkbg== MIME-Version: 1.0 X-Received: by 10.202.169.200 with SMTP id s191mr11027309oie.7.1417804774874; Fri, 05 Dec 2014 10:39:34 -0800 (PST) Sender: simone.tripodi@gmail.com Received: by 10.60.145.207 with HTTP; Fri, 5 Dec 2014 10:39:34 -0800 (PST) Date: Fri, 5 Dec 2014 11:39:34 -0700 X-Google-Sender-Auth: mR6Q145Ean3tulFoiouAAiBhlHg Message-ID: Subject: JSON comparison in test case best practice From: Simone Tripodi To: dev@oltu.apache.org Content-Type: multipart/alternative; boundary=001a113cb036f7a74a05097c6589 X-Virus-Checked: Checked by ClamAV on apache.org --001a113cb036f7a74a05097c6589 Content-Type: text/plain; charset=UTF-8 Hi all mates, there are a couple of tests in the oauth-2.0/common codebase failing on CLI, but succeed in Eclipse, see below for details... I honestly think that comparing serialised JSON strings is not thebest way to assert two JSON documents are representing exactly the same data, we need to handle that situation... Does anybody know a best practice to compare json object, such as XMLDiff of something else? I am asking google, in the meanwhile... :) Best, -Simo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OAuthResponseTest.testErrorResponse:47 expected:<{"[error_uri":" http://example-uri","error":"error","param":"value","realm":"album","state":"ok","error_description":"error_description]"}> but was:<{"[param":"value","error_description":"error_description","realm":"album","state":"ok","error":"error","error_uri":" http://example-uri]"}> WWWAuthHeaderParametersApplierTest.testApplyOAuthParameters:60 expected:<...ope="s1 s2 s3",error[_uri="http://www.example.com/error",error="invalid_token]"> but was:<...ope="s1 s2 s3",error[="invalid_token",error_uri=" http://www.example.com/error]"> http://people.apache.org/~simonetripodi/ http://twitter.com/simonetripodi --001a113cb036f7a74a05097c6589--