Package org.apache.sling.query.selector.parser

Examples of org.apache.sling.query.selector.parser.SelectorSegment


    Assert.assertEquals(Arrays.asList(pp("key", "value")), selector.getAttributes());
  }

  @Test
  public void parseProperties() {
    SelectorSegment selector = getFirstSegment("[key=value][key2=value2]");
    Assert.assertEquals(Arrays.asList(pp("key", "value"), pp("key2", "value2")), selector.getAttributes());
  }
View Full Code Here


    Assert.assertEquals(Arrays.asList(pp("key", "value"), pp("key2", "value2")), selector.getAttributes());
  }

  @Test
  public void parseResourceTypeAndName() {
    SelectorSegment selector = getFirstSegment("my/resource/type#some-name");
    Assert.assertEquals("my/resource/type", selector.getType());
    Assert.assertEquals("some-name", selector.getName());
  }
View Full Code Here

    Assert.assertEquals("some-name", selector.getName());
  }

  @Test
  public void parseResourceTypeAndProperty() {
    SelectorSegment selector = getFirstSegment("my/resource/type[key=value]");
    Assert.assertEquals(Arrays.asList(pp("key", "value")), selector.getAttributes());
    Assert.assertEquals("my/resource/type", selector.getType());
  }
View Full Code Here

    Assert.assertEquals("my/resource/type", selector.getType());
  }

  @Test
  public void parseResourceTypeAndNameAndProperty() {
    SelectorSegment selector = getFirstSegment("my/resource/type#some-name[key=value]");
    Assert.assertEquals(Arrays.asList(pp("key", "value")), selector.getAttributes());
    Assert.assertEquals("my/resource/type", selector.getType());
    Assert.assertEquals("some-name", selector.getName());
  }
View Full Code Here

    Assert.assertEquals("some-name", selector.getName());
  }

  @Test
  public void parseResourceTypeAndProperties() {
    SelectorSegment selector = getFirstSegment("my/resource/type[key=value][key2=value2]");
    Assert.assertEquals(Arrays.asList(pp("key", "value"), pp("key2", "value2")), selector.getAttributes());
    Assert.assertEquals("my/resource/type", selector.getType());
  }
View Full Code Here

    Assert.assertEquals("my/resource/type", selector.getType());
  }

  @Test
  public void parseResourceTypeAndNameAndProperties() {
    SelectorSegment selector = getFirstSegment("my/resource/type#some-name[key=value][key2=value2]");
    Assert.assertEquals(Arrays.asList(pp("key", "value"), pp("key2", "value2")), selector.getAttributes());
    Assert.assertEquals("my/resource/type", selector.getType());
    Assert.assertEquals("some-name", selector.getName());
  }
View Full Code Here

    Assert.assertEquals("some-name", selector.getName());
  }

  @Test
  public void parseFunction() {
    SelectorSegment selector = getFirstSegment(":eq(12)");
    Assert.assertEquals(Arrays.asList(f("eq", "12")), selector.getModifiers());
  }
View Full Code Here

TOP

Related Classes of org.apache.sling.query.selector.parser.SelectorSegment

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.