Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Nov 8, 2012
1 parent ad71ebf commit abf3189
Showing 1 changed file with 0 additions and 28 deletions.
Expand Up @@ -26,8 +26,6 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.ArrayList;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -168,30 +166,4 @@ public void testWithIncompleteEntityHexadecimalRef()
assertThat(xmlEntityValidation.getError().size(), is(2));
}

@Test
public void testWithMissingEntity()
{
mockMessages = createMock(ValidationMessages.class);

expect(mockMessages.xmlEntityValidatorName()).andReturn(MOCK_ENTITY_VALIDATOR_NAME).anyTimes();
expect(mockMessages.xmlEntityValidatorDescription()).andReturn(MOCK_ENTITY_VALIDATOR_DESCRIPTION).anyTimes();

ArrayList<String> missingEntities = new ArrayList<String>();
missingEntities.add(" [&amp;] ");
missingEntities.add(" [&RedHat;] ");
missingEntities.add(" [&#123;] ");
missingEntities.add(" [&#x123F;] ");

expect(mockMessages.entityMissing(missingEntities)).andReturn("Mock missing messages");
replay(mockMessages);

xmlEntityValidation = new XmlEntityValidation(mockMessages);
String source = "Source string &amp; and &RedHat; and &#123; and &#x123F;";
String target = "Target string";
xmlEntityValidation.validate(source, target);

assertThat(xmlEntityValidation.hasError(), is(true));
assertThat(xmlEntityValidation.getError().size(), is(1));
}

}

0 comments on commit abf3189

Please sign in to comment.