Search in sources :

Example 1 with HealthCheckSelector

use of org.apache.sling.hc.api.execution.HealthCheckSelector in project sling by apache.

the class HealthCheckFilterTest method testWithTwoTagsExcludeOne.

@Test
public void testWithTwoTagsExcludeOne() {
    HealthCheckSelector selector = tags("foo", "bar").withTags("-baz");
    assertStrEquals("(&(objectClass=org.apache.sling.hc.api.HealthCheck)(!(hc.tags=baz))(hc.tags=foo)(hc.tags=bar))", filter.getServiceFilter(selector, false));
}
Also used : HealthCheckSelector(org.apache.sling.hc.api.execution.HealthCheckSelector) Test(org.junit.Test)

Example 2 with HealthCheckSelector

use of org.apache.sling.hc.api.execution.HealthCheckSelector in project sling by apache.

the class HealthCheckFilterTest method testWithTwoOrTagsAndTwoNames.

@Test
public void testWithTwoOrTagsAndTwoNames() {
    HealthCheckSelector selector = empty().withNames("foo", "bar").withTags("t1", "t2");
    assertStrEquals("(&(objectClass=org.apache.sling.hc.api.HealthCheck)(|(hc.tags=t1)(hc.tags=t2)(hc.name=foo)(hc.name=bar)))", filter.getServiceFilter(selector, true));
}
Also used : HealthCheckSelector(org.apache.sling.hc.api.execution.HealthCheckSelector) Test(org.junit.Test)

Example 3 with HealthCheckSelector

use of org.apache.sling.hc.api.execution.HealthCheckSelector in project sling by apache.

the class HealthCheckFilterTest method testWithOneName.

@Test
public void testWithOneName() {
    HealthCheckSelector selector = names("foo");
    assertStrEquals("(&(objectClass=org.apache.sling.hc.api.HealthCheck)(|(hc.name=foo)))", filter.getServiceFilter(selector, false));
}
Also used : HealthCheckSelector(org.apache.sling.hc.api.execution.HealthCheckSelector) Test(org.junit.Test)

Example 4 with HealthCheckSelector

use of org.apache.sling.hc.api.execution.HealthCheckSelector in project sling by apache.

the class HealthCheckFilterTest method testWithTwoTags.

@Test
public void testWithTwoTags() {
    HealthCheckSelector selector = tags("foo", "bar");
    assertStrEquals("(&(objectClass=org.apache.sling.hc.api.HealthCheck)(hc.tags=foo)(hc.tags=bar))", filter.getServiceFilter(selector, false));
}
Also used : HealthCheckSelector(org.apache.sling.hc.api.execution.HealthCheckSelector) Test(org.junit.Test)

Example 5 with HealthCheckSelector

use of org.apache.sling.hc.api.execution.HealthCheckSelector in project sling by apache.

the class HealthCheckFilterTest method testWithOneTag.

@Test
public void testWithOneTag() {
    HealthCheckSelector selector = tags("foo");
    assertStrEquals("(&(objectClass=org.apache.sling.hc.api.HealthCheck)(hc.tags=foo))", filter.getServiceFilter(selector, false));
}
Also used : HealthCheckSelector(org.apache.sling.hc.api.execution.HealthCheckSelector) Test(org.junit.Test)

Aggregations

HealthCheckSelector (org.apache.sling.hc.api.execution.HealthCheckSelector)14 Test (org.junit.Test)13 Result (org.apache.sling.hc.api.Result)4 HealthCheckExecutionResult (org.apache.sling.hc.api.execution.HealthCheckExecutionResult)4 ServiceReference (org.osgi.framework.ServiceReference)3 HealthCheckExecutionOptions (org.apache.sling.hc.api.execution.HealthCheckExecutionOptions)2 ExecutionResult (org.apache.sling.hc.core.impl.executor.ExecutionResult)2 HealthCheckFilter (org.apache.sling.hc.util.HealthCheckFilter)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 ObjectName (javax.management.ObjectName)1 Status (org.apache.sling.hc.api.Result.Status)1 ExtendedHealthCheckExecutor (org.apache.sling.hc.core.impl.executor.ExtendedHealthCheckExecutor)1 HealthCheckMetadata (org.apache.sling.hc.util.HealthCheckMetadata)1 Bundle (org.osgi.framework.Bundle)1