Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-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 760A0174B9 for ; Tue, 7 Oct 2014 05:42:34 +0000 (UTC) Received: (qmail 29692 invoked by uid 500); 7 Oct 2014 05:42:34 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 29641 invoked by uid 500); 7 Oct 2014 05:42:34 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 29279 invoked by uid 99); 7 Oct 2014 05:42:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2014 05:42:33 +0000 Date: Tue, 7 Oct 2014 05:42:33 +0000 (UTC) From: "Anand V Nath (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (TRINIDAD-2510) make SkinTestCase more extendable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TRINIDAD-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161501#comment-14161501 ] Anand V Nath edited comment on TRINIDAD-2510 at 10/7/14 5:41 AM: ----------------------------------------------------------------- I definitely considered this. Looks like the test case wants to provide a way to have the tests decide how StyleSheetDocument is obtained. So they provided a protected method. Notice that the protected method takes "TestSkin" enum as argument. So I could not invoke it myself where I have a String representing path of the skin. {code} /** * Returns the StyleSheetDocument for the specified test skin. */ protected StyleSheetDocument getSkinDocument(TestSkin testSkin) {code} And then that was invoked from: {code} /** * Performs a visit of all style sheet nodes in the specified test * skin */ protected void visitStyleSheets(TestSkin testSkin, StyleSheetVisitor visitor) {code} I did not want to break anyone depending on this (outside trinidad). It can be argued as a rare usage. If we can safely assume that, I am fine with doing the changes as you mentioned. was (Author: anand.v.nath@oracle.com): I definitely considered this. Looks like the test case wants to provide a way to have the tests decide how StyleSheetDocument is obtained. So they provided a protected method /** * Returns the StyleSheetDocument for the specified test skin. */ protected StyleSheetDocument getSkinDocument(TestSkin testSkin) And then that was invoked from /** * Performs a visit of all style sheet nodes in the specified test * skin */ protected void visitStyleSheets(TestSkin testSkin, StyleSheetVisitor visitor) I did not want to break anyone depending on this (outside trinidad). It can be argued as a rare usage. If we can safely assume that I am fine with to do these changes. > make SkinTestCase more extendable > --------------------------------- > > Key: TRINIDAD-2510 > URL: https://issues.apache.org/jira/browse/TRINIDAD-2510 > Project: MyFaces Trinidad > Issue Type: Improvement > Components: Skinning > Affects Versions: 2.1.0-core > Reporter: Anand V Nath > Priority: Minor > Attachments: jira-2510-modified.patch, jira-2510.patch > > > SkinTestCase which is part of trinidad-impl/test, works with TestSkin enum which does not offer flexibility. The change proposed is to add an overloaded method for visiting skins where the skin resource path can be passed as a String. This will enable test cases extending SkinTestCase to work with any skin of their choice. > The proposed change is to add this method in SkinTestCase: > /** > * Performs a visit of all style sheet nodes in the specified test > * skin. This overloaded method is useful in extending SkinTestCase to > * create more test cases since TestSkin does not provide all the skins > * that test needs. > */ > protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) > { > StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); > StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)