Skip to content

Commit

Permalink
HV-1288 Making use of org.testng.Assert instead of org.testng.AssertJ…
Browse files Browse the repository at this point in the history
…Unit
  • Loading branch information
marko-bekhta authored and gsmet committed Apr 13, 2017
1 parent 79e09a3 commit 26338fa
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 27 deletions.
Expand Up @@ -8,7 +8,7 @@

import static org.hibernate.validator.ap.testutil.CompilerTestHelper.assertThatDiagnosticsMatch;
import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

import java.io.File;

Expand Down
Expand Up @@ -8,7 +8,7 @@

import static org.hibernate.validator.ap.testutil.CompilerTestHelper.assertThatDiagnosticsMatch;
import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

import java.io.File;

Expand Down
Expand Up @@ -8,7 +8,7 @@
package org.hibernate.validator.test.cfg;

import static java.lang.annotation.ElementType.FIELD;
import static org.assertj.core.api.Assertions.fail;
import static org.testng.Assert.fail;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertCorrectConstraintViolationMessages;
import static org.hibernate.validator.testutils.ValidatorUtil.getConfiguration;

Expand Down
Expand Up @@ -8,9 +8,9 @@
package org.hibernate.validator.test.cfg;

import static java.lang.annotation.ElementType.FIELD;
import static org.assertj.core.api.Assertions.fail;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertCorrectConstraintViolationMessages;
import static org.hibernate.validator.testutils.ValidatorUtil.getConfiguration;
import static org.testng.Assert.fail;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Expand Up @@ -12,7 +12,7 @@
import static org.hibernate.validator.testutils.ValidatorUtil.getConfiguration;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.Assert.assertEquals;

import java.util.Set;

Expand Down Expand Up @@ -225,7 +225,7 @@ private String stringOfLength(int length) {
builder.append( 'a' );
}
String s = builder.toString();
assertEquals( length, s.getBytes().length );
assertEquals( s.getBytes().length, length );
return s;
}

Expand All @@ -241,7 +241,7 @@ private String domainOfLength(int length) {
}
}
String s = builder.toString();
assertEquals( length, s.getBytes().length );
assertEquals( s.getBytes().length, length );
return s;
}

Expand Down
Expand Up @@ -15,7 +15,7 @@
import org.hibernate.validator.testutil.MyCustomStringImpl;

import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* Tests for the {@code LuhnCheckValidator}.
Expand Down
Expand Up @@ -26,7 +26,7 @@
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertNumberOfViolations;
import static org.hibernate.validator.testutils.ValidatorUtil.getConfiguration;
import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* Tests for the {@code Mod10CheckValidator}.
Expand Down
Expand Up @@ -27,7 +27,7 @@
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertNumberOfViolations;
import static org.hibernate.validator.testutils.ValidatorUtil.getConfiguration;
import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* Tests for the {@code Mod11CheckValidator}.
Expand Down
Expand Up @@ -15,7 +15,7 @@
import org.hibernate.validator.testutil.MyCustomStringImpl;

import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* Tests for the {@code ModCheckValidator}.
Expand Down
Expand Up @@ -17,7 +17,7 @@
import org.hibernate.validator.internal.engine.groups.Sequence;
import org.testng.annotations.Test;

import static org.testng.FileAssert.fail;
import static org.testng.Assert.fail;

/**
* @author Hardy Ferentschik
Expand Down
Expand Up @@ -25,7 +25,7 @@
import org.testng.annotations.Test;

import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertCorrectConstraintViolationMessages;
import static org.testng.AssertJUnit.fail;
import static org.testng.Assert.fail;

/**
* @author Hardy Ferentschik
Expand Down
Expand Up @@ -10,7 +10,7 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.Assert.assertNotNull;

import java.lang.reflect.Method;
import java.util.Collections;
Expand Down
Expand Up @@ -14,8 +14,8 @@
import org.hibernate.validator.internal.util.ModUtil;
import org.hibernate.validator.testutil.TestForIssue;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;

/**
* Tests for the {@code ModUtil}.
Expand Down
Expand Up @@ -15,7 +15,7 @@
import static java.lang.Thread.currentThread;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.fail;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
Expand Down Expand Up @@ -48,8 +48,8 @@ private void runLoadClass(LoadClass action) {
catch (ValidationException e) {
String expectedMessageId = "HV000065";
assertTrue(
"Wrong error message. Expected " + expectedMessageId + " ,but got " + e.getMessage(),
e.getMessage().startsWith( expectedMessageId )
e.getMessage().startsWith( expectedMessageId ),
"Wrong error message. Expected " + expectedMessageId + " ,but got " + e.getMessage()
);
assertNotNull( e.getCause(), "HV-1026: exception cause should be set" );
}
Expand Down
Expand Up @@ -19,7 +19,7 @@
import org.hibernate.validator.testutils.ValidatorUtil;
import org.testng.annotations.Test;

import static org.testng.AssertJUnit.assertTrue;
import static org.testng.Assert.assertTrue;

/**
* Test that arrays and varargs can be specified in XML with and without default package
Expand All @@ -42,12 +42,12 @@ public void testArrayParametersAreConfigurableWithAndWithoutDefaultPackage() {

BeanDescriptor beanDescriptor = validator.getConstraintsForClass( Foo.class );
Set<MethodDescriptor> methodDescriptors = beanDescriptor.getConstrainedMethods( MethodType.NON_GETTER );
assertTrue( "There should be two constrained methods", methodDescriptors.size() == 2 );
assertTrue( methodDescriptors.size() == 2, "There should be two constrained methods" );
for ( MethodDescriptor methodDescriptor : methodDescriptors ) {
assertTrue( "Parameter should be constrained", methodDescriptor.hasConstrainedParameters() );
assertTrue( methodDescriptor.hasConstrainedParameters(), "Parameter should be constrained" );
List<ParameterDescriptor> parameterDescriptorList = methodDescriptor.getParameterDescriptors();
for ( ParameterDescriptor parameterDescriptor : parameterDescriptorList ) {
assertTrue( "Parameter should be constrained", parameterDescriptor.isCascaded() );
assertTrue( parameterDescriptor.isCascaded(), "Parameter should be constrained" );
}
}
}
Expand Down
Expand Up @@ -23,8 +23,8 @@
import org.hibernate.validator.testutil.DummyTraversableResolver;
import org.hibernate.validator.testutils.ValidatorUtil;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.FileAssert.fail;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;


/**
Expand Down
Expand Up @@ -6,10 +6,10 @@
*/
package org.hibernate.validator.testutil;

import static org.assertj.core.api.Fail.fail;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

import java.lang.annotation.Annotation;
import java.util.ArrayList;
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/
package org.hibernate.validator.testutil;

import static org.assertj.core.api.Fail.fail;
import static org.testng.Assert.fail;

import org.assertj.core.api.IterableAssert;

Expand Down

0 comments on commit 26338fa

Please sign in to comment.