You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/02/08 19:29:51 UTC
[32/32] git commit: ISIS-220: fixing failing test...
Updated Branches:
refs/heads/master ba5b3d4e4 -> b3d07ecd8
ISIS-220: fixing failing test...
.. pretty sure introduced by Kevin's changes; anyway, easily sorted
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/b3d07ecd
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/b3d07ecd
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/b3d07ecd
Branch: refs/heads/master
Commit: b3d07ecd80574d1322702afdbdd6d3c4c4bf2f6f
Parents: e0fe258
Author: Dan Haywood <da...@apache.org>
Authored: Fri Feb 8 18:29:18 2013 +0000
Committer: Dan Haywood <da...@apache.org>
Committed: Fri Feb 8 18:29:18 2013 +0000
----------------------------------------------------------------------
.../ObjectFixtureFilePersistorTest.java | 19 +++++++++++----
1 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/b3d07ecd/core/integtestsupport/src/test/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/test/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java b/core/integtestsupport/src/test/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
index 62e3084..c920f10 100644
--- a/core/integtestsupport/src/test/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
+++ b/core/integtestsupport/src/test/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistorTest.java
@@ -139,7 +139,7 @@ public class ObjectFixtureFilePersistorTest {
final StringWriter out = new StringWriter();
persistor.save(objects, out);
- final String actual = out.toString().replaceAll("\r\n", "\n");
+ final String actual = canonicalize(out);
final String expected = SimpleEntity.class.getName() + "#2\n date: 08-Mar-2010 01:00 UTC\n name: Fred Smith\n";
@@ -154,14 +154,23 @@ public class ObjectFixtureFilePersistorTest {
final StringWriter out = new StringWriter();
persistor.save(objects, out);
- final String actual = out.toString().replaceAll("\r\n", "\n");
+ final String actual = canonicalize(out);
final String expected1 = SimpleEntity.class.getName() + "#2\n date: 08-Mar-2010 01:00 UTC\n name: Fred Smith\n";
- final String expected2 = SimpleEntity.class.getName() + "#3\n date: \n name: \n";
+ final String expected2 = SimpleEntity.class.getName() + "#3\n date: \n name: 3\n";
assertThat(actual, IsisMatchers.contains(expected1));
assertThat(actual, IsisMatchers.contains(expected2));
}
+
+ private String canonicalize(final String out) {
+ return out.replaceAll("\r\n", "\n");
+ }
+
+ private String canonicalize(final StringWriter out) {
+ return canonicalize(out.toString());
+ }
+
@Test
public void saveReferencedObject() throws Exception {
@@ -173,7 +182,7 @@ public class ObjectFixtureFilePersistorTest {
final StringWriter out = new StringWriter();
persistor.save(objects, out);
- final String actual = out.toString().replaceAll("\r\n", "\n");
+ final String actual = canonicalize(out);
final String expected1 = ReferencingEntity.class.getName() + "#2\n aggregatedEntities: \n aggregatedReference: \n reference: " + SimpleEntity.class.getName() + "#3";
final String expected2 = SimpleEntity.class.getName() + "#3\n date: 08-Mar-2010 01:00 UTC\n name: Fred Smith\n";
@@ -196,7 +205,7 @@ public class ObjectFixtureFilePersistorTest {
final StringWriter out = new StringWriter();
persistor.save(objects, out);
- final String actual = out.toString().replaceAll("\r\n", "\n");
+ final String actual = canonicalize(out);
final String expected1a = ParentEntity.class.getName() + "#2\n";
final String expected1b = "heterogeneousCollection: \n homogeneousCollection: " + SimpleEntity.class.getName() + "#3 " + SimpleEntity.class.getName() + "#4 " + "\n";