You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2016/01/24 07:29:32 UTC

Fwd: [2/5] logging-log4j2 git commit: Verify that file sizes are parsed correctly.

This one belongs in master for sure.

Gary

---------- Forwarded message ----------
From: <rg...@apache.org>
Date: Sat, Jan 23, 2016 at 9:56 PM
Subject: [2/5] logging-log4j2 git commit: Verify that file sizes are parsed
correctly.
To: commits@logging.apache.org


Verify that file sizes are parsed correctly.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit:
http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c1b8cb85
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c1b8cb85
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c1b8cb85

Branch: refs/heads/LOG4J-1181
Commit: c1b8cb85ca0a5fdde491c02d636b7e7813222b9b
Parents: 419a7b2
Author: Ralph Goers <rg...@apache.org>
Authored: Sat Jan 23 22:38:36 2016 -0700
Committer: Ralph Goers <rg...@apache.org>
Committed: Sat Jan 23 22:38:36 2016 -0700

----------------------------------------------------------------------
 .../core/appender/rolling/FileSizeTest.java     | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c1b8cb85/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
----------------------------------------------------------------------
diff --git
a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
new file mode 100644
index 0000000..4b7b6bb
--- /dev/null
+++
b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.core.appender.rolling;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class FileSizeTest {
+
+    private final static long EXPECTED = 10 * 1024;
+    @Test
+    public void testFileSize() throws Exception {
+
+        long value = FileSize.parse("10KB", 0);
+        assertTrue("unexpected value " + value, value == EXPECTED);
+        value = FileSize.parse("10 KB", 0);
+        assertTrue("unexpected value " + value, value == EXPECTED);
+    }
+}




-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [2/5] logging-log4j2 git commit: Verify that file sizes are parsed correctly.

Posted by Ralph Goers <ra...@dslextreme.com>.
They were all supposed to be on master. I guess I never switched back after looking at the 1181 branch. I usually don’t switch in IntelliJ - I just clone the branch as a new working copy. This will teach me to keep doing that.

Speaking of 1181, I would really like to figure out how to combine the two projects. I am just not sure how to do it since the source is slightly different. Ideas?

Ralph

> On Jan 23, 2016, at 11:29 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
> This one belongs in master for sure.
> 
> Gary
> 
> ---------- Forwarded message ----------
> From: <rgoers@apache.org <ma...@apache.org>>
> Date: Sat, Jan 23, 2016 at 9:56 PM
> Subject: [2/5] logging-log4j2 git commit: Verify that file sizes are parsed correctly.
> To: commits@logging.apache.org <ma...@logging.apache.org>
> 
> 
> Verify that file sizes are parsed correctly.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo <http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo>
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c1b8cb85 <http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c1b8cb85>
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c1b8cb85 <http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c1b8cb85>
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c1b8cb85 <http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c1b8cb85>
> 
> Branch: refs/heads/LOG4J-1181
> Commit: c1b8cb85ca0a5fdde491c02d636b7e7813222b9b
> Parents: 419a7b2
> Author: Ralph Goers <rgoers@apache.org <ma...@apache.org>>
> Authored: Sat Jan 23 22:38:36 2016 -0700
> Committer: Ralph Goers <rgoers@apache.org <ma...@apache.org>>
> Committed: Sat Jan 23 22:38:36 2016 -0700
> 
> ----------------------------------------------------------------------
>  .../core/appender/rolling/FileSizeTest.java     | 36 ++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c1b8cb85/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java <http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c1b8cb85/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java>
> ----------------------------------------------------------------------
> diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
> new file mode 100644
> index 0000000..4b7b6bb
> --- /dev/null
> +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/FileSizeTest.java
> @@ -0,0 +1,36 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements. See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You 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 <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.apache.logging.log4j.core.appender.rolling;
> +
> +import org.junit.Test;
> +import static org.junit.Assert.*;
> +
> +/**
> + *
> + */
> +public class FileSizeTest {
> +
> +    private final static long EXPECTED = 10 * 1024;
> +    @Test
> +    public void testFileSize() throws Exception {
> +
> +        long value = FileSize.parse("10KB", 0);
> +        assertTrue("unexpected value " + value, value == EXPECTED);
> +        value = FileSize.parse("10 KB", 0);
> +        assertTrue("unexpected value " + value, value == EXPECTED);
> +    }
> +}
> 
> 
> 
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>