Skip to content

Commit

Permalink
Fix various typos
Browse files Browse the repository at this point in the history
  • Loading branch information
mkordas authored and joel-costigliola committed Apr 18, 2015
1 parent 1b2e528 commit de11fd5
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/assertj/core/api/AbstractAssert.java
Expand Up @@ -103,8 +103,8 @@ protected WritableAssertionInfo getWritableAssertionInfo() {
* @param arguments the arguments referenced by the format specifiers in the errorMessage string.
*/
protected void failWithMessage(String errorMessage, Object... arguments) {
AssertionError failureWithOverridenErrorMessage = Failures.instance().failureIfErrorMessageIsOverriden(info);
if (failureWithOverridenErrorMessage != null) throw failureWithOverridenErrorMessage;
AssertionError failureWithOverriddenErrorMessage = Failures.instance().failureIfErrorMessageIsOverridden(info);
if (failureWithOverriddenErrorMessage != null) throw failureWithOverriddenErrorMessage;
String description = MessageFormatter.instance().format(info.description(), info.representation(), "");
throw new AssertionError(description + String.format(errorMessage, arguments));
}
Expand Down
Expand Up @@ -132,7 +132,7 @@ public CharacterAssert then(Character actual) {
/**
* Creates a new instance of <code>{@link ClassAssert}</code>
* </p>
* We don't return {@link ClassAssert} as it has overriden methods to annotated with {@link SafeVarargs}.
* We don't return {@link ClassAssert} as it has overridden methods to annotated with {@link SafeVarargs}.
*
* @param actual the actual value.
* @return the created assertion object.
Expand Down Expand Up @@ -351,7 +351,7 @@ public <T> ObjectArrayAssert<T> then(T[] actual) {
/**
* Creates a new instance of <code>{@link MapAssert}</code>.
* </p>
* We don't return {@link MapAssert} as it has overriden methods to annotated with {@link SafeVarargs}.
* We don't return {@link MapAssert} as it has overridden methods to annotated with {@link SafeVarargs}.
*
* @param actual the actual value.
* @return the created assertion object.
Expand Down
Expand Up @@ -641,7 +641,7 @@ public S isXmlEqualTo(CharSequence expectedXml) {
* </p>
*
* <pre><code class='java'>
* // You can easily compare your XML String to the content of an XML file, whatever how formatted thay are.
* // You can easily compare your XML String to the content of an XML file, whatever how formatted they are.
* String oneLineXml = &quot;&lt;rings&gt;&lt;bearer&gt;&lt;name&gt;Frodo&lt;/name&gt;&lt;ring&gt;&lt;name&gt;one ring&lt;/name&gt;&lt;createdBy&gt;Sauron&lt;/createdBy&gt;&lt;/ring&gt;&lt;/bearer&gt;&lt;/rings&gt;&quot;;
* assertThat(oneLineXml).isXmlEqualToContentOf(new File(&quot;src/test/resources/formatted.xml&quot;));
* </code></pre>
Expand Down
Expand Up @@ -1021,7 +1021,7 @@ public S hasSameElementsAs(Iterable<? extends T> iterable) {
* TolkienCharacter frodo = new TolkienCharacter("Frodo", 33, HOBBIT);
* TolkienCharacter frodoClone = new TolkienCharacter("Frodo", 33, HOBBIT);
*
* // Fail if equals has not been overriden in TolkienCharacter as equals default implementation only compares references
* // Fail if equals has not been overridden in TolkienCharacter as equals default implementation only compares references
* assertThat(newArrayList(frodo)).contains(frodoClone);
*
* // frodo and frodoClone are equals when doing a field by field comparison.
Expand Down
Expand Up @@ -755,10 +755,10 @@ public ObjectArrayAssert<Object> extractingResultOf(String method) {
* Extract the result of given method invocation from the array's elements under test into a new array, this new array
* becoming the array under test.
* <p>
* It allows you to test a method reslts of the array's elements instead of testing the elements themselves, it can be
* It allows you to test a method results of the array's elements instead of testing the elements themselves, it can be
* sometimes much less work!
* <p>
* It is especially usefull for classes that does not conform to Java Bean's getter specification (i.e. public String
* It is especially useful for classes that does not conform to Java Bean's getter specification (i.e. public String
* toString() or public String status() instead of public String getStatus()).
* <p>
* Let's take an example to make things clearer :
Expand Down Expand Up @@ -800,7 +800,7 @@ public <P> ObjectArrayAssert<P> extractingResultOf(String method, Class<P> extra
}

/**
* Enable hexadecimal object representation of Itearble elements instead of standard java representation in error
* Enable hexadecimal object representation of Iterable elements instead of standard java representation in error
* messages.
* <p/>
* It can be useful to better understand what the error was with a more meaningful error message.
Expand Down
Expand Up @@ -173,7 +173,7 @@ public S isEqualToIgnoringGivenFields(A other, String... fieldsToIgnore) {
* TolkienCharacter frodo = new TolkienCharacter("Frodo", 33, HOBBIT);
* TolkienCharacter frodoClone = new TolkienCharacter("Frodo", 33, HOBBIT);
*
* // Fail if equals has not been overriden in TolkienCharacter as equals default implementation only compares references
* // Fail if equals has not been overridden in TolkienCharacter as equals default implementation only compares references
* assertThat(frodo).isEqualsTo(frodoClone);
*
* // frodo and frodoClone are equals when doing a field by field comparison.
Expand Down
Expand Up @@ -132,7 +132,7 @@ public CharacterAssert assertThat(Character actual) {
/**
* Creates a new instance of <code>{@link ClassAssert}</code>
* </p>
* We don't return {@link ClassAssert} as it has overriden methods to annotated with {@link SafeVarargs}.
* We don't return {@link ClassAssert} as it has overridden methods to annotated with {@link SafeVarargs}.
*
* @param actual the actual value.
* @return the created assertion object.
Expand Down Expand Up @@ -351,7 +351,7 @@ public <T> ObjectArrayAssert<T> assertThat(T[] actual) {
/**
* Creates a new instance of <code>{@link MapAssert}</code>.
* <p>
* We don't return {@link MapAssert} as it has overriden methods to annotated with {@link SafeVarargs}.
* We don't return {@link MapAssert} as it has overridden methods to annotated with {@link SafeVarargs}.
*
* @param actual the actual value.
* @return the created assertion object.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/assertj/core/internal/Failures.java
Expand Up @@ -86,7 +86,7 @@ public void setRemoveAssertJRelatedElementsFromStackTrace(boolean removeAssertJR
* @return the created <code>{@link AssertionError}</code>.
*/
public AssertionError failure(AssertionInfo info, AssertionErrorFactory factory) {
AssertionError error = failureIfErrorMessageIsOverriden(info);
AssertionError error = failureIfErrorMessageIsOverridden(info);
if (error != null) return error;
printThreadDumpIfNeeded();
return factory.newAssertionError(info.description(), info.representation());
Expand All @@ -107,15 +107,15 @@ public AssertionError failure(AssertionInfo info, AssertionErrorFactory factory)
* @return the created <code>{@link AssertionError}</code>.
*/
public AssertionError failure(AssertionInfo info, ErrorMessageFactory message) {
AssertionError error = failureIfErrorMessageIsOverriden(info);
AssertionError error = failureIfErrorMessageIsOverridden(info);
if (error != null) return error;
AssertionError assertionError = new AssertionError(message.create(info.description(), info.representation()));
removeAssertJRelatedElementsFromStackTraceIfNeeded(assertionError);
printThreadDumpIfNeeded();
return assertionError;
}

public AssertionError failureIfErrorMessageIsOverriden(AssertionInfo info) {
public AssertionError failureIfErrorMessageIsOverridden(AssertionInfo info) {
String overridingErrorMessage = info.overridingErrorMessage();
return isNullOrEmpty(overridingErrorMessage) ? null :
failure(MessageFormatter.instance().format(info.description(), info.representation(), overridingErrorMessage));
Expand Down
Expand Up @@ -38,12 +38,12 @@ public void setUp() {
}

@Test
public void should_pass_with_error_message_overriden() {
public void should_pass_with_error_message_overridden() {
assertions.overridingErrorMessage("new error message").isEqualTo(6L);
}

@Test
public void should_fail_with_overriden_error_message() {
public void should_fail_with_overridden_error_message() {
try {
assertions.overridingErrorMessage("new error message").isEqualTo(8L);
} catch (AssertionError err) {
Expand All @@ -54,7 +54,7 @@ public void should_fail_with_overriden_error_message() {
}

@Test
public void should_fail_with_overriden_error_message_not_interpreted_with_string_format_feature_as_no_args_are_given() {
public void should_fail_with_overridden_error_message_not_interpreted_with_string_format_feature_as_no_args_are_given() {
try {
assertions.overridingErrorMessage("new error message with special character like (%)").isEqualTo(8L);
} catch (AssertionError err) {
Expand All @@ -65,7 +65,7 @@ public void should_fail_with_overriden_error_message_not_interpreted_with_string
}

@Test
public void should_fail_with_overriden_error_message_interpreted_with_string_format_feature() {
public void should_fail_with_overridden_error_message_interpreted_with_string_format_feature() {
try {
long expected = 8L;
assertions.overridingErrorMessage("new error message, expected value was : '%s'", expected).isEqualTo(expected);
Expand All @@ -77,7 +77,7 @@ public void should_fail_with_overriden_error_message_interpreted_with_string_for
}

@Test
public void should_fail_with_description_and_overriden_error_message_using_string_format_feature() {
public void should_fail_with_description_and_overridden_error_message_using_string_format_feature() {
try {
long expected = 8L;
assertions.as("test").overridingErrorMessage("new error message, expected value was : '%s'", expected).isEqualTo(expected);
Expand Down
Expand Up @@ -60,7 +60,7 @@ public void should_return_this() {
}

/**
* Must be overriden to invoke the {@link DateAssert} assertion method under test with the {@link #intArg} attribute.
* Must be overridden to invoke the {@link DateAssert} assertion method under test with the {@link #intArg} attribute.
* <p>
* example with <code>isWithinMonth</code> date assertion:<br>
* <code>assertions.isWithinMonth(5);</code>
Expand All @@ -70,7 +70,7 @@ public void should_return_this() {
protected abstract DateAssert assertionInvocationWithOneIntArg();

/**
* Must be overriden to verify that the {@link Dates} assertion method was invoked with the {@link #intArg} attribute.
* Must be overridden to verify that the {@link Dates} assertion method was invoked with the {@link #intArg} attribute.
* <p>
* example with <code>isWithinMonth</code> date assertion:<br>
* <code>verify(dates).isWithinMonth(getInfo(assertions), getActual(assertions), intArg);</code>
Expand Down
Expand Up @@ -83,9 +83,9 @@ public void should_fallback_to_field_if_exception_has_been_thrown_on_property_ac

@Test
public void should_prefer_properties_over_fields() throws Exception {
Object extractedValue = nameExtractor().extract(employeeWithOverridenName("Overriden Name"));
Object extractedValue = nameExtractor().extract(employeeWithOverriddenName("Overridden Name"));

assertThat(extractedValue).isEqualTo(new Name("Overriden Name"));
assertThat(extractedValue).isEqualTo(new Name("Overridden Name"));
}

@Test
Expand Down Expand Up @@ -134,11 +134,11 @@ public Name getName() {
};
}

private Employee employeeWithOverridenName(final String overridenName) {
private Employee employeeWithOverriddenName(final String overriddenName) {
return new Employee(1L, new Name("Name"), 0) {
@Override
public Name getName() {
return new Name(overridenName);
return new Name(overriddenName);
}
};
}
Expand Down
Expand Up @@ -120,9 +120,9 @@ public void should_fallback_to_field_if_exception_has_been_thrown_on_property_ac
@Test
public void should_prefer_properties_over_fields() throws Exception {

List<Employee> employees = Arrays.<Employee>asList(employeeWithOverridenName("Overriden Name"));
List<Employee> employees = Arrays.<Employee>asList(employeeWithOverriddenName("Overridden Name"));
List<Object> extractedValues = extract(employees, byName("name"));
assertThat(extractedValues).containsOnly(new Name("Overriden Name"));
assertThat(extractedValues).containsOnly(new Name("Overridden Name"));
}

@Test
Expand All @@ -146,12 +146,12 @@ public Name getName() {
};
}

private Employee employeeWithOverridenName(final String overridenName) {
private Employee employeeWithOverriddenName(final String overriddenName) {
return new Employee(1L, new Name("Name"), 0){

@Override
public Name getName() {
return new Name(overridenName);
return new Name(overriddenName);
}
};
}
Expand Down

0 comments on commit de11fd5

Please sign in to comment.