/**
 * *****************************************************************************
 * This file is part of OpenNMS(R).
 *
 * Copyright (C) 2007-2011 The OpenNMS Group, Inc. OpenNMS(R) is Copyright (C)
 * 1999-2011 The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * OpenNMS(R) is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * OpenNMS(R). If not, see: http://www.gnu.org/licenses/
 *
 * For more information contact: OpenNMS(R) Licensing <license@opennms.org>
 * http://www.opennms.org/ http://www.opennms.com/
 ******************************************************************************
 */
package org.opennms.tools.jmxconfiggenerator.jmxconfig;

import java.io.IOException;
import javax.management.AttributeNotFoundException;
import javax.management.MBeanException;
import org.junit.*;
import org.opennms.tools.jmxconfiggenerator.graphs.SnmpGraphConfigGenerator;

/**
 * @author Simon Walter <simon.walter@hp-factory.de>
 * @author Markus Neumann <markus@opennms.com>
 */
public class JmxDatacollectionConfigGeneratorTest {

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Ignore
    @Test
    public void testGenerateJmxConfig() throws AttributeNotFoundException, MBeanException {
        JmxDatacollectionConfigGenerator.generateJmxConfig("cassandra", "localhost", "7199", null, null, true, true, "test.xml");
    }

    @Ignore
    @Test
    public void testGenerateGraphs() throws IOException {
        SnmpGraphConfigGenerator.generateGraphs("cassandra", "test.xml", "wtf.properties");
    }

    @Test
    public void testTrimByDictionary() {
        Assert.assertEquals("CommitVirtMemSize", JmxDatacollectionConfigGenerator.trimByDictionary("CommittedVirtualMemorySize"));
        Assert.assertEquals("AvgCompRatio" , JmxDatacollectionConfigGenerator.trimByDictionary("AverageCompressionRatio"));

        Assert.assertEquals("AllIdentityTokenizedCount" , JmxDatacollectionConfigGenerator.trimByDictionary("AllIdentityTokenizedCount"));

        Assert.assertEquals("AvgCompRatio" , JmxDatacollectionConfigGenerator.trimByDictionary("AverageCompressionRatio"));
    }

    @Test
    public void testTrimByCamelCase() {
        Assert.assertEquals("CommitteVirtMemSize", JmxDatacollectionConfigGenerator.trimByCamelCase("CommittedVirtMemSize", 19));
        Assert.assertEquals("CommiVirtuMemorSize", JmxDatacollectionConfigGenerator.trimByCamelCase("CommittedVirtualMemorySize", 19));

        Assert.assertEquals("AllIdentityTokenizedCount", JmxDatacollectionConfigGenerator.trimByCamelCase("AllIdentityTokenizedCount", 19));
        Assert.assertEquals("CommiVirtuMemorSize", JmxDatacollectionConfigGenerator.trimByCamelCase("CommittedVirtualMemorySize", 19));
    }
}

@@ -2618,25 +2618,24 @@
 onRatio%22));%0A
-%0A
         Asse
@@ -2656,34 +2656,24 @@
 s(%22AllId
-e
 nt
-ityTokenizedCou
+ToknzC
 nt%22 , Jm
@@ -2754,133 +2754,8 @@
 %22));
-%0A%0A        Assert.assertEquals(%22AvgCompRatio%22 , JmxDatacollectionConfigGenerator.trimByDictionary(%22AverageCompressionRatio%22));
 %0A   
@@ -3074,17 +3074,16 @@
 , 19));%0A
-%0A
         
@@ -3107,36 +3107,30 @@
 ls(%22AllIdent
-ity
 Tokeni
-zed
 Count%22, JmxD
@@ -3213,144 +3213,8 @@
 ));%0A
-        Assert.assertEquals(%22CommiVirtuMemorSize%22, JmxDatacollectionConfigGenerator.trimByCamelCase(%22CommittedVirtualMemorySize%22, 19));%0A
     

fix for test