Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 66824 invoked from network); 31 Aug 2008 16:32:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Aug 2008 16:32:53 -0000 Received: (qmail 77551 invoked by uid 500); 31 Aug 2008 16:32:49 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 77510 invoked by uid 500); 31 Aug 2008 16:32:49 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 77499 invoked by uid 99); 31 Aug 2008 16:32:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Aug 2008 09:32:49 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chunronglai@gmail.com designates 209.85.198.251 as permitted sender) Received: from [209.85.198.251] (HELO rv-out-0708.google.com) (209.85.198.251) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Aug 2008 16:31:51 +0000 Received: by rv-out-0708.google.com with SMTP id k29so1307917rvb.0 for ; Sun, 31 Aug 2008 09:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=kW7QhK4OyQkqvjXphL/W2loRVLRx5IAXN/WIVbgHI0A=; b=q3j+Nx+Fki/cTEKs33JqiclHTGBGZvRYlELoTq2bbIi0eMU9xyyu5fSK1lp2d6lFri WwqhMKJ96T3ZzSRTcVIyB0uD1iOJ1a329Oba2oYjFVC8quGvd0fSYCqX61xuTuJjaMuU hozvq45z4yukuOjq5BiRNgugd6LQSO9n5dPuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=OkYRxfhzi4IikaHx7Ce1cYWafL5tjxhhTDxaL2Hxnt5+snUJs2GtFaq4qi9kC3pZsB bn05PrXyHhbVGDyoLIbMQ6pX8nkeD0XtA8UqE7Nl9KIFBEkvZMpoDlO8wOuHNrB3Yyhf lD5Vd1CTSrB1bi6MTKL/a2nZKgzi0UYhgdTgg= Received: by 10.140.136.5 with SMTP id j5mr2873742rvd.0.1220200331942; Sun, 31 Aug 2008 09:32:11 -0700 (PDT) Received: by 10.140.170.1 with HTTP; Sun, 31 Aug 2008 09:32:11 -0700 (PDT) Message-ID: Date: Mon, 1 Sep 2008 00:32:11 +0800 From: "chunrong lai" To: dev@harmony.apache.org Subject: Re: svn commit: r689792 - /harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java In-Reply-To: <20080828115632.574E523889C0@eris.apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_30275_7796979.1220200331952" References: <20080828115632.574E523889C0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_30275_7796979.1220200331952 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I see the commit only modifies some tests. But it breaks the test cases org.apache.harmony.auth.tests.javax.security.auth.kerberos.serialization.KrbServicePermissionCollectionTest and org.apache.harmony.auth.tests.javax.security.auth.kerberos.serialization.KrbDelegationPermissionCollectionTest of classlib test suites, in our integrity testing platforms. Should we have a check? Thanks. http://people.apache.org/~chunrong/harmony-integrity/windows_x86/classlib-test/ junit.framework.AssertionFailedError: expected:<[(javax.security.auth.kerberos.DelegationPermission "AAA" "BBB"), (javax.security.auth.kerberos.DelegationPermission "AAA" "CCC"), (javax.security.auth.kerberos.DelegationPermission "BBB" "CCC")]> but was:<[(javax.security.auth.kerberos.DelegationPermission "BBB" "CCC"), (javax.security.auth.kerberos.DelegationPermission "AAA" "CCC"), (javax.security.auth.kerberos.DelegationPermission "AAA" "BBB")]> On 8/28/08, tellison@apache.org wrote: > > Author: tellison > Date: Thu Aug 28 04:56:31 2008 > New Revision: 689792 > > URL: http://svn.apache.org/viewvc?rev=689792&view=rev > Log: > Apply patch for HARMONY-5962 ([classlib][support] Fail on > UnresolvedPermissionTest and UnresolvedPermissionCollectionTest with Sun > JDK) > > Modified: > > harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java > > Modified: > harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java > URL: > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java?rev=689792&r1=689791&r2=689792&view=diff > > ============================================================================== > --- > harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java > (original) > +++ > harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java > Thu Aug 28 04:56:31 2008 > @@ -35,9 +35,9 @@ > import java.lang.reflect.Method; > import java.security.Permission; > import java.security.PermissionCollection; > -import java.util.Collection; > +import java.security.UnresolvedPermission; > +import java.util.ArrayList; > import java.util.Collections; > -import java.util.HashSet; > > import junit.framework.Assert; > import junit.framework.TestCase; > @@ -292,13 +292,86 @@ > Assert.assertEquals(initPC.isReadOnly(), dserPC.isReadOnly()); > > // verify collection of permissions > - Collection refCollection = new > HashSet( > - Collections.list(initPC.elements())); > - Collection tstCollection = new > HashSet( > - Collections.list(dserPC.elements())); > + ArrayList refList = > Collections.list(initPC.elements()); > + ArrayList tstList = > Collections.list(dserPC.elements()); > + Assert.assertEquals(refList.size(), refList.size()); > + > + int size = refList.size(); > + if (size > 0) { > + if (refList.get(0) instanceof UnresolvedPermission) { > + boolean found; > + UnresolvedPermission refPerm, tstPerm; > + for (int i = 0; i < size; i++) { > + found = false; > + refPerm = (UnresolvedPermission)refList.get(i); > + for(int j = 0; j < size; j++){ > + tstPerm = > (UnresolvedPermission)tstList.get(i); > + if(equalsUnresolvedPermission(refPerm, > tstPerm)){ > + found = true; > + break; > + } > + } > + > + Assert.assertTrue(found); > + } > + } else { > + Assert.assertEquals(refList, tstList); > + } > + } > + } > + > + /* > + * check whether the given two UnresolvedPermission objects equal > to each other > + */ > + private boolean equalsUnresolvedPermission(UnresolvedPermission > up1, > + UnresolvedPermission up2) { > + > + java.security.cert.Certificate[] certs = > up1.getUnresolvedCerts(); > + if (certs != null && certs.length == 0) { > + if(null == up2.getUnresolvedCerts()){ > + if (up1.getName().equals(up2.getName())){ > + String up1Name = up1.getUnresolvedName(); > + String up2Name = up2.getUnresolvedName(); > + if(up1Name == null ? up2Name == null : > up1Name.equals(up2Name)){ > + String up1Actions = > up1.getUnresolvedActions(); > + String up2Actions = > up2.getUnresolvedActions(); > + return up1Actions == null ? up2Actions == null > : up1Actions.equals(up2Actions); > + } > + } > + } > + > + return false; > + } > + > + return up1.equals(up2); > + > + } > + }; > + > + /** > + * Comparator for java.security.UnresolvedPermission objects > + */ > + public final static SerializableAssert > UNRESOLVED_PERMISSION_COMPARATOR = new SerializableAssert() { > > - Assert.assertEquals(refCollection, tstCollection); > + public void assertDeserialized(Serializable initial, > + Serializable deserialized) { > + UnresolvedPermission initPerm = (UnresolvedPermission) > initial; > + UnresolvedPermission dserPerm = (UnresolvedPermission) > deserialized; > + > + java.security.cert.Certificate[] certs = > initPerm.getUnresolvedCerts(); > + if (certs != null && certs.length == 0) { > + Assert.assertEquals(initPerm.getUnresolvedType(), dserPerm > + .getUnresolvedType()); > + Assert.assertEquals(initPerm.getUnresolvedName(), dserPerm > + .getUnresolvedName()); > + Assert.assertEquals(initPerm.getUnresolvedActions(), > dserPerm > + .getUnresolvedActions()); > + Assert.assertNull(dserPerm.getUnresolvedCerts()); > + } else { > + Assert.assertEquals(initPerm, dserPerm); > + } > } > + > }; > > /** > @@ -334,6 +407,9 @@ > if (m.getDeclaringClass() != Object.class) { > // one of classes overrides Object.equals(Object) method > // use default comparator > + if (object instanceof UnresolvedPermission) { > + return UNRESOLVED_PERMISSION_COMPARATOR; > + } > return DEFAULT_COMPARATOR; > } > > > > ------=_Part_30275_7796979.1220200331952--