package org.openecomp.policy.drools.healthcheck;
-import java.util.Properties;
-
import org.openecomp.policy.drools.features.PolicyEngineFeatureAPI;
import org.openecomp.policy.drools.system.PolicyEngine;
+/**
+ * This feature provides healthcheck verification of remotely associated RESTful components
+ */
public class HealthCheckFeature implements PolicyEngineFeatureAPI {
- public static final String CONFIGURATION_PROPERTIES_NAME = "policy-healthcheck";
-
/**
- * {@inheritDoc}
+ * Properties Configuration Name
*/
+ public static final String CONFIGURATION_PROPERTIES_NAME = "policy-healthcheck";
+
@Override
public int getSequenceNumber() {
return 1000;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeStart(PolicyEngine engine) throws IllegalStateException {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
@Override
public boolean afterStart(PolicyEngine engine) {
try {
return false;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeShutdown(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
@Override
public boolean afterShutdown(PolicyEngine engine) {
try {
return false;
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeConfigure(PolicyEngine engine, Properties properties) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterConfigure(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeActivate(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterActivate(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeDeactivate(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterDeactivate(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeStop(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterStop(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeLock(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterLock(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeUnlock(PolicyEngine engine) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterUnlock(PolicyEngine engine) {
- return false;
- }
/**
* gets the monitor
import java.util.Properties;
+import org.openecomp.policy.drools.event.comm.Topic.CommInfrastructure;
import org.openecomp.policy.drools.system.PolicyController;
import org.openecomp.policy.drools.utils.OrderedService;
import org.openecomp.policy.drools.utils.OrderedServiceImpl;
* 'null' indicates that no take over has taken place, and processing should
* continue to the next feature provider.
*/
- public PolicyController beforeCreate(String name, Properties properties);
+ public default PolicyController beforeCreate(String name, Properties properties) {return null;}
/**
* called after creating a controller with name 'name'
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterCreate(PolicyController controller);
+ public default boolean afterCreate(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is started.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean beforeStart(PolicyController controller) {return false;}
+
+ /**
+ * intercept after the Policy Controller is started.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterStart(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is stopped.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public default boolean beforeStop(PolicyController controller) {return false;}
+
+ /**
+ * intercept after the Policy Controller is stopped
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.d.
+ */
+ public default boolean afterStop(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean beforeLock(PolicyController controller) {return false;}
+
+ /**
+ * intercept after the Policy Controller is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public default boolean afterLock(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean beforeUnlock(PolicyController controller) {return false;}
+
+ /**
+ * intercept after the Policy Controller is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterUnlock(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is shut down
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public default boolean beforeShutdown(PolicyController controller) {return false;}
+
+ /**
+ * called after the Policy Controller is shut down
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterShutdown(PolicyController controller) {return false;}
+
+ /**
+ * intercept before the Policy Controller is halted
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public default boolean beforeHalt(PolicyController controller) {return false;}
+
+ /**
+ * called after the Policy Controller is halted
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterHalt(PolicyController controller) {return false;}
+
+
+ /**
+ * intercept before the Policy Controller is offered an event
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean beforeOffer(PolicyController controller,
+ CommInfrastructure protocol,
+ String topic,
+ String event) {return false;}
+
+ /**
+ * called after the Policy Controller processes an event offer
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterOffer(PolicyController controller,
+ CommInfrastructure protocol,
+ String topic,
+ String event,
+ boolean success) {return false;}
+
+ /**
+ * intercept before the Policy Controller delivers (posts) an event
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean beforeDeliver(PolicyController controller,
+ CommInfrastructure protocol,
+ String topic,
+ Object event) {return false;}
+
+ /**
+ * called after the Policy Controller delivers (posts) an event
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public default boolean afterDeliver(PolicyController controller,
+ CommInfrastructure protocol,
+ String topic,
+ Object event,
+ boolean success) {return false;}
+
/**
* Feature providers implementing this interface
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeConfigure(PolicyEngine engine, Properties properties);
+ public default boolean beforeConfigure(PolicyEngine engine, Properties properties) {return false;};
/**
* intercept after the Policy Engine is configured.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterConfigure(PolicyEngine engine);
+ public default boolean afterConfigure(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine goes active.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeActivate(PolicyEngine engine);
+ public default boolean beforeActivate(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine goes active.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterActivate(PolicyEngine engine);
+ public default boolean afterActivate(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine goes standby.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeDeactivate(PolicyEngine engine);
+ public default boolean beforeDeactivate(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine goes standby.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterDeactivate(PolicyEngine engine);
+ public default boolean afterDeactivate(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine is started.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeStart(PolicyEngine engine);
+ public default boolean beforeStart(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine is started.
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterStart(PolicyEngine engine);
+ public default boolean afterStart(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine is stopped.
* of the operation preventing the invocation of
* lower priority features. False, otherwise..
*/
- public boolean beforeStop(PolicyEngine engine);
+ public default boolean beforeStop(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine is stopped
* of the operation preventing the invocation of
* lower priority features. False, otherwise.d.
*/
- public boolean afterStop(PolicyEngine engine);
+ public default boolean afterStop(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine is locked
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeLock(PolicyEngine engine);
+ public default boolean beforeLock(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine is locked
* of the operation preventing the invocation of
* lower priority features. False, otherwise..
*/
- public boolean afterLock(PolicyEngine engine);
+ public default boolean afterLock(PolicyEngine engine) {return false;};
/**
* intercept before the Policy Engine is locked
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean beforeUnlock(PolicyEngine engine);
+ public default boolean beforeUnlock(PolicyEngine engine) {return false;};
/**
* intercept after the Policy Engine is locked
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterUnlock(PolicyEngine engine);
+ public default boolean afterUnlock(PolicyEngine engine) {return false;};
/**
* intercept the Policy Engine is shut down
* of the operation preventing the invocation of
* lower priority features. False, otherwise..
*/
- public boolean beforeShutdown(PolicyEngine engine);
+ public default boolean beforeShutdown(PolicyEngine engine){return false;};
/**
* called after the Policy Engine is shut down
* of the operation preventing the invocation of
* lower priority features. False, otherwise.
*/
- public boolean afterShutdown(PolicyEngine engine);
+ public default boolean afterShutdown(PolicyEngine engine) {return false;};
/**
* Feature providers implementing this interface
import org.openecomp.policy.drools.event.comm.TopicListener;
import org.openecomp.policy.drools.event.comm.TopicSink;
import org.openecomp.policy.drools.event.comm.TopicSource;
+import org.openecomp.policy.drools.features.PolicyControllerFeatureAPI;
import org.openecomp.policy.drools.persistence.SystemPersistence;
import org.openecomp.policy.drools.properties.PolicyProperties;
import org.openecomp.policy.drools.protocol.configuration.DroolsConfiguration;
*/
@Override
public boolean start() throws IllegalStateException {
+
if (logger.isInfoEnabled())
- logger.info("START: " + this);
+ logger.info("START: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeStart(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
if (this.isLocked())
throw new IllegalStateException("Policy Controller " + name + " is locked");
}
}
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterStart(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
return success;
}
@Override
public boolean stop() {
- logger.info("STOP: " + this);
+ if (logger.isInfoEnabled())
+ logger.info("STOP: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeStop(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
/* stop regardless locked state */
}
boolean success = this.droolsController.stop();
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterStop(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
return success;
}
@Override
public void shutdown() throws IllegalStateException {
if (logger.isInfoEnabled())
- logger.info(this + "SHUTDOWN");
+ logger.info("SHUTDOWN: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeShutdown(this))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
this.stop();
DroolsController.factory.shutdown(this.droolsController);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterShutdown(this))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
}
/**
@Override
public void halt() throws IllegalStateException {
if (logger.isInfoEnabled())
- logger.info(this + "HALT");
+ logger.info("HALT: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeHalt(this))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
this.stop();
DroolsController.factory.destroy(this.droolsController);
SystemPersistence.manager.deleteController(this.name);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterHalt(this))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
}
/**
public void onTopicEvent(Topic.CommInfrastructure commType,
String topic, String event) {
- logger.info("EVENT NOTIFICATION: " + commType + ":" + topic + ":" + event + " INTO " + this);
+ if (logger.isDebugEnabled())
+ logger.debug("EVENT NOTIFICATION: " + commType + ":" + topic + ":" + event + " INTO " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeOffer(this, commType, topic, event))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
if (this.locked)
return;
if (!this.alive)
return;
- this.droolsController.offer(topic, event);
+ boolean success = this.droolsController.offer(topic, event);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterOffer(this, commType, topic, event, success))
+ return;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
}
/**
throws IllegalArgumentException, IllegalStateException,
UnsupportedOperationException {
- logger.info("DELIVER: " + commType + ":" + topic + ":" + event + " FROM " + this);
+ if (logger.isDebugEnabled())
+ logger.debug("DELIVER: " + commType + ":" + topic + ":" + event + " FROM " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeDeliver(this, commType, topic, event))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
if (topic == null || topic.isEmpty())
throw new IllegalArgumentException("Invalid Topic");
("Unsuported topic " + topic + " for delivery");
}
- return this.droolsController.deliver
- (this.topic2Sinks.get(topic), event);
+ boolean success = this.droolsController.deliver(this.topic2Sinks.get(topic), event);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterDeliver(this, commType, topic, event, success))
+ return success;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
+ return success;
}
/**
*/
@Override
public boolean lock() {
- logger.info("LOCK: " + this);
+ if (logger.isInfoEnabled())
+ logger.info("LOCK: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeLock(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
synchronized(this) {
if (this.locked)
// it does not affect associated sources/sinks, they are
// autonomous entities
- return this.droolsController.lock();
+ boolean success = this.droolsController.lock();
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterLock(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
+ return success;
}
/**
*/
@Override
public boolean unlock() {
- logger.info("UNLOCK: " + this);
+
+ if (logger.isInfoEnabled())
+ logger.info("UNLOCK: " + this);
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeUnlock(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
synchronized(this) {
if (!this.locked)
this.locked = false;
}
- return this.droolsController.unlock();
+ boolean success = this.droolsController.unlock();
+
+ for (PolicyControllerFeatureAPI feature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterUnlock(this))
+ return true;
+ } catch (Exception e) {
+ logger.warn("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
+ return success;
}
/**
PolicyEngine.manager.lock();
return false;
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeStart(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeShutdown(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterShutdown(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeConfigure(PolicyEngine engine, Properties properties) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterConfigure(PolicyEngine engine) {return false;}
/**
* {@inheritDoc}
return(false);
}
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterActivate(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeDeactivate(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterDeactivate(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeStop(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterStop(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeLock(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterLock(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean beforeUnlock(PolicyEngine engine) {return false;}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean afterUnlock(PolicyEngine engine) {return false;}
-
/**************************/
/**
* @param clazz the class object associated with 'T' (I supposed it could
* be a subclass, but I'm not sure this is useful)
*/
- public OrderedServiceImpl(Class clazz)
+ public OrderedServiceImpl(Class<T> clazz)
{
// This constructor wouldn't be needed if 'T.class' was legal
serviceLoader = ServiceLoader.load(clazz);
* @return the sorted list of services implementing interface 'T' discovered
* by 'ServiceLoader'.
*/
+ @SuppressWarnings("unchecked")
public synchronized List<T> rebuildList()
{
// build a list of all of the current implementors
}
// use this to ensure that we only use one unique instance of each class
+ @SuppressWarnings("rawtypes")
static private HashMap<Class,OrderedService> classToSingleton =
new HashMap<>();
package org.openecomp.policy.drools.utils;
-import static org.junit.Assert.*;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileOutputStream;
import java.util.TreeSet;
import java.util.UUID;
-import org.apache.log4j.Logger;
-
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.openecomp.policy.common.logging.eelf.PolicyLogger;
public class PropertyUtilTest
assertEquals(prop2, returns[0]);
// verify that we have the expected set of keys
- assertEquals(new TreeSet(Arrays.asList(new String[]{"p1", "p2", "p4"})),
+ assertEquals(new TreeSet<String>(Arrays.asList(new String[]{"p1", "p2", "p4"})),
returns[1]);
}
}