svn commit: r20672 - /release/commons/KEYS
Author: sebb Date: Sun Jul 30 13:44:23 2017 New Revision: 20672 Log: Make the warning more obvious Modified: release/commons/KEYS Modified: release/commons/KEYS == --- release/commons/KEYS (original) +++ release/commons/KEYS Sun Jul 30 13:44:23 2017 @@ -1,3 +1,19 @@ + PLEASE NOTE ** + +Edit this file in SVN at +https://dist.apache.org/repos/dist/release/commons/KEYS + +N.B. use a command such as the following to check it out without downloading every Commons project: +svn co --depth=files https://dist.apache.org/repos/dist/release/commons/ + +DO NOT DELETE A KEY FROM THIS FILE if +it has ever been used for signing/counter-signing a Commons release + +This file should contain all keys ever used to sign/counter-sign a Commons Release +Please only add new keys that are used for such purposes. + + + This file contains the PGP and GPG keys of Apache Commons developers. Please don't use them for email unless you have to. Their main purpose is code signing.
svn commit: r1803412 - /commons/proper/codec/trunk/.travis.yml
Author: pascalschumacher Date: Sun Jul 30 09:02:00 2017 New Revision: 1803412 URL: http://svn.apache.org/viewvc?rev=1803412=rev Log: .travis.yml: remove oraclejdk7 (no longer available) and add openjdk6 (side-effects: close #1, close #4) Modified: commons/proper/codec/trunk/.travis.yml Modified: commons/proper/codec/trunk/.travis.yml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/.travis.yml?rev=1803412=1803411=1803412=diff == --- commons/proper/codec/trunk/.travis.yml (original) +++ commons/proper/codec/trunk/.travis.yml Sun Jul 30 09:02:00 2017 @@ -17,8 +17,8 @@ language: java sudo: false jdk: + - openjdk6 - openjdk7 - - oraclejdk7 - oraclejdk8 after_success:
svn commit: r1803411 - /commons/proper/validator/trunk/.travis.yml
Author: pascalschumacher Date: Sun Jul 30 08:57:07 2017 New Revision: 1803411 URL: http://svn.apache.org/viewvc?rev=1803411=rev Log: .travis.yml: remove oraclejdk7 (no longer available) and add openjdk6 Modified: commons/proper/validator/trunk/.travis.yml Modified: commons/proper/validator/trunk/.travis.yml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/.travis.yml?rev=1803411=1803410=1803411=diff == --- commons/proper/validator/trunk/.travis.yml (original) +++ commons/proper/validator/trunk/.travis.yml Sun Jul 30 08:57:07 2017 @@ -17,8 +17,8 @@ language: java sudo: false jdk: + - openjdk6 - openjdk7 - - oraclejdk7 - oraclejdk8 after_success:
svn commit: r1803410 - /commons/proper/net/trunk/.travis.yml
Author: pascalschumacher Date: Sun Jul 30 08:54:53 2017 New Revision: 1803410 URL: http://svn.apache.org/viewvc?rev=1803410=rev Log: .travis.yml: remove oraclejdk7 (no longer available) and add openjdk6 Modified: commons/proper/net/trunk/.travis.yml Modified: commons/proper/net/trunk/.travis.yml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/.travis.yml?rev=1803410=1803409=1803410=diff == --- commons/proper/net/trunk/.travis.yml (original) +++ commons/proper/net/trunk/.travis.yml Sun Jul 30 08:54:53 2017 @@ -17,8 +17,8 @@ language: java sudo: false jdk: + - openjdk6 - openjdk7 - - oraclejdk7 - oraclejdk8 after_success:
svn commit: r1803409 - /commons/proper/bcel/trunk/.travis.yml
Author: pascalschumacher Date: Sun Jul 30 08:51:03 2017 New Revision: 1803409 URL: http://svn.apache.org/viewvc?rev=1803409=rev Log: Remove oraclejdk7 from travis configuration, because it is no longer available. see: https://github.com/travis-ci/travis-ci/issues/7964#issuecomment-316769421 for details Modified: commons/proper/bcel/trunk/.travis.yml Modified: commons/proper/bcel/trunk/.travis.yml URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/.travis.yml?rev=1803409=1803408=1803409=diff == --- commons/proper/bcel/trunk/.travis.yml (original) +++ commons/proper/bcel/trunk/.travis.yml Sun Jul 30 08:51:03 2017 @@ -18,7 +18,6 @@ sudo: false jdk: - openjdk7 - - oraclejdk7 - oraclejdk8 after_success:
svn commit: r1803407 - /commons/proper/beanutils/trunk/.travis.yml
Author: pascalschumacher Date: Sun Jul 30 08:48:39 2017 New Revision: 1803407 URL: http://svn.apache.org/viewvc?rev=1803407=rev Log: .travis.yml: remove oraclejdk7 (no longer available) and add openjdk6 Modified: commons/proper/beanutils/trunk/.travis.yml Modified: commons/proper/beanutils/trunk/.travis.yml URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/.travis.yml?rev=1803407=1803406=1803407=diff == --- commons/proper/beanutils/trunk/.travis.yml (original) +++ commons/proper/beanutils/trunk/.travis.yml Sun Jul 30 08:48:39 2017 @@ -17,8 +17,8 @@ language: java sudo: false jdk: + - openjdk6 - openjdk7 - - oraclejdk7 - oraclejdk8 after_success:
[text] add tests (closes #58)
Repository: commons-text Updated Branches: refs/heads/master 986787042 -> 998764ebe add tests (closes #58) Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/998764eb Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/998764eb Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/998764eb Branch: refs/heads/master Commit: 998764ebe38113eb51e6850058ca01936625dd92 Parents: 9867870 Author: Michael HauseggerAuthored: Sun Jul 30 10:33:48 2017 +0200 Committer: Pascal Schumacher Committed: Sun Jul 30 10:33:48 2017 +0200 -- .../commons/text/RandomStringGeneratorTest.java | 10 .../apache/commons/text/StrTokenizerTest.java | 8 +++ .../text/similarity/CosineSimilarityTest.java | 61 .../similarity/SimilarityScoreFromTest.java | 39 + .../translate/NumericEntityUnescaperTest.java | 16 + 5 files changed, 134 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/998764eb/src/test/java/org/apache/commons/text/RandomStringGeneratorTest.java -- diff --git a/src/test/java/org/apache/commons/text/RandomStringGeneratorTest.java b/src/test/java/org/apache/commons/text/RandomStringGeneratorTest.java index 4d6e699..0141f78 100644 --- a/src/test/java/org/apache/commons/text/RandomStringGeneratorTest.java +++ b/src/test/java/org/apache/commons/text/RandomStringGeneratorTest.java @@ -251,4 +251,14 @@ public class RandomStringGeneratorTest { assertTrue(str.indexOf(c) != -1); } } + +@Test(expected=NullPointerException.class) +public void testGenerateTakingIntThrowsNullPointerException() { +RandomStringGenerator.Builder randomStringGeneratorBuilder = new RandomStringGenerator.Builder(); +CharacterPredicate[] characterPredicateArray = new CharacterPredicate[2]; +randomStringGeneratorBuilder.filteredBy(characterPredicateArray); +RandomStringGenerator randomStringGenerator = randomStringGeneratorBuilder.build(); + +randomStringGenerator.generate(18); +} } http://git-wip-us.apache.org/repos/asf/commons-text/blob/998764eb/src/test/java/org/apache/commons/text/StrTokenizerTest.java -- diff --git a/src/test/java/org/apache/commons/text/StrTokenizerTest.java b/src/test/java/org/apache/commons/text/StrTokenizerTest.java index 8f870d1..285ba26 100644 --- a/src/test/java/org/apache/commons/text/StrTokenizerTest.java +++ b/src/test/java/org/apache/commons/text/StrTokenizerTest.java @@ -935,4 +935,12 @@ public class StrTokenizerTest { final StrTokenizer tokens= new StrTokenizer(chars, StrMatcher.commaMatcher(), StrMatcher.quoteMatcher()); assertEquals("acd", tokens.next()); } + +@Test +public void testPreviousTokenAndSetEmptyTokenAsNull() { +StrTokenizer strTokenizer = StrTokenizer.getTSVInstance(" \t\n\r\f"); +strTokenizer.setEmptyTokenAsNull(true); + +assertNull(strTokenizer.previousToken()); +} } http://git-wip-us.apache.org/repos/asf/commons-text/blob/998764eb/src/test/java/org/apache/commons/text/similarity/CosineSimilarityTest.java -- diff --git a/src/test/java/org/apache/commons/text/similarity/CosineSimilarityTest.java b/src/test/java/org/apache/commons/text/similarity/CosineSimilarityTest.java new file mode 100644 index 000..059c3f6 --- /dev/null +++ b/src/test/java/org/apache/commons/text/similarity/CosineSimilarityTest.java @@ -0,0 +1,61 @@ +/* + * 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.commons.text.similarity; + +import org.junit.Test; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + + +public class CosineSimilarityTest{ + +@Test +public void