Search in sources :

Example 1 with DataTag

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());
}
Also used : DataTag(cern.c2mon.shared.client.configuration.api.tag.DataTag) Test(org.junit.jupiter.api.Test)

Example 2 with DataTag

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());
}
Also used : DataTag(cern.c2mon.shared.client.configuration.api.tag.DataTag) Test(org.junit.jupiter.api.Test)

Example 3 with DataTag

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());
}
Also used : DataTag(cern.c2mon.shared.client.configuration.api.tag.DataTag) Test(org.junit.jupiter.api.Test)

Example 4 with DataTag

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());
}
Also used : URI(java.net.URI) DataTag(cern.c2mon.shared.client.configuration.api.tag.DataTag) Test(org.junit.jupiter.api.Test)

Example 5 with DataTag

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();
}
Also used : DataTagAddress(cern.c2mon.shared.common.datatag.DataTagAddress) DataTag(cern.c2mon.shared.client.configuration.api.tag.DataTag)

Aggregations

DataTag (cern.c2mon.shared.client.configuration.api.tag.DataTag)36 Configuration (cern.c2mon.shared.client.configuration.api.Configuration)23 ConfigurationDataTagUtil.buildCreateBasicDataTag (cern.c2mon.server.configuration.parser.util.ConfigurationDataTagUtil.buildCreateBasicDataTag)19 Test (org.junit.Test)19 ConfigurationDataTagUtil.buildCreateAllFieldsDataTag (cern.c2mon.server.configuration.parser.util.ConfigurationDataTagUtil.buildCreateAllFieldsDataTag)17 ContextConfiguration (org.springframework.test.context.ContextConfiguration)17 Properties (java.util.Properties)16 ConfigurationElement (cern.c2mon.shared.client.configuration.ConfigurationElement)14 Tag (cern.c2mon.shared.client.configuration.api.tag.Tag)14 DataTagAddress (cern.c2mon.shared.common.datatag.DataTagAddress)9 Metadata (cern.c2mon.shared.client.metadata.Metadata)8 Test (org.junit.jupiter.api.Test)6 ConfigurationEquipmentUtil.buildCreateBasicEquipment (cern.c2mon.server.configuration.parser.util.ConfigurationEquipmentUtil.buildCreateBasicEquipment)2 ConfigurationProcessUtil.buildCreateBasicProcess (cern.c2mon.server.configuration.parser.util.ConfigurationProcessUtil.buildCreateBasicProcess)2 ConfigurationSubEquipmentUtil.buildCreateBasicSubEquipment (cern.c2mon.server.configuration.parser.util.ConfigurationSubEquipmentUtil.buildCreateBasicSubEquipment)2 Equipment (cern.c2mon.shared.client.configuration.api.equipment.Equipment)2 SubEquipment (cern.c2mon.shared.client.configuration.api.equipment.SubEquipment)2 Process (cern.c2mon.shared.client.configuration.api.process.Process)2 CommandTag (cern.c2mon.shared.client.configuration.api.tag.CommandTag)2 ConfigurationEntity (cern.c2mon.shared.client.configuration.api.util.ConfigurationEntity)2