Merge branch 'master' into Rollout_migrate_table_to_grid_final
Signed-off-by: asharani-murugesh <asharani.murugesh@in.bosch.com>
This commit is contained in:
@@ -9,14 +9,12 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.client;
|
package org.eclipse.hawkbit.mgmt.client;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration bean which holds the configuration of the client e.g. the base
|
* Configuration bean which holds the configuration of the client e.g. the base
|
||||||
* URL of the hawkbit-server and the credentials to use the RESTful Management
|
* URL of the hawkbit-server and the credentials to use the RESTful Management
|
||||||
* API.
|
* API.
|
||||||
*/
|
*/
|
||||||
@Component
|
|
||||||
@ConfigurationProperties(prefix = "hawkbit")
|
@ConfigurationProperties(prefix = "hawkbit")
|
||||||
public class ClientConfigurationProperties {
|
public class ClientConfigurationProperties {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
<!-- Copyright (c) 2015 Bosch Software Innovations GmbH and others. All rights reserved. This program and the accompanying
|
|
||||||
materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and
|
|
||||||
is available at http://www.eclipse.org/legal/epl-v10.html -->
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public class BaseAmqpService {
|
|||||||
* @return the converted object
|
* @return the converted object
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected <T> T convertMessage(final Message message, final Class<T> clazz) {
|
public <T> T convertMessage(final Message message, final Class<T> clazz) {
|
||||||
if (message == null) {
|
if (message == null || message.getBody() == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
|
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
|
||||||
@@ -78,8 +78,8 @@ public class BaseAmqpService {
|
|||||||
* @return the list of converted objects
|
* @return the list of converted objects
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected <T> List<T> convertMessageList(final Message message, final Class<T> clazz) {
|
public <T> List<T> convertMessageList(final Message message, final Class<T> clazz) {
|
||||||
if (message == null) {
|
if (message == null || message.getBody() == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
|
message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
|
||||||
@@ -99,6 +99,7 @@ public class BaseAmqpService {
|
|||||||
final Object value = header.get(key);
|
final Object value = header.get(key);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
logAndThrowMessageError(message, errorMessageIfNull);
|
logAndThrowMessageError(message, errorMessageIfNull);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return value.toString();
|
return value.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ public class AmqpMessageHandlerServiceTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@Description("Tests not allowed content-type in message")
|
@Description("Tests not allowed content-type in message")
|
||||||
public void testWrongContentType() {
|
public void testWrongContentType() {
|
||||||
final MessageProperties messageProperties = new MessageProperties();
|
final MessageProperties messageProperties = new MessageProperties();
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
package org.eclipse.hawkbit.amqp;
|
||||||
|
|
||||||
|
import static org.fest.assertions.api.Assertions.assertThat;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.dmf.json.model.ActionUpdateStatus;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.core.MessageProperties;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
|
|
||||||
|
import ru.yandex.qatools.allure.annotations.Description;
|
||||||
|
import ru.yandex.qatools.allure.annotations.Features;
|
||||||
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
@Features("Component Tests - Device Management Federation API")
|
||||||
|
@Stories("Base Amqp Service Test")
|
||||||
|
public class BaseAmqpServiceTest {
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
private BaseAmqpService baseAmqpService;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
when(rabbitTemplate.getMessageConverter()).thenReturn(new Jackson2JsonMessageConverter());
|
||||||
|
baseAmqpService = new BaseAmqpService(rabbitTemplate);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Verify that the message conversion works")
|
||||||
|
public void convertMessageTest() {
|
||||||
|
final ActionUpdateStatus actionUpdateStatus = new ActionUpdateStatus();
|
||||||
|
actionUpdateStatus.setActionId(1L);
|
||||||
|
actionUpdateStatus.setSoftwareModuleId(2L);
|
||||||
|
|
||||||
|
final Message message = rabbitTemplate.getMessageConverter().toMessage(actionUpdateStatus,
|
||||||
|
new MessageProperties());
|
||||||
|
ActionUpdateStatus convertedActionUpdateStatus = baseAmqpService.convertMessage(message,
|
||||||
|
ActionUpdateStatus.class);
|
||||||
|
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted Action Status is wrong")
|
||||||
|
.isEqualsToByComparingFields(actionUpdateStatus);
|
||||||
|
|
||||||
|
convertedActionUpdateStatus = baseAmqpService.convertMessage(null, ActionUpdateStatus.class);
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted Object should be null when message is null").isNull();
|
||||||
|
|
||||||
|
convertedActionUpdateStatus = baseAmqpService.convertMessage(new Message(null, new MessageProperties()),
|
||||||
|
ActionUpdateStatus.class);
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted Object should be null when message body is null")
|
||||||
|
.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Verify that a conversion of a list from a message works")
|
||||||
|
public void convertMessageListTest() {
|
||||||
|
final List<ActionUpdateStatus> actionUpdateStatusList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
final ActionUpdateStatus actionUpdateStatus = new ActionUpdateStatus();
|
||||||
|
actionUpdateStatus.setActionId(Long.valueOf(i));
|
||||||
|
actionUpdateStatus.setSoftwareModuleId(Long.valueOf(i));
|
||||||
|
actionUpdateStatusList.add(actionUpdateStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Message message = rabbitTemplate.getMessageConverter().toMessage(actionUpdateStatusList,
|
||||||
|
new MessageProperties());
|
||||||
|
List<ActionUpdateStatus> convertedActionUpdateStatus = baseAmqpService.convertMessageList(message,
|
||||||
|
ActionUpdateStatus.class);
|
||||||
|
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted Action Status list is wrong")
|
||||||
|
.hasSameClassAs(actionUpdateStatusList);
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted Action Status list is wrong")
|
||||||
|
.hasSameSizeAs(actionUpdateStatusList);
|
||||||
|
|
||||||
|
convertedActionUpdateStatus = baseAmqpService.convertMessageList(null, ActionUpdateStatus.class);
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted list should be empty when message is null").isEmpty();
|
||||||
|
|
||||||
|
convertedActionUpdateStatus = baseAmqpService.convertMessageList(new Message(null, new MessageProperties()),
|
||||||
|
ActionUpdateStatus.class);
|
||||||
|
assertThat(convertedActionUpdateStatus).as("Converted list should be empty when message body is null")
|
||||||
|
.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -50,7 +50,6 @@ import com.google.common.eventbus.Subscribe;
|
|||||||
|
|
||||||
import ru.yandex.qatools.allure.annotations.Description;
|
import ru.yandex.qatools.allure.annotations.Description;
|
||||||
import ru.yandex.qatools.allure.annotations.Features;
|
import ru.yandex.qatools.allure.annotations.Features;
|
||||||
import ru.yandex.qatools.allure.annotations.Issue;
|
|
||||||
import ru.yandex.qatools.allure.annotations.Stories;
|
import ru.yandex.qatools.allure.annotations.Stories;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -781,12 +780,13 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
targ = targetManagement.findTargetByControllerID(targ.getControllerId());
|
targ = targetManagement.findTargetByControllerID(targ.getControllerId());
|
||||||
|
|
||||||
assertEquals(0, deploymentManagement.findActiveActionsByTarget(targ).size());
|
assertEquals("active target actions are wrong", 0, deploymentManagement.findActiveActionsByTarget(targ).size());
|
||||||
assertEquals(1, deploymentManagement.findInActiveActionsByTarget(targ).size());
|
assertEquals("active actions are wrong", 1, deploymentManagement.findInActiveActionsByTarget(targ).size());
|
||||||
|
|
||||||
assertEquals(TargetUpdateStatus.IN_SYNC, targ.getTargetInfo().getUpdateStatus());
|
assertEquals("tagret update status is not correct", TargetUpdateStatus.IN_SYNC,
|
||||||
assertEquals(dsA, targ.getAssignedDistributionSet());
|
targ.getTargetInfo().getUpdateStatus());
|
||||||
assertEquals(dsA, targ.getTargetInfo().getInstalledDistributionSet());
|
assertEquals("wrong assigned ds", dsA, targ.getAssignedDistributionSet());
|
||||||
|
assertEquals("wrong installed ds", dsA, targ.getTargetInfo().getInstalledDistributionSet());
|
||||||
|
|
||||||
targs = deploymentManagement.assignDistributionSet(dsB.getId(), new String[] { "target-id-A" })
|
targs = deploymentManagement.assignDistributionSet(dsB.getId(), new String[] { "target-id-A" })
|
||||||
.getAssignedTargets();
|
.getAssignedTargets();
|
||||||
@@ -796,7 +796,7 @@ public class DeploymentManagementTest extends AbstractIntegrationTest {
|
|||||||
assertEquals("active actions are wrong", 1, deploymentManagement.findActiveActionsByTarget(targ).size());
|
assertEquals("active actions are wrong", 1, deploymentManagement.findActiveActionsByTarget(targ).size());
|
||||||
assertEquals("target status is wrong", TargetUpdateStatus.PENDING,
|
assertEquals("target status is wrong", TargetUpdateStatus.PENDING,
|
||||||
targetManagement.findTargetByControllerID(targ.getControllerId()).getTargetInfo().getUpdateStatus());
|
targetManagement.findTargetByControllerID(targ.getControllerId()).getTargetInfo().getUpdateStatus());
|
||||||
assertEquals(dsB, targ.getAssignedDistributionSet());
|
assertEquals("wrong assigned ds", dsB, targ.getAssignedDistributionSet());
|
||||||
assertEquals("Installed ds is wrong", dsA.getId(),
|
assertEquals("Installed ds is wrong", dsA.getId(),
|
||||||
targetManagement.findTargetByControllerIDWithDetails(targ.getControllerId()).getTargetInfo()
|
targetManagement.findTargetByControllerIDWithDetails(targ.getControllerId()).getTargetInfo()
|
||||||
.getInstalledDistributionSet().getId());
|
.getInstalledDistributionSet().getId());
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.repository;
|
|||||||
|
|
||||||
import static org.fest.assertions.api.Assertions.assertThat;
|
import static org.fest.assertions.api.Assertions.assertThat;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
|||||||
import org.eclipse.hawkbit.repository.model.Tag;
|
import org.eclipse.hawkbit.repository.model.Tag;
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -42,6 +44,11 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
LOG = LoggerFactory.getLogger(TagManagementTest.class);
|
LOG = LoggerFactory.getLogger(TagManagementTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
assertThat(targetTagRepository.findAll()).as("Not tags should be available").isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Full DS tag lifecycle tested. Create tags, assign them to sets and delete the tags.")
|
@Description("Full DS tag lifecycle tested. Create tags, assign them to sets and delete the tags.")
|
||||||
public void createAndAssignAndDeleteDistributionSetTags() {
|
public void createAndAssignAndDeleteDistributionSetTags() {
|
||||||
@@ -88,7 +95,7 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
// search for not deleted
|
// search for not deleted
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
||||||
.setTagNames(Lists.newArrayList(tagA.getName()));
|
.setTagNames(Lists.newArrayList(tagA.getName()));
|
||||||
assertEquals(
|
assertEquals("filter works not correct",
|
||||||
dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
||||||
+ dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
+ dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
||||||
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
||||||
@@ -96,7 +103,7 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
||||||
.setTagNames(Lists.newArrayList(tagB.getName()));
|
.setTagNames(Lists.newArrayList(tagB.getName()));
|
||||||
assertEquals(
|
assertEquals("filter works not correct",
|
||||||
dsBs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
dsBs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
||||||
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
||||||
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
||||||
@@ -104,7 +111,7 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
||||||
.setTagNames(Lists.newArrayList(tagC.getName()));
|
.setTagNames(Lists.newArrayList(tagC.getName()));
|
||||||
assertEquals(
|
assertEquals("filter works not correct",
|
||||||
dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown()
|
dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown()
|
||||||
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
||||||
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
||||||
@@ -112,22 +119,22 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(true)
|
||||||
.setTagNames(Lists.newArrayList(tagX.getName()));
|
.setTagNames(Lists.newArrayList(tagX.getName()));
|
||||||
assertEquals(0, distributionSetManagement
|
assertEquals("filter works not correct", 0, distributionSetManagement
|
||||||
.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements());
|
.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements());
|
||||||
|
|
||||||
assertEquals(5, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
assertEquals("wrong tag size", 5, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
||||||
|
|
||||||
tagManagement.deleteDistributionSetTag(tagY.getName());
|
tagManagement.deleteDistributionSetTag(tagY.getName());
|
||||||
assertEquals(4, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
assertEquals("wrong tag size", 4, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
||||||
tagManagement.deleteDistributionSetTag(tagX.getName());
|
tagManagement.deleteDistributionSetTag(tagX.getName());
|
||||||
assertEquals(3, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
assertEquals("wrong tag size", 3, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
||||||
|
|
||||||
tagManagement.deleteDistributionSetTag(tagB.getName());
|
tagManagement.deleteDistributionSetTag(tagB.getName());
|
||||||
assertEquals(2, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
assertEquals("wrong tag size", 2, distributionSetTagRepository.findAll().spliterator().getExactSizeIfKnown());
|
||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
||||||
.setTagNames(Lists.newArrayList(tagA.getName()));
|
.setTagNames(Lists.newArrayList(tagA.getName()));
|
||||||
assertEquals(
|
assertEquals("filter works not correct",
|
||||||
dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
dsAs.spliterator().getExactSizeIfKnown() + dsABs.spliterator().getExactSizeIfKnown()
|
||||||
+ dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
+ dsACs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
||||||
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
||||||
@@ -135,12 +142,12 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
||||||
.setTagNames(Lists.newArrayList(tagB.getName()));
|
.setTagNames(Lists.newArrayList(tagB.getName()));
|
||||||
assertEquals(0, distributionSetManagement
|
assertEquals("filter works not correct", 0, distributionSetManagement
|
||||||
.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements());
|
.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build()).getTotalElements());
|
||||||
|
|
||||||
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
distributionSetFilterBuilder = getDistributionSetFilterBuilder().setIsComplete(Boolean.TRUE)
|
||||||
.setTagNames(Lists.newArrayList(tagC.getName()));
|
.setTagNames(Lists.newArrayList(tagC.getName()));
|
||||||
assertEquals(
|
assertEquals("filter works not correct",
|
||||||
dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown()
|
dsCs.spliterator().getExactSizeIfKnown() + dsACs.spliterator().getExactSizeIfKnown()
|
||||||
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
+ dsBCs.spliterator().getExactSizeIfKnown() + dsABCs.spliterator().getExactSizeIfKnown(),
|
||||||
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
distributionSetManagement.findDistributionSetsByFilters(pageReq, distributionSetFilterBuilder.build())
|
||||||
@@ -154,30 +161,25 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
@Description("Ensures that all tags are retrieved through repository.")
|
@Description("Ensures that all tags are retrieved through repository.")
|
||||||
public void findAllTargetTags() {
|
public void findAllTargetTags() {
|
||||||
assertThat(targetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
final List<TargetTag> tags = createTargetsWithTags();
|
final List<TargetTag> tags = createTargetsWithTags();
|
||||||
|
|
||||||
assertThat(targetTagRepository.findAll()).isEqualTo(tagManagement.findAllTargetTags()).isEqualTo(tags)
|
assertThat(targetTagRepository.findAll()).isEqualTo(tagManagement.findAllTargetTags()).isEqualTo(tags)
|
||||||
.hasSize(20);
|
.as("Wrong tag size").hasSize(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that a created tag is persisted in the repository as defined.")
|
@Description("Ensures that a created tag is persisted in the repository as defined.")
|
||||||
public void createTargetTag() {
|
public void createTargetTag() {
|
||||||
assertThat(targetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
final Tag tag = tagManagement.createTargetTag(new TargetTag("kai1", "kai2", "colour"));
|
final Tag tag = tagManagement.createTargetTag(new TargetTag("kai1", "kai2", "colour"));
|
||||||
|
|
||||||
assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).isEqualTo("kai2");
|
assertThat(targetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag ed").isEqualTo("kai2");
|
||||||
assertThat(tagManagement.findTargetTag("kai1").getColour()).isEqualTo("colour");
|
assertThat(tagManagement.findTargetTag("kai1").getColour()).as("wrong tag found").isEqualTo("colour");
|
||||||
assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).isEqualTo("colour");
|
assertThat(tagManagement.findTargetTagById(tag.getId()).getColour()).as("wrong tag found").isEqualTo("colour");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that a deleted tag is removed from the repository as defined.")
|
@Description("Ensures that a deleted tag is removed from the repository as defined.")
|
||||||
public void deleteTargetTas() {
|
public void deleteTargetTas() {
|
||||||
assertThat(targetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
// create test data
|
// create test data
|
||||||
final Iterable<TargetTag> tags = createTargetsWithTags();
|
final Iterable<TargetTag> tags = createTargetsWithTags();
|
||||||
@@ -196,16 +198,13 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getTags())
|
assertThat(targetManagement.findTargetByControllerID(target.getControllerId()).getTags())
|
||||||
.doesNotContain(toDelete);
|
.doesNotContain(toDelete);
|
||||||
}
|
}
|
||||||
assertThat(targetTagRepository.findOne(toDelete.getId())).isNull();
|
assertThat(targetTagRepository.findOne(toDelete.getId())).as("No tag should be found").isNull();
|
||||||
assertThat(tagManagement.findAllTargetTags()).hasSize(19);
|
assertThat(tagManagement.findAllTargetTags()).as("Wrong target tag size").hasSize(19);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Tests the name update of a target tag.")
|
@Description("Tests the name update of a target tag.")
|
||||||
public void updateTargetTag() {
|
public void updateTargetTag() {
|
||||||
assertThat(targetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
// create test data
|
|
||||||
final List<TargetTag> tags = createTargetsWithTags();
|
final List<TargetTag> tags = createTargetsWithTags();
|
||||||
|
|
||||||
// change data
|
// change data
|
||||||
@@ -216,95 +215,104 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
tagManagement.updateTargetTag(savedAssigned);
|
tagManagement.updateTargetTag(savedAssigned);
|
||||||
|
|
||||||
// check data
|
// check data
|
||||||
assertThat(tagManagement.findAllTargetTags()).hasSize(tags.size());
|
assertThat(tagManagement.findAllTargetTags()).as("Wrong target tag size").hasSize(tags.size());
|
||||||
assertThat(targetTagRepository.findOne(savedAssigned.getId()).getName()).isEqualTo("test123");
|
assertThat(targetTagRepository.findOne(savedAssigned.getId()).getName()).as("wrong target tag is saved")
|
||||||
assertThat(targetTagRepository.findOne(savedAssigned.getId()).getOptLockRevision()).isEqualTo(2);
|
.isEqualTo("test123");
|
||||||
|
assertThat(targetTagRepository.findOne(savedAssigned.getId()).getOptLockRevision())
|
||||||
|
.as("wrong target tag is saved").isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that a created tag is persisted in the repository as defined.")
|
@Description("Ensures that a created tag is persisted in the repository as defined.")
|
||||||
public void createDistributionSetTag() {
|
public void createDistributionSetTag() {
|
||||||
assertThat(distributionSetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
final Tag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("kai1", "kai2", "colour"));
|
final Tag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("kai1", "kai2", "colour"));
|
||||||
|
|
||||||
assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).isEqualTo("kai2");
|
assertThat(distributionSetTagRepository.findByNameEquals("kai1").getDescription()).as("wrong tag found")
|
||||||
assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).isEqualTo("colour");
|
.isEqualTo("kai2");
|
||||||
assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).isEqualTo("colour");
|
assertThat(tagManagement.findDistributionSetTag("kai1").getColour()).as("wrong tag found").isEqualTo("colour");
|
||||||
|
assertThat(tagManagement.findDistributionSetTagById(tag.getId()).getColour()).as("wrong tag found")
|
||||||
|
.isEqualTo("colour");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that a created tags are persisted in the repository as defined.")
|
@Description("Ensures that a created tags are persisted in the repository as defined.")
|
||||||
public void createDistributionSetTags() {
|
public void createDistributionSetTags() {
|
||||||
assertThat(distributionSetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
||||||
|
|
||||||
assertThat(distributionSetTagRepository.findAll()).hasSize(tags.size());
|
assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags created").hasSize(tags.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that a deleted tag is removed from the repository as defined.")
|
@Description("Ensures that a deleted tag is removed from the repository as defined.")
|
||||||
public void deleteDistributionSetTag() {
|
public void deleteDistributionSetTag() {
|
||||||
assertThat(distributionSetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
// create test data
|
// create test data
|
||||||
final Iterable<DistributionSetTag> tags = createDsSetsWithTags();
|
final Iterable<DistributionSetTag> tags = createDsSetsWithTags();
|
||||||
final DistributionSetTag toDelete = tags.iterator().next();
|
final DistributionSetTag toDelete = tags.iterator().next();
|
||||||
|
|
||||||
for (final DistributionSet set : distributionSetRepository.findAll()) {
|
for (final DistributionSet set : distributionSetRepository.findAll()) {
|
||||||
assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags())
|
assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags())
|
||||||
.contains(toDelete);
|
.as("Wrong tag found").contains(toDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete
|
// delete
|
||||||
tagManagement.deleteDistributionSetTag(tags.iterator().next().getName());
|
tagManagement.deleteDistributionSetTag(tags.iterator().next().getName());
|
||||||
|
|
||||||
// check
|
// check
|
||||||
assertThat(distributionSetTagRepository.findOne(toDelete.getId())).isNull();
|
assertThat(distributionSetTagRepository.findOne(toDelete.getId())).as("Deleted tag should be null").isNull();
|
||||||
assertThat(tagManagement.findAllDistributionSetTags()).hasSize(19);
|
assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of tags after deletion").hasSize(19);
|
||||||
for (final DistributionSet set : distributionSetRepository.findAll()) {
|
for (final DistributionSet set : distributionSetRepository.findAll()) {
|
||||||
assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags())
|
assertThat(distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()).getTags())
|
||||||
.doesNotContain(toDelete);
|
.as("Wrong found tags").doesNotContain(toDelete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = EntityAlreadyExistsException.class)
|
|
||||||
@Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).")
|
@Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).")
|
||||||
public void failedDuplicateTargetTagNameException() {
|
public void failedDuplicateTargetTagNameException() {
|
||||||
tagManagement.createTargetTag(new TargetTag("A"));
|
tagManagement.createTargetTag(new TargetTag("A"));
|
||||||
tagManagement.createTargetTag(new TargetTag("A"));
|
try {
|
||||||
|
tagManagement.createTargetTag(new TargetTag("A"));
|
||||||
|
fail("Expected EntityAlreadyExistsException");
|
||||||
|
} catch (final EntityAlreadyExistsException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = EntityAlreadyExistsException.class)
|
|
||||||
@Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).")
|
@Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).")
|
||||||
public void failedDuplicateTargetTagNameExceptionAfterUpdate() {
|
public void failedDuplicateTargetTagNameExceptionAfterUpdate() {
|
||||||
tagManagement.createTargetTag(new TargetTag("A"));
|
tagManagement.createTargetTag(new TargetTag("A"));
|
||||||
final TargetTag tag = tagManagement.createTargetTag(new TargetTag("B"));
|
final TargetTag tag = tagManagement.createTargetTag(new TargetTag("B"));
|
||||||
tag.setName("A");
|
tag.setName("A");
|
||||||
tagManagement.updateTargetTag(tag);
|
try {
|
||||||
|
tagManagement.updateTargetTag(tag);
|
||||||
|
fail("Expected EntityAlreadyExistsException");
|
||||||
|
} catch (final EntityAlreadyExistsException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = EntityAlreadyExistsException.class)
|
|
||||||
@Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).")
|
@Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).")
|
||||||
public void failedDuplicateDsTagNameException() {
|
public void failedDuplicateDsTagNameException() {
|
||||||
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
||||||
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
try {
|
||||||
|
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
||||||
|
fail("Expected EntityAlreadyExistsException");
|
||||||
|
} catch (final EntityAlreadyExistsException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = EntityAlreadyExistsException.class)
|
|
||||||
@Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).")
|
@Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).")
|
||||||
public void failedDuplicateDsTagNameExceptionAfterUpdate() {
|
public void failedDuplicateDsTagNameExceptionAfterUpdate() {
|
||||||
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
tagManagement.createDistributionSetTag(new DistributionSetTag("A"));
|
||||||
final DistributionSetTag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("B"));
|
final DistributionSetTag tag = tagManagement.createDistributionSetTag(new DistributionSetTag("B"));
|
||||||
tag.setName("A");
|
tag.setName("A");
|
||||||
tagManagement.updateDistributionSetTag(tag);
|
try {
|
||||||
|
tagManagement.updateDistributionSetTag(tag);
|
||||||
|
fail("Expected EntityAlreadyExistsException");
|
||||||
|
} catch (final EntityAlreadyExistsException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Tests the name update of a target tag.")
|
@Description("Tests the name update of a target tag.")
|
||||||
public void updateDistributionSetTag() {
|
public void updateDistributionSetTag() {
|
||||||
assertThat(distributionSetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
// create test data
|
// create test data
|
||||||
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
||||||
@@ -317,20 +325,19 @@ public class TagManagementTest extends AbstractIntegrationTest {
|
|||||||
tagManagement.updateDistributionSetTag(savedAssigned);
|
tagManagement.updateDistributionSetTag(savedAssigned);
|
||||||
|
|
||||||
// check data
|
// check data
|
||||||
assertThat(tagManagement.findAllDistributionSetTags()).hasSize(tags.size());
|
assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of ds tags").hasSize(tags.size());
|
||||||
assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).isEqualTo("test123");
|
assertThat(distributionSetTagRepository.findOne(savedAssigned.getId()).getName()).as("Wrong ds tag found")
|
||||||
|
.isEqualTo("test123");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Ensures that all tags are retrieved through repository.")
|
@Description("Ensures that all tags are retrieved through repository.")
|
||||||
public void findDistributionSetTagsAll() {
|
public void findDistributionSetTagsAll() {
|
||||||
assertThat(distributionSetTagRepository.findAll()).isEmpty();
|
|
||||||
|
|
||||||
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
final List<DistributionSetTag> tags = createDsSetsWithTags();
|
||||||
|
|
||||||
// test
|
// test
|
||||||
assertThat(tagManagement.findAllDistributionSetTags()).hasSize(tags.size());
|
assertThat(tagManagement.findAllDistributionSetTags()).as("Wrong size of tags").hasSize(tags.size());
|
||||||
assertThat(distributionSetTagRepository.findAll()).hasSize(20);
|
assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags").hasSize(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TargetTag> createTargetsWithTags() {
|
private List<TargetTag> createTargetsWithTags() {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class RSQLDistributionSetFieldTest extends AbstractIntegrationTest {
|
|||||||
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==true", 4);
|
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==true", 4);
|
||||||
try {
|
try {
|
||||||
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0);
|
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0);
|
||||||
fail();
|
fail("Expected RSQLParameterSyntaxException");
|
||||||
} catch (final RSQLParameterSyntaxException e) {
|
} catch (final RSQLParameterSyntaxException e) {
|
||||||
}
|
}
|
||||||
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=in=(true)", 4);
|
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=in=(true)", 4);
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo
|
|||||||
.andExpect(header().string("ETag", artifact.getSha1Hash()))
|
.andExpect(header().string("ETag", artifact.getSha1Hash()))
|
||||||
.andExpect(content().contentType(MediaType.APPLICATION_OCTET_STREAM)).andReturn();
|
.andExpect(content().contentType(MediaType.APPLICATION_OCTET_STREAM)).andReturn();
|
||||||
|
|
||||||
assertTrue(Arrays.equals(result.getResponse().getContentAsByteArray(), random));
|
assertTrue("Wrong response content", Arrays.equals(result.getResponse().getContentAsByteArray(), random));
|
||||||
|
|
||||||
final MvcResult result2 = mvc
|
final MvcResult result2 = mvc
|
||||||
.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download", sm.getId(),
|
.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download", sm.getId(),
|
||||||
|
|||||||
@@ -438,17 +438,17 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
|||||||
if (permChecker.hasUpdateDistributionPermission()) {
|
if (permChecker.hasUpdateDistributionPermission()) {
|
||||||
optionValues.add(updateType.getValue());
|
optionValues.add(updateType.getValue());
|
||||||
}
|
}
|
||||||
createOptionGroup(optionValues);
|
createOptionGroupByValues(optionValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void singleMultiOptionGroup() {
|
private void singleMultiOptionGroup() {
|
||||||
final List<String> optionValues = new ArrayList<>();
|
final List<String> optionValues = new ArrayList<>();
|
||||||
optionValues.add(singleAssign.getValue());
|
optionValues.add(singleAssign.getValue());
|
||||||
optionValues.add(multiAssign.getValue());
|
optionValues.add(multiAssign.getValue());
|
||||||
assignOptionGroup(optionValues);
|
assignOptionGroupByValues(optionValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createOptionGroup(final List<String> tagOptions) {
|
private void createOptionGroupByValues(final List<String> tagOptions) {
|
||||||
createOptiongroup = new OptionGroup("", tagOptions);
|
createOptiongroup = new OptionGroup("", tagOptions);
|
||||||
createOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
createOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
||||||
createOptiongroup.addStyleName("custom-option-group");
|
createOptiongroup.addStyleName("custom-option-group");
|
||||||
@@ -458,7 +458,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assignOptionGroup(final List<String> tagOptions) {
|
private void assignOptionGroupByValues(final List<String> tagOptions) {
|
||||||
assignOptiongroup = new OptionGroup("", tagOptions);
|
assignOptiongroup = new OptionGroup("", tagOptions);
|
||||||
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
||||||
assignOptiongroup.addStyleName("custom-option-group");
|
assignOptiongroup.addStyleName("custom-option-group");
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ public class ArtifactUploadState implements Serializable {
|
|||||||
|
|
||||||
private boolean swTypeFilterClosed = Boolean.FALSE;
|
private boolean swTypeFilterClosed = Boolean.FALSE;
|
||||||
|
|
||||||
private boolean isSwModuleTableMaximized = Boolean.FALSE;
|
private boolean swModuleTableMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private boolean isArtifactDetailsMaximized = Boolean.FALSE;
|
private boolean artifactDetailsMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private final Set<String> selectedDeleteSWModuleTypes = new HashSet<>();
|
private final Set<String> selectedDeleteSWModuleTypes = new HashSet<>();
|
||||||
|
|
||||||
@@ -152,15 +152,15 @@ public class ArtifactUploadState implements Serializable {
|
|||||||
* @return the isSwModuleTableMaximized
|
* @return the isSwModuleTableMaximized
|
||||||
*/
|
*/
|
||||||
public boolean isSwModuleTableMaximized() {
|
public boolean isSwModuleTableMaximized() {
|
||||||
return isSwModuleTableMaximized;
|
return swModuleTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isSwModuleTableMaximized
|
* @param isSwModuleTableMaximized
|
||||||
* the isSwModuleTableMaximized to set
|
* the isSwModuleTableMaximized to set
|
||||||
*/
|
*/
|
||||||
public void setSwModuleTableMaximized(final boolean isSwModuleTableMaximized) {
|
public void setSwModuleTableMaximized(final boolean swModuleTableMaximized) {
|
||||||
this.isSwModuleTableMaximized = isSwModuleTableMaximized;
|
this.swModuleTableMaximized = swModuleTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getSelectedDeleteSWModuleTypes() {
|
public Set<String> getSelectedDeleteSWModuleTypes() {
|
||||||
@@ -171,15 +171,15 @@ public class ArtifactUploadState implements Serializable {
|
|||||||
* @return the isArtifactDetailsMaximized
|
* @return the isArtifactDetailsMaximized
|
||||||
*/
|
*/
|
||||||
public boolean isArtifactDetailsMaximized() {
|
public boolean isArtifactDetailsMaximized() {
|
||||||
return isArtifactDetailsMaximized;
|
return artifactDetailsMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isArtifactDetailsMaximized
|
* @param isArtifactDetailsMaximized
|
||||||
* the isArtifactDetailsMaximized to set
|
* the isArtifactDetailsMaximized to set
|
||||||
*/
|
*/
|
||||||
public void setArtifactDetailsMaximized(final boolean isArtifactDetailsMaximized) {
|
public void setArtifactDetailsMaximized(final boolean artifactDetailsMaximized) {
|
||||||
this.isArtifactDetailsMaximized = isArtifactDetailsMaximized;
|
this.artifactDetailsMaximized = artifactDetailsMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,11 +38,9 @@ public class ProxyTarget extends Target {
|
|||||||
|
|
||||||
private TargetIdName targetIdName;
|
private TargetIdName targetIdName;
|
||||||
|
|
||||||
private Long createdAt;
|
private String assignedDistNameVersion;
|
||||||
|
|
||||||
private String assignedDistNameVersion = null;
|
private String installedDistNameVersion;
|
||||||
|
|
||||||
private String installedDistNameVersion = null;
|
|
||||||
|
|
||||||
private String pollStatusToolTip;
|
private String pollStatusToolTip;
|
||||||
|
|
||||||
@@ -251,22 +249,6 @@ public class ProxyTarget extends Target {
|
|||||||
this.installedDistributionSet = installedDistributionSet;
|
this.installedDistributionSet = installedDistributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the createdAt
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Long getCreatedAt() {
|
|
||||||
return createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param createdAt
|
|
||||||
* the createdAt to set
|
|
||||||
*/
|
|
||||||
public void setCreatedAt(final Long createdAt) {
|
|
||||||
this.createdAt = createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the targetIdName
|
* @return the targetIdName
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -555,10 +555,10 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
if (permChecker.hasUpdateDistributionPermission()) {
|
if (permChecker.hasUpdateDistributionPermission()) {
|
||||||
optionValues.add(updateDistType.getValue());
|
optionValues.add(updateDistType.getValue());
|
||||||
}
|
}
|
||||||
createOptionGroup(optionValues);
|
createOptionGroupByValues(optionValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createOptionGroup(final List<String> typeOptions) {
|
private void createOptionGroupByValues(final List<String> typeOptions) {
|
||||||
createOptiongroup = new OptionGroup("", typeOptions);
|
createOptiongroup = new OptionGroup("", typeOptions);
|
||||||
createOptiongroup.setId(SPUIDefinitions.CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID);
|
createOptiongroup.setId(SPUIDefinitions.CREATE_OPTION_GROUP_DISTRIBUTION_SET_TYPE_ID);
|
||||||
createOptiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
createOptiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ public class ManageDistUIState implements Serializable {
|
|||||||
|
|
||||||
private final Map<Long, String> deleteSofwareModulesList = new HashMap<>();
|
private final Map<Long, String> deleteSofwareModulesList = new HashMap<>();
|
||||||
|
|
||||||
private boolean isSwModuleTableMaximized = Boolean.FALSE;
|
private boolean swModuleTableMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private boolean isDsTableMaximized = Boolean.FALSE;
|
private boolean dsTableMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private final Map<String, SoftwareModuleIdName> assignedSoftwareModuleDetails = new HashMap<>();
|
private final Map<String, SoftwareModuleIdName> assignedSoftwareModuleDetails = new HashMap<>();
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ public class ManageDistUIState implements Serializable {
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isDsTableMaximized() {
|
public boolean isDsTableMaximized() {
|
||||||
return isDsTableMaximized;
|
return dsTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -227,8 +227,8 @@ public class ManageDistUIState implements Serializable {
|
|||||||
*
|
*
|
||||||
* @param isDsModuleTableMaximized
|
* @param isDsModuleTableMaximized
|
||||||
*/
|
*/
|
||||||
public void setDsTableMaximized(final boolean isDsModuleTableMaximized) {
|
public void setDsTableMaximized(final boolean dsModuleTableMaximized) {
|
||||||
isDsTableMaximized = isDsModuleTableMaximized;
|
dsTableMaximized = dsModuleTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, SoftwareModuleIdName> getAssignedSoftwareModuleDetails() {
|
public Map<String, SoftwareModuleIdName> getAssignedSoftwareModuleDetails() {
|
||||||
@@ -239,15 +239,15 @@ public class ManageDistUIState implements Serializable {
|
|||||||
* @return the isSwModuleTableMaximized
|
* @return the isSwModuleTableMaximized
|
||||||
*/
|
*/
|
||||||
public boolean isSwModuleTableMaximized() {
|
public boolean isSwModuleTableMaximized() {
|
||||||
return isSwModuleTableMaximized;
|
return swModuleTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isSwModuleTableMaximized
|
* @param isSwModuleTableMaximized
|
||||||
* the isSwModuleTableMaximized to set
|
* the isSwModuleTableMaximized to set
|
||||||
*/
|
*/
|
||||||
public void setSwModuleTableMaximized(final boolean isSwModuleTableMaximized) {
|
public void setSwModuleTableMaximized(final boolean swModuleTableMaximized) {
|
||||||
this.isSwModuleTableMaximized = isSwModuleTableMaximized;
|
this.swModuleTableMaximized = swModuleTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private transient TenantMetaDataRepository tenantMetaDataRepository;
|
private transient TenantMetaDataRepository tenantMetaDataRepository;
|
||||||
|
|
||||||
private Button saveDistribution;
|
private Button saveDistributionBtn;
|
||||||
private Button discardDistribution;
|
private Button discardDistributionBtn;
|
||||||
private TextField distNameTextField;
|
private TextField distNameTextField;
|
||||||
private TextField distVersionTextField;
|
private TextField distVersionTextField;
|
||||||
private Label madatoryLabel;
|
private Label madatoryLabel;
|
||||||
@@ -103,7 +103,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
private CheckBox reqMigStepCheckbox;
|
private CheckBox reqMigStepCheckbox;
|
||||||
private ComboBox distsetTypeNameComboBox;
|
private ComboBox distsetTypeNameComboBox;
|
||||||
private boolean editDistribution = Boolean.FALSE;
|
private boolean editDistribution = Boolean.FALSE;
|
||||||
private Long editDistId = null;
|
private Long editDistId;
|
||||||
private Window addDistributionWindow;
|
private Window addDistributionWindow;
|
||||||
private String originalDistName;
|
private String originalDistName;
|
||||||
private String originalDistVersion;
|
private String originalDistVersion;
|
||||||
@@ -131,9 +131,9 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
final HorizontalLayout buttonsLayout = new HorizontalLayout();
|
final HorizontalLayout buttonsLayout = new HorizontalLayout();
|
||||||
buttonsLayout.setSizeFull();
|
buttonsLayout.setSizeFull();
|
||||||
buttonsLayout.setStyleName("dist-buttons-horz-layout");
|
buttonsLayout.setStyleName("dist-buttons-horz-layout");
|
||||||
buttonsLayout.addComponents(saveDistribution, discardDistribution);
|
buttonsLayout.addComponents(saveDistributionBtn, discardDistributionBtn);
|
||||||
buttonsLayout.setComponentAlignment(saveDistribution, Alignment.BOTTOM_LEFT);
|
buttonsLayout.setComponentAlignment(saveDistributionBtn, Alignment.BOTTOM_LEFT);
|
||||||
buttonsLayout.setComponentAlignment(discardDistribution, Alignment.BOTTOM_RIGHT);
|
buttonsLayout.setComponentAlignment(discardDistributionBtn, Alignment.BOTTOM_RIGHT);
|
||||||
buttonsLayout.addStyleName("window-style");
|
buttonsLayout.addStyleName("window-style");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -186,14 +186,14 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
reqMigStepCheckbox.setId(SPUIComponetIdProvider.DIST_ADD_MIGRATION_CHECK);
|
reqMigStepCheckbox.setId(SPUIComponetIdProvider.DIST_ADD_MIGRATION_CHECK);
|
||||||
|
|
||||||
/* save or update button */
|
/* save or update button */
|
||||||
saveDistribution = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_SAVE, "", "", "", true,
|
saveDistributionBtn = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_SAVE, "", "", "", true,
|
||||||
FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class);
|
FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class);
|
||||||
saveDistribution.addClickListener(event -> saveDistribution());
|
saveDistributionBtn.addClickListener(event -> saveDistribution());
|
||||||
|
|
||||||
/* close button */
|
/* close button */
|
||||||
discardDistribution = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_DISCARD, "", "", "", true,
|
discardDistributionBtn = SPUIComponentProvider.getButton(SPUIComponetIdProvider.DIST_ADD_DISCARD, "", "", "",
|
||||||
FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
true, FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
|
||||||
discardDistribution.addClickListener(event -> discardDistribution());
|
discardDistributionBtn.addClickListener(event -> discardDistribution());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,7 +216,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void enableSaveButton() {
|
private void enableSaveButton() {
|
||||||
saveDistribution.setEnabled(true);
|
saveDistributionBtn.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DistributionSetType getDefaultDistributionSetType() {
|
private DistributionSetType getDefaultDistributionSetType() {
|
||||||
@@ -226,7 +226,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disableSaveButton() {
|
private void disableSaveButton() {
|
||||||
saveDistribution.setEnabled(false);
|
saveDistributionBtn.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveDistribution() {
|
private void saveDistribution() {
|
||||||
@@ -415,7 +415,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
distsetTypeNameComboBox.removeStyleName(SPUIStyleDefinitions.SP_COMBOFIELD_ERROR);
|
distsetTypeNameComboBox.removeStyleName(SPUIStyleDefinitions.SP_COMBOFIELD_ERROR);
|
||||||
descTextArea.clear();
|
descTextArea.clear();
|
||||||
reqMigStepCheckbox.clear();
|
reqMigStepCheckbox.clear();
|
||||||
saveDistribution.setEnabled(true);
|
saveDistributionBtn.setEnabled(true);
|
||||||
removeListeners();
|
removeListeners();
|
||||||
changedComponents.clear();
|
changedComponents.clear();
|
||||||
}
|
}
|
||||||
@@ -497,7 +497,7 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
|
|||||||
public void populateValuesOfDistribution(final Long editDistId) {
|
public void populateValuesOfDistribution(final Long editDistId) {
|
||||||
this.editDistId = editDistId;
|
this.editDistId = editDistId;
|
||||||
editDistribution = Boolean.TRUE;
|
editDistribution = Boolean.TRUE;
|
||||||
saveDistribution.setEnabled(false);
|
saveDistributionBtn.setEnabled(false);
|
||||||
final DistributionSet distSet = distributionSetManagement.findDistributionSetByIdWithDetails(editDistId);
|
final DistributionSet distSet = distributionSetManagement.findDistributionSetByIdWithDetails(editDistId);
|
||||||
if (distSet != null) {
|
if (distSet != null) {
|
||||||
distNameTextField.setValue(distSet.getName());
|
distNameTextField.setValue(distSet.getName());
|
||||||
|
|||||||
@@ -62,20 +62,20 @@ public class ManagementUIState implements Serializable {
|
|||||||
|
|
||||||
private boolean distTagFilterClosed = true;
|
private boolean distTagFilterClosed = true;
|
||||||
|
|
||||||
private Long targetsTruncated = null;
|
private Long targetsTruncated;
|
||||||
|
|
||||||
private final AtomicLong targetsCountAll = new AtomicLong();
|
private final AtomicLong targetsCountAll = new AtomicLong();
|
||||||
|
|
||||||
private boolean isDsTableMaximized = Boolean.FALSE;
|
private boolean dsTableMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
// Contains ID and NAme of last selected target
|
// Contains ID and NAme of last selected target
|
||||||
private DistributionSetIdName lastSelectedDsIdName;
|
private DistributionSetIdName lastSelectedDsIdName;
|
||||||
// Contains list of ID and Names of all the selected Targets
|
// Contains list of ID and Names of all the selected Targets
|
||||||
private Set<DistributionSetIdName> selectedDsIdName = Collections.emptySet();
|
private Set<DistributionSetIdName> selectedDsIdName = Collections.emptySet();
|
||||||
|
|
||||||
private boolean isTargetTableMaximized = Boolean.FALSE;
|
private boolean targetTableMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private boolean isActionHistoryMaximized = Boolean.FALSE;
|
private boolean actionHistoryMaximized = Boolean.FALSE;
|
||||||
|
|
||||||
private boolean noDataAvilableTarget = Boolean.FALSE;
|
private boolean noDataAvilableTarget = Boolean.FALSE;
|
||||||
|
|
||||||
@@ -255,11 +255,11 @@ public class ManagementUIState implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDsTableMaximized() {
|
public boolean isDsTableMaximized() {
|
||||||
return isDsTableMaximized;
|
return dsTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDsTableMaximized(final boolean isDsTableMaximized) {
|
public void setDsTableMaximized(final boolean isDsTableMaximized) {
|
||||||
this.isDsTableMaximized = isDsTableMaximized;
|
this.dsTableMaximized = isDsTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DistributionSetIdName getLastSelectedDsIdName() {
|
public DistributionSetIdName getLastSelectedDsIdName() {
|
||||||
@@ -282,7 +282,7 @@ public class ManagementUIState implements Serializable {
|
|||||||
* @return the isTargetTableMaximized
|
* @return the isTargetTableMaximized
|
||||||
*/
|
*/
|
||||||
public boolean isTargetTableMaximized() {
|
public boolean isTargetTableMaximized() {
|
||||||
return isTargetTableMaximized;
|
return targetTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -290,14 +290,14 @@ public class ManagementUIState implements Serializable {
|
|||||||
* the isTargetTableMaximized to set
|
* the isTargetTableMaximized to set
|
||||||
*/
|
*/
|
||||||
public void setTargetTableMaximized(final boolean isTargetTableMaximized) {
|
public void setTargetTableMaximized(final boolean isTargetTableMaximized) {
|
||||||
this.isTargetTableMaximized = isTargetTableMaximized;
|
this.targetTableMaximized = isTargetTableMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the isActionHistoryMaximized
|
* @return the isActionHistoryMaximized
|
||||||
*/
|
*/
|
||||||
public boolean isActionHistoryMaximized() {
|
public boolean isActionHistoryMaximized() {
|
||||||
return isActionHistoryMaximized;
|
return actionHistoryMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -305,7 +305,7 @@ public class ManagementUIState implements Serializable {
|
|||||||
* the isActionHistoryMaximized to set
|
* the isActionHistoryMaximized to set
|
||||||
*/
|
*/
|
||||||
public void setActionHistoryMaximized(final boolean isActionHistoryMaximized) {
|
public void setActionHistoryMaximized(final boolean isActionHistoryMaximized) {
|
||||||
this.isActionHistoryMaximized = isActionHistoryMaximized;
|
this.actionHistoryMaximized = isActionHistoryMaximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -128,9 +128,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private TextArea description;
|
private TextArea description;
|
||||||
|
|
||||||
private Button saveRollout;
|
private Button saveRolloutBtn;
|
||||||
|
|
||||||
private Button discardRolllout;
|
private Button discardRollloutBtn;
|
||||||
|
|
||||||
private OptionGroup errorThresholdOptionGroup;
|
private OptionGroup errorThresholdOptionGroup;
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private Window addUpdateRolloutWindow;
|
private Window addUpdateRolloutWindow;
|
||||||
|
|
||||||
private Boolean editRollout;
|
private Boolean editRolloutEnabled;
|
||||||
|
|
||||||
private Rollout rolloutForEdit;
|
private Rollout rolloutForEdit;
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
* Reset the field values.
|
* Reset the field values.
|
||||||
*/
|
*/
|
||||||
public void resetComponents() {
|
public void resetComponents() {
|
||||||
editRollout = Boolean.FALSE;
|
editRolloutEnabled = Boolean.FALSE;
|
||||||
rolloutName.clear();
|
rolloutName.clear();
|
||||||
targetFilterQuery.clear();
|
targetFilterQuery.clear();
|
||||||
resetFields();
|
resetFields();
|
||||||
@@ -212,7 +212,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
final HorizontalLayout groupLayout = new HorizontalLayout();
|
final HorizontalLayout groupLayout = new HorizontalLayout();
|
||||||
groupLayout.setSizeFull();
|
groupLayout.setSizeFull();
|
||||||
groupLayout.addComponents(noOfGroups, groupSizeLabel);
|
groupLayout.addComponents(noOfGroups, groupSizeLabel);
|
||||||
groupLayout.setExpandRatio(noOfGroups, 1.0f);
|
groupLayout.setExpandRatio(noOfGroups, 1.0F);
|
||||||
groupLayout.setComponentAlignment(groupSizeLabel, Alignment.MIDDLE_LEFT);
|
groupLayout.setComponentAlignment(groupSizeLabel, Alignment.MIDDLE_LEFT);
|
||||||
return groupLayout;
|
return groupLayout;
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
final HorizontalLayout errorThresoldLayout = new HorizontalLayout();
|
final HorizontalLayout errorThresoldLayout = new HorizontalLayout();
|
||||||
errorThresoldLayout.setSizeFull();
|
errorThresoldLayout.setSizeFull();
|
||||||
errorThresoldLayout.addComponents(errorThreshold, errorThresholdOptionGroup);
|
errorThresoldLayout.addComponents(errorThreshold, errorThresholdOptionGroup);
|
||||||
errorThresoldLayout.setExpandRatio(errorThreshold, 1.0f);
|
errorThresoldLayout.setExpandRatio(errorThreshold, 1.0F);
|
||||||
return errorThresoldLayout;
|
return errorThresoldLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,9 +229,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
final HorizontalLayout targetFilterLayout = new HorizontalLayout();
|
final HorizontalLayout targetFilterLayout = new HorizontalLayout();
|
||||||
targetFilterLayout.setSizeFull();
|
targetFilterLayout.setSizeFull();
|
||||||
targetFilterLayout.addComponents(targetFilterQueryCombo, targetFilterQuery, totalTargetsLabel);
|
targetFilterLayout.addComponents(targetFilterQueryCombo, targetFilterQuery, totalTargetsLabel);
|
||||||
targetFilterLayout.setExpandRatio(targetFilterQueryCombo, 0.71f);
|
targetFilterLayout.setExpandRatio(targetFilterQueryCombo, 0.71F);
|
||||||
targetFilterLayout.setExpandRatio(targetFilterQuery, 0.70f);
|
targetFilterLayout.setExpandRatio(targetFilterQuery, 0.70F);
|
||||||
targetFilterLayout.setExpandRatio(totalTargetsLabel, 0.29f);
|
targetFilterLayout.setExpandRatio(totalTargetsLabel, 0.29F);
|
||||||
targetFilterLayout.setComponentAlignment(totalTargetsLabel, Alignment.MIDDLE_LEFT);
|
targetFilterLayout.setComponentAlignment(totalTargetsLabel, Alignment.MIDDLE_LEFT);
|
||||||
return targetFilterLayout;
|
return targetFilterLayout;
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
final HorizontalLayout triggerThresholdLayout = new HorizontalLayout();
|
final HorizontalLayout triggerThresholdLayout = new HorizontalLayout();
|
||||||
triggerThresholdLayout.setSizeFull();
|
triggerThresholdLayout.setSizeFull();
|
||||||
triggerThresholdLayout.addComponents(triggerThreshold, getPercentHintLabel());
|
triggerThresholdLayout.addComponents(triggerThreshold, getPercentHintLabel());
|
||||||
triggerThresholdLayout.setExpandRatio(triggerThreshold, 1.0f);
|
triggerThresholdLayout.setExpandRatio(triggerThreshold, 1.0F);
|
||||||
return triggerThresholdLayout;
|
return triggerThresholdLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,9 +254,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
private HorizontalLayout getSaveDiscardButtonLayout() {
|
private HorizontalLayout getSaveDiscardButtonLayout() {
|
||||||
final HorizontalLayout buttonsLayout = new HorizontalLayout();
|
final HorizontalLayout buttonsLayout = new HorizontalLayout();
|
||||||
buttonsLayout.setSizeFull();
|
buttonsLayout.setSizeFull();
|
||||||
buttonsLayout.addComponents(saveRollout, discardRolllout);
|
buttonsLayout.addComponents(saveRolloutBtn, discardRollloutBtn);
|
||||||
buttonsLayout.setComponentAlignment(saveRollout, Alignment.BOTTOM_LEFT);
|
buttonsLayout.setComponentAlignment(saveRolloutBtn, Alignment.BOTTOM_LEFT);
|
||||||
buttonsLayout.setComponentAlignment(discardRolllout, Alignment.BOTTOM_RIGHT);
|
buttonsLayout.setComponentAlignment(discardRollloutBtn, Alignment.BOTTOM_RIGHT);
|
||||||
buttonsLayout.addStyleName("window-style");
|
buttonsLayout.addStyleName("window-style");
|
||||||
return buttonsLayout;
|
return buttonsLayout;
|
||||||
}
|
}
|
||||||
@@ -277,8 +277,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
description = createDescription();
|
description = createDescription();
|
||||||
errorThresholdOptionGroup = createErrorThresholdOptionGroup();
|
errorThresholdOptionGroup = createErrorThresholdOptionGroup();
|
||||||
setDefaultSaveStartGroupOption();
|
setDefaultSaveStartGroupOption();
|
||||||
saveRollout = createSaveButton();
|
saveRolloutBtn = createSaveButton();
|
||||||
discardRolllout = createDiscardButton();
|
discardRollloutBtn = createDiscardButton();
|
||||||
actionTypeOptionGroupLayout.selectDefaultOption();
|
actionTypeOptionGroupLayout.selectDefaultOption();
|
||||||
|
|
||||||
totalTargetsLabel = createTotalTargetsLabel();
|
totalTargetsLabel = createTotalTargetsLabel();
|
||||||
@@ -383,8 +383,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
private Container createTargetFilterComboContainer() {
|
private Container createTargetFilterComboContainer() {
|
||||||
final BeanQueryFactory<TargetFilterBeanQuery> targetFilterQF = new BeanQueryFactory<>(
|
final BeanQueryFactory<TargetFilterBeanQuery> targetFilterQF = new BeanQueryFactory<>(
|
||||||
TargetFilterBeanQuery.class);
|
TargetFilterBeanQuery.class);
|
||||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE,
|
return new LazyQueryContainer(
|
||||||
SPUILabelDefinitions.VAR_NAME), targetFilterQF);
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_NAME),
|
||||||
|
targetFilterQF);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,7 +411,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onRolloutSave() {
|
private void onRolloutSave() {
|
||||||
if (editRollout) {
|
if (editRolloutEnabled) {
|
||||||
editRollout();
|
editRollout();
|
||||||
} else {
|
} else {
|
||||||
createRollout();
|
createRollout();
|
||||||
@@ -422,8 +423,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
rolloutForEdit.setName(rolloutName.getValue());
|
rolloutForEdit.setName(rolloutName.getValue());
|
||||||
rolloutForEdit.setDescription(description.getValue());
|
rolloutForEdit.setDescription(description.getValue());
|
||||||
final DistributionSetIdName distributionSetIdName = (DistributionSetIdName) distributionSet.getValue();
|
final DistributionSetIdName distributionSetIdName = (DistributionSetIdName) distributionSet.getValue();
|
||||||
rolloutForEdit.setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName
|
rolloutForEdit.setDistributionSet(
|
||||||
.getId()));
|
distributionSetManagement.findDistributionSetById(distributionSetIdName.getId()));
|
||||||
rolloutForEdit.setActionType(getActionType());
|
rolloutForEdit.setActionType(getActionType());
|
||||||
rolloutForEdit.setForcedTime(getForcedTimeStamp());
|
rolloutForEdit.setForcedTime(getForcedTimeStamp());
|
||||||
final int amountGroup = Integer.parseInt(noOfGroups.getValue());
|
final int amountGroup = Integer.parseInt(noOfGroups.getValue());
|
||||||
@@ -453,8 +454,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private long getForcedTimeStamp() {
|
private long getForcedTimeStamp() {
|
||||||
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
|
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
|
||||||
.getValue()) == ActionTypeOption.AUTO_FORCED) ? actionTypeOptionGroupLayout.getForcedTimeDateField()
|
.getValue()) == ActionTypeOption.AUTO_FORCED)
|
||||||
.getValue().getTime() : Action.NO_FORCE_TIME;
|
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||||
|
: Action.NO_FORCE_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ActionType getActionType() {
|
private ActionType getActionType() {
|
||||||
@@ -487,8 +489,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
rolloutToCreate.setName(rolloutName.getValue());
|
rolloutToCreate.setName(rolloutName.getValue());
|
||||||
rolloutToCreate.setDescription(description.getValue());
|
rolloutToCreate.setDescription(description.getValue());
|
||||||
rolloutToCreate.setTargetFilterQuery(targetFilter);
|
rolloutToCreate.setTargetFilterQuery(targetFilter);
|
||||||
rolloutToCreate.setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName
|
rolloutToCreate
|
||||||
.getId()));
|
.setDistributionSet(distributionSetManagement.findDistributionSetById(distributionSetIdName.getId()));
|
||||||
rolloutToCreate.setActionType(getActionType());
|
rolloutToCreate.setActionType(getActionType());
|
||||||
rolloutToCreate.setForcedTime(getForcedTimeStamp());
|
rolloutToCreate.setForcedTime(getForcedTimeStamp());
|
||||||
|
|
||||||
@@ -499,8 +501,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
private String getTargetFilterQuery() {
|
private String getTargetFilterQuery() {
|
||||||
if (null != targetFilterQueryCombo.getValue()
|
if (null != targetFilterQueryCombo.getValue()
|
||||||
&& HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) != null) {
|
&& HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) != null) {
|
||||||
final Item filterItem = targetFilterQueryCombo.getContainerDataSource().getItem(
|
final Item filterItem = targetFilterQueryCombo.getContainerDataSource()
|
||||||
targetFilterQueryCombo.getValue());
|
.getItem(targetFilterQueryCombo.getValue());
|
||||||
return (String) filterItem.getItemProperty("query").getValue();
|
return (String) filterItem.getItemProperty("query").getValue();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -568,8 +570,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
|
|
||||||
private boolean duplicateCheck() {
|
private boolean duplicateCheck() {
|
||||||
if (rolloutManagement.findRolloutByName(getRolloutName()) != null) {
|
if (rolloutManagement.findRolloutByName(getRolloutName()) != null) {
|
||||||
uiNotification.displayValidationError(i18n.get("message.rollout.duplicate.check",
|
uiNotification.displayValidationError(
|
||||||
new Object[] { getRolloutName() }));
|
i18n.get("message.rollout.duplicate.check", new Object[] { getRolloutName() }));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -580,9 +582,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TextArea createDescription() {
|
private TextArea createDescription() {
|
||||||
final TextArea descriptionField = SPUIComponentProvider.getTextArea("text-area-style",
|
final TextArea descriptionField = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY,
|
||||||
ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.description"),
|
false, null, i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
|
||||||
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
|
|
||||||
descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID);
|
descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID);
|
||||||
descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
|
descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
|
||||||
descriptionField.setSizeFull();
|
descriptionField.setSizeFull();
|
||||||
@@ -646,9 +647,10 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Container createDsComboContainer() {
|
private Container createDsComboContainer() {
|
||||||
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<>(DistributionBeanQuery.class);
|
final BeanQueryFactory<DistBeanQuery> distributionQF = new BeanQueryFactory<>(DistBeanQuery.class);
|
||||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE,
|
return new LazyQueryContainer(
|
||||||
SPUILabelDefinitions.VAR_DIST_ID_NAME), distributionQF);
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
|
||||||
|
distributionQF);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,8 +684,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
try {
|
try {
|
||||||
if (HawkbitCommonUtil.trimAndNullIfEmpty(noOfGroups.getValue()) == null
|
if (HawkbitCommonUtil.trimAndNullIfEmpty(noOfGroups.getValue()) == null
|
||||||
|| HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) == null) {
|
|| HawkbitCommonUtil.trimAndNullIfEmpty((String) targetFilterQueryCombo.getValue()) == null) {
|
||||||
uiNotification.displayValidationError(i18n
|
uiNotification
|
||||||
.get("message.rollout.noofgroups.or.targetfilter.missing"));
|
.displayValidationError(i18n.get("message.rollout.noofgroups.or.targetfilter.missing"));
|
||||||
} else {
|
} else {
|
||||||
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
||||||
final int groupSize = getGroupSize();
|
final int groupSize = getGroupSize();
|
||||||
@@ -708,8 +710,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
public void validate(final Object value) {
|
public void validate(final Object value) {
|
||||||
try {
|
try {
|
||||||
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
||||||
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100).validate(Integer
|
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 100), 0, 100)
|
||||||
.valueOf(value.toString()));
|
.validate(Integer.valueOf(value.toString()));
|
||||||
} catch (final InvalidValueException ex) {
|
} catch (final InvalidValueException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
@@ -723,8 +725,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
public void validate(final Object value) {
|
public void validate(final Object value) {
|
||||||
try {
|
try {
|
||||||
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
new RegexpValidator(NUMBER_REGEXP, i18n.get(MESSAGE_ENTER_NUMBER)).validate(value);
|
||||||
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 500), 0, 500).validate(Integer
|
new IntegerRangeValidator(i18n.get(MESSAGE_ROLLOUT_FIELD_VALUE_RANGE, 0, 500), 0, 500)
|
||||||
.valueOf(value.toString()));
|
.validate(Integer.valueOf(value.toString()));
|
||||||
} catch (final InvalidValueException ex) {
|
} catch (final InvalidValueException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
@@ -740,7 +742,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
|
|||||||
*/
|
*/
|
||||||
public void populateData(final Long rolloutId) {
|
public void populateData(final Long rolloutId) {
|
||||||
resetComponents();
|
resetComponents();
|
||||||
editRollout = Boolean.TRUE;
|
editRolloutEnabled = Boolean.TRUE;
|
||||||
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
|
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
|
||||||
rolloutName.setValue(rolloutForEdit.getName());
|
rolloutName.setValue(rolloutForEdit.getName());
|
||||||
description.setValue(rolloutForEdit.getDescription());
|
description.setValue(rolloutForEdit.getDescription());
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac
|
|||||||
gatewayTokenNameTextField.setImmediate(true);
|
gatewayTokenNameTextField.setImmediate(true);
|
||||||
// hide text field until we support multiple gateway tokens for a tenan
|
// hide text field until we support multiple gateway tokens for a tenan
|
||||||
gatewayTokenNameTextField.setVisible(false);
|
gatewayTokenNameTextField.setVisible(false);
|
||||||
gatewayTokenNameTextField.addTextChangeListener(event -> keyNameChanged());
|
gatewayTokenNameTextField.addTextChangeListener(event -> doKeyNameChanged());
|
||||||
|
|
||||||
final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "",
|
final Button gatewaytokenBtn = SPUIComponentProvider.getButton("TODO-ID", "Regenerate Key", "",
|
||||||
ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class);
|
ValoTheme.BUTTON_TINY + " " + "redicon", true, null, SPUIButtonStyleSmall.class);
|
||||||
@@ -116,10 +116,7 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void doKeyNameChanged() {
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private void keyNameChanged() {
|
|
||||||
keyNameChanged = true;
|
keyNameChanged = true;
|
||||||
notifyConfigurationChanged();
|
notifyConfigurationChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user