use of cern.c2mon.shared.client.configuration.api.tag.DataTag in project c2mon by c2mon.
the class TagConfigStrategyTest method toTagConfigurationWithTagNameShouldHaveName.
@Test
void toTagConfigurationWithTagNameShouldHaveName() throws DynConfigException {
DataTag tag = getDataTag("publicationName=1&tagName=1");
assertEquals("1", tag.getName());
}
use of cern.c2mon.shared.client.configuration.api.tag.DataTag in project c2mon by c2mon.
the class TagConfigStrategyTest method toTagConfigurationWithoutTagDescriptionShouldResortToDefault.
@Test
void toTagConfigurationWithoutTagDescriptionShouldResortToDefault() throws DynConfigException {
DataTag tag = getDataTag("publicationName=1&tagName=1");
assertEquals("dynamically configured tag", tag.getDescription());
}
use of cern.c2mon.shared.client.configuration.api.tag.DataTag in project c2mon by c2mon.
the class TagConfigStrategyTest method toTagConfigurationWithNonStandardAddressParameterShouldBeSet.
@Test
void toTagConfigurationWithNonStandardAddressParameterShouldBeSet() throws DynConfigException {
DataTag tag = getDataTag("publicationName=1&tagName=1&setTimeToLive=67");
assertEquals(67, tag.getAddress().getTimeToLive());
}
use of cern.c2mon.shared.client.configuration.api.tag.DataTag in project c2mon by c2mon.
the class TagConfigStrategyTest method toTagConfigurationWithoutTagNameShouldResortToDefault.
@Test
void toTagConfigurationWithoutTagNameShouldResortToDefault() throws DynConfigException {
URI uri = URI.create("dip://host/path?publicationName=1");
strategy = ITagConfigStrategy.of(uri);
DataTag dt = strategy.prepareDataTagConfigurations();
assertEquals(uri.toASCIIString(), dt.getName());
}
use of cern.c2mon.shared.client.configuration.api.tag.DataTag in project c2mon by c2mon.
the class TagConfigStrategy method toTagConfiguration.
protected DataTag toTagConfiguration(HardwareAddress hwAddress) throws DynConfigException {
DataTagAddress address = new DataTagAddress(hwAddress);
queryObj.applyQueryPropertiesTo(address);
DataTag.CreateBuilder builder = DataTag.create(queryObj.get(TAG_NAME).get(0), queryObj.get(DATA_TYPE, Class.class).get(0), address).description(StringUtils.join(queryObj.get(TAG_DESCRIPTION), ", "));
queryObj.applyQueryPropertiesTo(builder);
return builder.build();
}
Aggregations