From 245d241ff751aa248f9160b9162455dc3152d77a Mon Sep 17 00:00:00 2001 From: Nicki Watt Date: Tue, 9 Jul 2013 16:52:58 +0100 Subject: [PATCH] DATAGRAPH-330 : Added test(although ignored) to highlight scenario where current fix does not work - i.e. use of function in Sort.Order --- .../neo4j/repository/GraphRepositoryTests.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/GraphRepositoryTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/GraphRepositoryTests.java index 09db976d5..be49f00af 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/GraphRepositoryTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/GraphRepositoryTests.java @@ -17,6 +17,7 @@ package org.springframework.data.neo4j.repository; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; @@ -157,6 +158,20 @@ public class GraphRepositoryTests { assertEquals(asList(testTeam.david, testTeam.emil, testTeam.michael), asCollection(allPersons)); } + @Test + @Ignore + public void findAllSortedWithFunction() { + + // The case below does not fit into the general sorting and paging fix and will fail, you need to + // know what the prefix is (person in this case) and provide it in order to make + // use i.e. the following would work, but requires internal impl knowledge which is not good + // Sort sort = new Sort(Sort.Direction.ASC, "lower(person.name)"); + Sort sort = new Sort(Sort.Direction.ASC, "lower(name)"); + + Iterable allPersons = personRepository.findAll(sort); + assertEquals(asList(testTeam.david, testTeam.emil, testTeam.michael), asCollection(allPersons)); + } + @Test public void findAllSortedDescending() { Sort sort = new Sort(Sort.Direction.DESC, "name");