From 551a7b41125fba4a3603c9367e9bb1c7013bd310 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 5 Jan 2015 16:29:27 +0100 Subject: SONAR-5753 Save empty string instead of null for root projects --- .../org/sonar/batch/index/DefaultResourcePersisterTest.java | 10 +++++----- .../shouldRemoveRootIndexIfResourceIsProject-result.xml | 2 +- .../shouldUpdateExistingResource-result.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sonar-batch/src/test') diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java index 23ad3689cf6..7f54b3d5ebb 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java @@ -122,7 +122,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { assertThat(newProject.uuid()).isNotNull(); assertThat(newProject.projectUuid()).isEqualTo(newProject.uuid()); assertThat(newProject.moduleUuid()).isNull(); - assertThat(newProject.moduleUuidPath()).isNull(); + assertThat(newProject.moduleUuidPath()).isEqualTo(""); // SONAR-3636 : created_at must be fed when inserting a new entry in the 'projects' table assertThat(newProject.getCreatedAt()).isNotNull(); } finally { @@ -147,7 +147,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { assertThat(newProject.uuid()).isNotNull(); assertThat(newProject.projectUuid()).isEqualTo(newProject.uuid()); assertThat(newProject.moduleUuid()).isNull(); - assertThat(newProject.moduleUuidPath()).isNull(); + assertThat(newProject.moduleUuidPath()).isEqualTo(""); } finally { MyBatis.closeQuietly(session); } @@ -183,7 +183,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { assertThat(root.uuid()).isNotNull(); assertThat(root.projectUuid()).isEqualTo(root.uuid()); assertThat(root.moduleUuid()).isNull(); - assertThat(root.moduleUuidPath()).isNull(); + assertThat(root.moduleUuidPath()).isEqualTo(""); ComponentDto a = session.getMapper(ComponentMapper.class).selectByKey("a"); assertThat(a.uuid()).isNotNull(); assertThat(a.projectUuid()).isEqualTo(root.uuid()); @@ -262,7 +262,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { assertThat(root.uuid()).isNotNull(); assertThat(root.projectUuid()).isEqualTo(root.uuid()); assertThat(root.moduleUuid()).isNull(); - assertThat(root.moduleUuidPath()).isNull(); + assertThat(root.moduleUuidPath()).isEqualTo(""); ComponentDto a = session.getMapper(ComponentMapper.class).selectByKey("a"); System.out.println("A: " + a.uuid()); assertThat(a.uuid()).isNotNull(); @@ -355,7 +355,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { assertThat(newLib.uuid()).isNotNull(); assertThat(newLib.projectUuid()).isEqualTo(newLib.uuid()); assertThat(newLib.moduleUuid()).isNull(); - assertThat(newLib.moduleUuidPath()).isNull(); + assertThat(newLib.moduleUuidPath()).isEqualTo(""); } finally { MyBatis.closeQuietly(session); } diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject-result.xml index f36a8e48f96..283baaf3dde 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject-result.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject-result.xml @@ -1,6 +1,6 @@ - diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource-result.xml index cca8b5570dc..d04674f42b8 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource-result.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource-result.xml @@ -1,6 +1,6 @@ - -- cgit v1.2.3