All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sosy_lab.common.log.PackageSanityTest Maven / Gradle / Ivy

There is a newer version: 0.3000-609-g90a352c
Show newest version
/*
 *  SoSy-Lab Common is a library of useful utilities.
 *  This file is part of SoSy-Lab Common.
 *
 *  Copyright (C) 2007-2015  Dirk Beyer
 *  All rights reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.sosy_lab.common.log;

import com.google.common.base.Predicates;
import com.google.common.testing.AbstractPackageSanityTests;

import org.sosy_lab.common.configuration.Configuration;
import org.sosy_lab.common.configuration.InvalidConfigurationException;

import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.SimpleFormatter;

@SuppressWarnings("deprecation")
public class PackageSanityTest extends AbstractPackageSanityTests {

  {
    setDefault(Handler.class, new StringBuildingLogHandler());
    setDefault(Level.class, Level.ALL);
    setDefault(Formatter.class, new SimpleFormatter());

    setDefault(Configuration.class, Configuration.defaultConfiguration());
    try {
      setDefault(LoggingOptions.class, new LoggingOptions(Configuration.defaultConfiguration()));
    } catch (InvalidConfigurationException e) {
      throw new AssertionError(e);
    }

    // NullLogManager does not do any checkNotNull checks on purpose
    ignoreClasses(Predicates.>equalTo(NullLogManager.class));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy