Removed dataProvider.
This commit is contained in:
parent
4d4575ddd9
commit
709a33e1bd
1 changed files with 4 additions and 15 deletions
|
@ -29,10 +29,10 @@
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.thauvin.erik.httpstatus;
|
package net.thauvin.erik.httpstatus;
|
||||||
|
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.DataProvider;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
@ -44,24 +44,13 @@ import java.util.ResourceBundle;
|
||||||
* @created 2015-12-03
|
* @created 2015-12-03
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class ReasonsTest {
|
public class ReasonsTest {
|
||||||
@DataProvider(name = "reasons")
|
@Test
|
||||||
public Object[][] reasons() {
|
public void testGetReasonPhrase() {
|
||||||
final ResourceBundle bundle = ResourceBundle.getBundle(Reasons.BUNDLE_BASENAME);
|
final ResourceBundle bundle = ResourceBundle.getBundle(Reasons.BUNDLE_BASENAME);
|
||||||
final Object[][] reasons = new String[bundle.keySet().size()][2];
|
|
||||||
int i = 0;
|
|
||||||
for (final String key : bundle.keySet()) {
|
for (final String key : bundle.keySet()) {
|
||||||
reasons[i][0] = key;
|
Assert.assertEquals(bundle.getString(key), Reasons.getReasonPhrase(key), "getReasonPhrase(" + key + ')');
|
||||||
reasons[i][1] = bundle.getString(key);
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
return reasons;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(dataProvider = "reasons")
|
|
||||||
public void testGetReasonPhrase(String code, String reason)
|
|
||||||
throws Exception {
|
|
||||||
Assert.assertEquals(reason, Reasons.getReasonPhrase(code));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue