@@ -0,0 +1,2269 @@
+/*%0A * Copyright 2012 Splunk, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22): you may%0A * not use this file except in compliance with the License. You may obtain%0A * a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.splunk;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class LoggerTest extends SDKTestCase %7B%0A    private static final List%3CString%3E VALID_LEVELS = Arrays.asList(%0A            %22INFO%22, %22WARN%22, %22ERROR%22, %22DEBUG%22, %22CRIT%22);%0A    %0A    // NOTE: Ideally we would create our own logger instead of using an existing%0A    //       one. However there is no REST API call to create a Logger.%0A    private static final String TEST_LOGGER_NAME = %22AuditLogger%22;%0A    %0A    private Logger logger;%0A    private String originalLoggerLevel;%0A    %0A    @Before%0A    @Override%0A    public void setUp() throws Exception %7B%0A        super.setUp();%0A        %0A        logger = service.getLoggers().get(TEST_LOGGER_NAME);%0A        originalLoggerLevel = logger.getLevel();%0A    %7D%0A%0A    @After%0A    @Override%0A    public void tearDown() throws Exception %7B%0A        logger.setLevel(originalLoggerLevel);%0A        %0A        super.tearDown();%0A    %7D%0A    %0A    @Test%0A    public void testDefaultLoggersHaveValidLevels() %7B%0A        for (Logger curLogger : service.getLoggers().values()) %7B%0A            assertTrue(VALID_LEVELS.contains(curLogger.getLevel()));%0A        %7D%0A    %7D%0A    %0A    @Test%0A    public void testLevelSetter() %7B%0A        for (String curLevel : VALID_LEVELS) %7B%0A            logger.setLevel(curLevel);%0A            logger.update();%0A            assertEquals(curLevel, logger.getLevel());%0A        %7D%0A    %7D%0A    %0A    @Test%0A    public void testLevelUpdate() %7B%0A        for (String curLevel : VALID_LEVELS) %7B%0A            logger.update(new Args(%22level%22, curLevel));%0A            assertEquals(curLevel, logger.getLevel());%0A        %7D%0A    %7D%0A%7D%0A

Add improved LoggerTest from the old test suite.