/*
 *
 * Copyright 2014, Armenak Grigoryan, and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 */



package com.strider.datadefender.functions;

import org.apache.log4j.Logger;

import org.junit.Test;

import static org.apache.log4j.Logger.getLogger;

import com.strider.datadefender.anonymizer.DatabaseAnonymizerException;

import junit.framework.TestCase;

/**
 * @author Armenak Grigoryan
 */
public class UtilsTest extends TestCase {

    /**
     * Initializes logger
     */
    private static final Logger log                = getLogger(UtilsTest.class);
    private static final String FULL_CLASS_NAME    = "com.strider.datadefender.functions.CoreFunctions";
    private static final String EXPECTED_RESULTS_1 = "com.strider.datadefender.functions";
    private static final String EXPECTED_RESULTS_2 = "CoreFunctions";

    public UtilsTest(final String testName) {
        super(testName);
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    /**
     * Test of getClassName method, of class Utils.
     * @throws com.strider.datadefender.anonymizer.DatabaseAnonymizerException
     */
    @Test
    public void testGetClassName() throws DatabaseAnonymizerException {
        log.info("Executing testGetClassName ...");
        log.debug("Parameter: " + FULL_CLASS_NAME);
        log.debug("Expected result:" + EXPECTED_RESULTS_1);

        final String result = Utils.getClassName(FULL_CLASS_NAME);

        assertEquals(EXPECTED_RESULTS_1, result);
    }

    /**
     * Test of getMethodName method, of class Utils.
     * @throws com.strider.datadefender.anonymizer.DatabaseAnonymizerException
     */
    @Test
    public void testGetMethodName() throws DatabaseAnonymizerException {
        log.debug("Parameter: " + FULL_CLASS_NAME);
        log.debug("Expected result:" + EXPECTED_RESULTS_2);

        final String result = Utils.getMethodName(FULL_CLASS_NAME);

        assertEquals(EXPECTED_RESULTS_2, result);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }
}


//~ Formatted by Jindent --- http://www.jindent.com

@@ -1,14 +1,11 @@
 /*%0A
- *%0A
  * Copyr
@@ -707,18 +707,12 @@
 ls.%0A
- *%0A
  */%0A
-%0A%0A%0A
 pack
@@ -756,115 +756,8 @@
 s;%0A%0A
-import org.apache.log4j.Logger;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.apache.log4j.Logger.getLogger;%0A%0A
 impo
@@ -836,32 +836,84 @@
 ort 
+org.
 junit.
-framework.TestCase
+jupiter.api.Test;%0Aimport static org.junit.jupiter.api.Assertions.*
 ;%0A%0A/
@@ -975,25 +975,8 @@
 est 
-extends TestCase 
 %7B%0A%0A 
@@ -1032,96 +1032,8 @@
 ate 
-static final Logger log                = getLogger(UtilsTest.class);%0A    private static 
 fina
@@ -1080,32 +1080,43 @@
 er.datadefender.
+anonymizer.
 functions.CoreFu
@@ -1113,25 +1113,16 @@
 ons.Core
-Functions
 %22;%0A    p
@@ -1120,39 +1120,32 @@
 e%22;%0A    private 
-static 
 final String EXP
@@ -1197,16 +1197,26 @@
 unctions
+.functions
 %22;%0A    p
@@ -1222,23 +1222,16 @@
 private 
-static 
 final St
@@ -1265,341 +1265,11 @@
 Core
-Functions%22;%0A%0A    public UtilsTest(final String testName) %7B%0A        super(testName);%0A    %7D%0A%0A    @Override%0A    protected void tearDown() throws Exception %7B%0A        super.tearDown();%0A    %7D%0A%0A    /**%0A     * Test of getClassName method, of class Utils.%0A     * @throws com.strider.datadefender.anonymizer.DatabaseAnonymizerException%0A     */
+%22;%0A
 %0A   
@@ -1317,34 +1317,16 @@
  throws 
-DatabaseAnonymizer
 Exceptio
@@ -1341,16 +1341,26 @@
     
-log.info
+System.out.println
 (%22Ex
@@ -1387,129 +1387,15 @@
 Name
- 
 ...%22);%0A
-        log.debug(%22Parameter: %22 + FULL_CLASS_NAME);%0A        log.debug(%22Expected result:%22 + EXPECTED_RESULTS_1);%0A%0A
     
@@ -1449,33 +1449,32 @@
 LL_CLASS_NAME);%0A
-%0A
         assertEq
@@ -1518,156 +1518,8 @@
  %7D%0A%0A
-    /**%0A     * Test of getMethodName method, of class Utils.%0A     * @throws com.strider.datadefender.anonymizer.DatabaseAnonymizerException%0A     */%0A
     
@@ -1609,113 +1609,62 @@
     
-log.debug(%22Parameter: %22 + FULL_CLASS_NAME);%0A        log.debug
+System.out.println
 (%22Ex
-p
 ec
-ted result:%22 + EXPECTED_RESULTS_2
+uting testGetMethodName...%22
 );%0A
-%0A
     
@@ -1727,17 +1727,16 @@
 _NAME);%0A
-%0A
         
@@ -1787,150 +1787,6 @@
   %7D%0A
-%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A    %7D%0A%7D%0A%0A%0A//~ Formatted by Jindent --- http://www.jindent.com
+%7D
 %0A

Fix UtilsTest