Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unit test failed #770

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import java.time.ZoneId;
import java.util.List;
import java.util.Locale;

import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
Expand Down Expand Up @@ -44,13 +45,18 @@ public void start() {
zoneId = ZoneId.of(zoneIdString);
}

Locale locale = null;
if (optionList != null && optionList.size() > 2) {
String localeIdStr = optionList.get(2);
locale = Locale.forLanguageTag(localeIdStr);
}

try {
cachingDateFormatter = new CachingDateFormatter(datePattern, zoneId);
// maximumCacheValidity = CachedDateFormat.getMaximumCacheValidity(pattern);
cachingDateFormatter = new CachingDateFormatter(datePattern, zoneId, locale);
} catch (IllegalArgumentException e) {
addWarn("Could not instantiate SimpleDateFormat with pattern " + datePattern, e);
addWarn("Defaulting to " + CoreConstants.CLF_DATE_PATTERN);
cachingDateFormatter = new CachingDateFormatter(CoreConstants.CLF_DATE_PATTERN, zoneId);
cachingDateFormatter = new CachingDateFormatter(CoreConstants.CLF_DATE_PATTERN, zoneId, locale);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testDateConverter() {
@Test
public void testDateConverter_AU_locale() {
DateConverter converter = new DateConverter();
List<String> optionsList = Lists.list(CoreConstants.CLF_DATE_PATTERN, "Australia/Sydney", "en-AU");
List<String> optionsList = Lists.list(CoreConstants.CLF_DATE_PATTERN, "Australia/Sydney", "en_AU");

converter.setOptionList(optionsList);
converter.start();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* LOGBack: the reliable, fast and flexible logging library for Java.
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
*
* Copyright (C) 1999-2005, QOS.ch, LOGBack.com
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* This library 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.
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic;

import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* LOGBack: the reliable, fast and flexible logging library for Java.
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* Copyright (C) 1999-2005, QOS.ch, LOGBack.com
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* This library 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.
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* LOGBack: the reliable, fast and flexible logging library for Java.
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* Copyright (C) 1999-2005, QOS.ch, LOGBack.com
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* This library 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.
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* LOGBack: the reliable, fast and flexible logging library for Java.
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* Copyright (C) 1999-2006, QOS.ch
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* This library 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.
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic.pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/**
* LOGBack: the reliable, fast and flexible logging library for Java.
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* Copyright (C) 1999-2005, QOS.ch, LOGBack.com
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* This library 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.
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.classic.pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.reflect;

public class Fruit {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.reflect;

import org.apache.commons.jexl.Expression;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.reflect;

import org.codehaus.janino.ExpressionEvaluator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package ch.qos.logback.reflect;

import java.lang.reflect.InvocationTargetException;
Expand Down
8 changes: 0 additions & 8 deletions logback-core/src/test/input/compress3.copy
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@

LOGBack: the generic, reliable, fast and flexible logging framework.

Copyright (C) 1999-2006, QOS.ch

This library 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.
<?xml version="1.0"?>
<document>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public void dailySizeBasedRolloverWithSizeCap() {
// 2016-03-05 00:14:39 CET
long simulatedTime = 1457133279186L;
ConfigParameters params = new ConfigParameters(simulatedTime);
String fileNamePattern = randomOutputDir + "/%d{" + DAILY_DATE_PATTERN + "}-clean.%i";
String fileNamePattern = randomOutputDir + "/%d{" + DAILY_DATE_PATTERN + ", CET}-clean.%i";
params.maxHistory(60).fileNamePattern(fileNamePattern).simulatedNumberOfPeriods(10).sizeCap(sizeCap);
logOverMultiplePeriods(params);

Expand Down