001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.test;
016    
017    import com.liferay.portal.kernel.util.ArrayUtil;
018    import com.liferay.portal.kernel.util.GetterUtil;
019    import com.liferay.portal.kernel.util.StringUtil;
020    
021    import org.junit.Assume;
022    
023    /**
024     * @author Zsolt Balogh
025     */
026    public class FixedIssuesUtils {
027    
028            public static void assumeIssueIsFixed(String issue) {
029                    Assume.assumeTrue(isIssueFixed(issue));
030            }
031    
032            public static void assumeIssueIsNotFixed(String issue) {
033                    Assume.assumeFalse(isIssueFixed(issue));
034            }
035    
036            public static boolean isIssueFixed(String issue) {
037                    return ArrayUtil.contains(_instance._fixedIssues, issue);
038            }
039    
040            private FixedIssuesUtils() {
041                    _fixedIssues = StringUtil.split(
042                            GetterUtil.getString(System.getProperty("fixed.issues")));
043            }
044    
045            private static final FixedIssuesUtils _instance = new FixedIssuesUtils();
046    
047            private final String[] _fixedIssues;
048    
049    }