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.test.rule; 016 017 import com.liferay.portal.kernel.test.rule.BaseTestRule; 018 import com.liferay.portal.test.rule.callback.SyntheticBundleTestCallback; 019 020 /** 021 * Creates and installs a bundle from the named sub-package of a test class. 022 * 023 * <p> 024 * For example, if the test class is <code>bar.FooTest</code>, invoking 025 * <code>new SyntheticBundleRule("fee")</code> on <code>FooTest</code> creates a 026 * bundle of the contents of the <code>bar.fee</code> package. This sub-package 027 * should also contain a <code>bnd.bnd</code> file that describes the bundle. 028 * When writing the bnd file, you can use the <code>${bundle.package}</code> 029 * property to simplify the contents of the file. 030 * </p> 031 * 032 * @author Raymond Aug?? 033 */ 034 public class SyntheticBundleRule extends BaseTestRule<Long, Long> { 035 036 public SyntheticBundleRule(String bundlePackage) { 037 super(new SyntheticBundleTestCallback(bundlePackage)); 038 } 039 040 }