Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.DefaultSortParameters


    assertArrayEquals(new String[] { "STORE", "storelist" }, convertByteArrays(sort));
  }

  @Test
  public void testSortWithAllParams() {
    SortParameters sortParams = new DefaultSortParameters().alpha().asc().by("weight_*".getBytes())
        .get("object_*".getBytes()).limit(0, 5);
    byte[] sort = SrpUtils.sort(sortParams, "foo".getBytes());
    assertEquals("BY weight_* LIMIT 0 5 GET object_* ASC ALPHA STORE foo", new String(sort));
  }
View Full Code Here


    assertEquals("BY weight_* LIMIT 0 5 GET object_* ASC ALPHA STORE foo", new String(sort));
  }

  @Test
  public void testSortOnlyBy() {
    SortParameters sortParams = new DefaultSortParameters().numeric().by("weight_*".getBytes());
    byte[] sort = SrpUtils.sort(sortParams);
    assertEquals("BY weight_*", new String(sort));
  }
View Full Code Here

    assertEquals("BY weight_*", new String(sort));
  }

  @Test
  public void testSortOnlyLimit() {
    SortParameters sortParams = new DefaultSortParameters().numeric().limit(0, 5);
    byte[] sort = SrpUtils.sort(sortParams);
    assertEquals("LIMIT 0 5", new String(sort));
  }
View Full Code Here

    assertEquals("LIMIT 0 5", new String(sort));
  }

  @Test
  public void testSortOnlyGetPatterns() {
    SortParameters sortParams = new DefaultSortParameters().numeric().get("foo".getBytes()).get("bar".getBytes());
    byte[] sort = SrpUtils.sort(sortParams);
    assertEquals("GET foo GET bar", new String(sort));
  }
View Full Code Here

    assertEquals("GET foo GET bar", new String(sort));
  }

  @Test
  public void testSortOnlyOrder() {
    SortParameters sortParams = new DefaultSortParameters().numeric().desc();
    byte[] sort = SrpUtils.sort(sortParams);
    assertEquals("DESC", new String(sort));
  }
View Full Code Here

    assertEquals("DESC", new String(sort));
  }

  @Test
  public void testSortOnlyAlpha() {
    SortParameters sortParams = new DefaultSortParameters().alpha();
    byte[] sort = SrpUtils.sort(sortParams);
    assertEquals("ALPHA", new String(sort));
  }
View Full Code Here

    assertEquals("ALPHA", new String(sort));
  }

  @Test
  public void testSortOnlyStore() {
    SortParameters sortParams = new DefaultSortParameters().numeric();
    byte[] sort = SrpUtils.sort(sortParams, "storelist".getBytes());
    assertEquals("STORE storelist", new String(sort));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.connection.DefaultSortParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.