|
| 1 | +/* |
| 2 | + * matrix-java-sdk - Matrix Client SDK for Java |
| 3 | + * Copyright (C) 2017 Arne Augenstein |
| 4 | + * |
| 5 | + * https://max.kamax.io/ |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU Affero General Public License as |
| 9 | + * published by the Free Software Foundation, either version 3 of the |
| 10 | + * License, or (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU Affero General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Affero General Public License |
| 18 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | +package io.kamax.matrix; |
| 21 | + |
| 22 | +import org.junit.Assert; |
| 23 | +import org.junit.Test; |
| 24 | +import org.slf4j.Logger; |
| 25 | +import org.slf4j.LoggerFactory; |
| 26 | +import org.slf4j.helpers.NOPLoggerFactory; |
| 27 | + |
| 28 | +import java.net.URISyntaxException; |
| 29 | + |
| 30 | +/** |
| 31 | + * A small test class, intended to verify that the logging framework has |
| 32 | + * a suitable logging implementation. |
| 33 | + */ |
| 34 | +public class LoggingDependencyTest { |
| 35 | + @Test |
| 36 | + public void login() throws URISyntaxException { |
| 37 | + if (LoggerFactory.getILoggerFactory() instanceof NOPLoggerFactory) { |
| 38 | + Assert.fail("No logging implementation found, using fallback NOP logger"); |
| 39 | + } |
| 40 | + Logger logger = LoggerFactory.getLogger(""); |
| 41 | + logger.info("If you see this info in the logger, everything is alright"); |
| 42 | + } |
| 43 | +} |
0 commit comments