コード例 #1
0
 private PropertyDto findById(List<PropertyDto> properties, int id) {
   for (PropertyDto property : properties) {
     if (property.getId() == id) {
       return property;
     }
   }
   return null;
 }
コード例 #2
0
  @Test
  public void selectProjectProperties() {
    setupData("selectProjectProperties");
    List<PropertyDto> properties = dao.selectProjectProperties("org.struts:struts");
    assertThat(properties.size(), is(1));

    PropertyDto first = properties.get(0);
    assertThat(first.getKey(), is("struts.one"));
    assertThat(first.getValue(), is("one"));
  }
コード例 #3
0
  @Test
  public void selectGlobalProperties() {
    setupData("selectGlobalProperties");
    List<PropertyDto> properties = dao.selectGlobalProperties();
    assertThat(properties.size(), is(2));

    PropertyDto first = findById(properties, 1);
    assertThat(first.getKey(), is("global.one"));
    assertThat(first.getValue(), is("one"));

    PropertyDto second = findById(properties, 2);
    assertThat(second.getKey(), is("global.two"));
    assertThat(second.getValue(), is("two"));
  }
コード例 #4
0
 private Integer getJmsBrokerPort() {
   PropertyDto properties = configurationAccess.getProperties();
   Integer jmsBrokerPort = properties.getJmsBrokerPort();
   return jmsBrokerPort;
 }
コード例 #5
0
 private String getJmsBrokerHost() {
   PropertyDto properties = configurationAccess.getProperties();
   String jmsBrokerHost = properties.getJmsBrokerHost();
   return jmsBrokerHost;
 }