@@ -0,0 +1,2052 @@
+/*******************************************************************************%0A * This file is part of OpenNMS(R).%0A *%0A * Copyright (C) 2012-2016 The OpenNMS Group, Inc.%0A * OpenNMS(R) is Copyright (C) 1999-2016 The OpenNMS Group, Inc.%0A *%0A * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.%0A *%0A * OpenNMS(R) is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published%0A * by the Free Software Foundation, either version 3 of the License,%0A * or (at your option) any later version.%0A *%0A * OpenNMS(R) is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with OpenNMS(R).  If not, see:%0A *      http://www.gnu.org/licenses/%0A *%0A * For more information contact:%0A *     OpenNMS(R) Licensing %3Clicense@opennms.org%3E%0A *     http://www.opennms.org/%0A *     http://www.opennms.com/%0A *******************************************************************************/%0A%0Apackage org.opennms.features.topology.plugins.topo.bsm;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Test;%0A%0Apublic class ReductionKeyVertexTest %7B%0A%0A    @Test%0A    public void canGetLabelFromReductionKey() %7B%0A        assertEquals(%22nodeDown:10%22, ReductionKeyVertex.getLabelFromReductionKey(%22uei.opennms.org/nodes/nodeDown::10%22));%0A        assertEquals(%22nodeLostService:DNS%22, ReductionKeyVertex.getLabelFromReductionKey(%22uei.opennms.org/nodes/nodeLostService::9:2600:5800:f2a2:0000:02d0:b7ff:fe25:3e1c:DNS%22));%0A        assertEquals(%22dataCollectionFailed:48%22, ReductionKeyVertex.getLabelFromReductionKey(%22uei.opennms.org/nodes/dataCollectionFailed::48%22));%0A        assertEquals(%22this_is_a_really_long_re%22, ReductionKeyVertex.getLabelFromReductionKey(%22this_is_a_really_long_reduction_key_that_shouldnt_match_the_know_pattern%22));%0A    %7D%0A%7D%0A

Add test to validate the getLabelFromReductionKey() function.