[ 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:42 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 template method for tests to override. 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.n...@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. 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. > 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)