Merge remote-tracking branch 'nresare/testlib-tests'
Signed-off-by: Mikolaj Izdebski <mizdebsk@redhat.com> Conflicts: guava.spec
This commit is contained in:
commit
3ce79053e8
33
guava-jdk8-HashMap-testfix.patch
Normal file
33
guava-jdk8-HashMap-testfix.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
diff -ur guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java guava-18.0/guava/src/com/google/common/collect/Maps.java
|
||||||
|
--- guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java 2014-08-25 18:39:22.000000000 +0000
|
||||||
|
+++ guava-18.0/guava/src/com/google/common/collect/Maps.java 2015-06-03 21:02:12.498000000 +0000
|
||||||
|
@@ -206,11 +206,15 @@
|
||||||
|
return expectedSize + 1;
|
||||||
|
}
|
||||||
|
if (expectedSize < Ints.MAX_POWER_OF_TWO) {
|
||||||
|
- return expectedSize + expectedSize / 3;
|
||||||
|
+ // This is the calculation used in JDK8 to resize when a putAll
|
||||||
|
+ // happens; it seems to be the most conservative calculation we
|
||||||
|
+ // can make. 0.75 is the default load factor.
|
||||||
|
+ return (int) ((float) expectedSize / 0.75F + 1.0F);
|
||||||
|
}
|
||||||
|
return Integer.MAX_VALUE; // any large value
|
||||||
|
}
|
||||||
|
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* Creates a <i>mutable</i> {@code HashMap} instance with the same mappings as
|
||||||
|
* the specified map.
|
||||||
|
diff -ur guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java
|
||||||
|
--- guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java 2014-08-25 18:39:22.000000000 +0000
|
||||||
|
+++ guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java 2015-06-03 21:04:15.463000000 +0000
|
||||||
|
@@ -156,7 +156,8 @@
|
||||||
|
Field tableField = HashMap.class.getDeclaredField("table");
|
||||||
|
tableField.setAccessible(true);
|
||||||
|
Object[] table = (Object[]) tableField.get(hashMap);
|
||||||
|
- return table.length;
|
||||||
|
+ // In JDK8, table is set lazily, so it may be null.
|
||||||
|
+ return table == null ? 0 : table.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCapacityForLargeSizes() {
|
35
guava.spec
35
guava.spec
@ -1,19 +1,23 @@
|
|||||||
Name: guava
|
Name: guava
|
||||||
Version: 18.0
|
Version: 18.0
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: Google Core Libraries for Java
|
Summary: Google Core Libraries for Java
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/google/guava
|
URL: https://github.com/google/guava
|
||||||
|
|
||||||
Source0: https://github.com/google/guava/archive/v%{version}.tar.gz
|
Source0: https://github.com/google/guava/archive/v%{version}.tar.gz
|
||||||
Patch0: %{name}-java8.patch
|
Patch0: %{name}-java8.patch
|
||||||
|
Patch1: guava-jdk8-HashMap-testfix.patch
|
||||||
|
|
||||||
BuildRequires: java-devel >= 0:1.7.0
|
BuildRequires: java-devel >= 0:1.7.0
|
||||||
BuildRequires: maven-local
|
BuildRequires: maven-local
|
||||||
|
BuildRequires: truth
|
||||||
|
|
||||||
BuildRequires: mvn(com.google.code.findbugs:jsr305) >= 0-0.6.20090319svn
|
BuildRequires: mvn(com.google.code.findbugs:jsr305) >= 0-0.6.20090319svn
|
||||||
BuildRequires: ant
|
BuildRequires: ant
|
||||||
BuildRequires: apache-ivy
|
BuildRequires: apache-ivy
|
||||||
|
BuildRequires: easymock
|
||||||
|
BuildRequires: mockito
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -34,20 +38,28 @@ Summary: Javadoc for %{name}
|
|||||||
%description javadoc
|
%description javadoc
|
||||||
API documentation for %{name}.
|
API documentation for %{name}.
|
||||||
|
|
||||||
|
%package testlib
|
||||||
|
Summary: The guava-testlib subartefact
|
||||||
|
|
||||||
|
%description testlib
|
||||||
|
guava-testlib provides additional functionality for conveinent unit testing
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
find . -name '*.jar' -delete
|
find . -name '*.jar' -delete
|
||||||
|
|
||||||
%pom_disable_module guava-gwt
|
%pom_disable_module guava-gwt
|
||||||
%pom_disable_module guava-testlib
|
%pom_remove_plugin -r :animal-sniffer-maven-plugin
|
||||||
%pom_disable_module guava-tests
|
|
||||||
%pom_remove_plugin :animal-sniffer-maven-plugin guava
|
|
||||||
%pom_remove_plugin :maven-gpg-plugin
|
%pom_remove_plugin :maven-gpg-plugin
|
||||||
%pom_remove_dep jdk:srczip guava
|
%pom_remove_dep jdk:srczip guava
|
||||||
|
%pom_remove_dep :caliper guava-tests
|
||||||
|
%mvn_package :guava-parent guava
|
||||||
|
%mvn_package :guava-tests __noinstall
|
||||||
|
|
||||||
# javadoc generation fails due to strict doclint in JDK 8
|
# javadoc generation fails due to strict doclint in JDK 1.8.0_45
|
||||||
%pom_remove_plugin :maven-javadoc-plugin guava
|
%pom_remove_plugin -r :maven-javadoc-plugin
|
||||||
|
|
||||||
%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true</_nouses>" guava/pom.xml
|
%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true</_nouses>" guava/pom.xml
|
||||||
|
|
||||||
@ -55,19 +67,26 @@ find . -name '*.jar' -delete
|
|||||||
|
|
||||||
%mvn_file :%{name} %{name}
|
%mvn_file :%{name} %{name}
|
||||||
%mvn_alias :%{name} com.google.collections:google-collections com.google.guava:guava-jdk5
|
%mvn_alias :%{name} com.google.collections:google-collections com.google.guava:guava-jdk5
|
||||||
%mvn_build
|
%mvn_build -s
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%mvn_install
|
%mvn_install
|
||||||
|
|
||||||
%files -f .mfiles
|
%files -f .mfiles-guava
|
||||||
%doc AUTHORS CONTRIBUTORS README*
|
%doc AUTHORS CONTRIBUTORS README*
|
||||||
%license COPYING
|
%license COPYING
|
||||||
|
|
||||||
%files javadoc -f .mfiles-javadoc
|
%files javadoc -f .mfiles-javadoc
|
||||||
%license COPYING
|
%license COPYING
|
||||||
|
|
||||||
|
%files testlib -f .mfiles-guava-testlib
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 22 2015 Noa Resare <noa@resare.com> - 18.0-5
|
||||||
|
- enable module guava-testlib
|
||||||
|
- enable tests in guava-testlib
|
||||||
|
- backport fix to HashMap related test from 19.0-SNAPSHOT
|
||||||
|
|
||||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 18.0-4
|
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 18.0-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user