From 28a9ba06174322a03d2d8d0d719ca28130c0718e Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 8 Aug 2022 12:40:28 -0400 Subject: [PATCH] Import rpm: 12e5d262fc3450cb1d485469469991652a79c357 --- .fmf/version | 1 + .gitignore | 1 + disruptor-3.3.2-jmock.patch | 21 +++++ disruptor-3.4.4.pom | 37 +++++++++ disruptor.spec | 152 ++++++++++++++++++++++++++++++++++++ gating.yaml | 7 ++ plans/Smoke.java | 51 ++++++++++++ plans/smoke.fmf | 8 ++ sources | 1 + 9 files changed, 279 insertions(+) create mode 100644 .fmf/version create mode 100644 .gitignore create mode 100644 disruptor-3.3.2-jmock.patch create mode 100644 disruptor-3.4.4.pom create mode 100644 disruptor.spec create mode 100644 gating.yaml create mode 100644 plans/Smoke.java create mode 100644 plans/smoke.fmf create mode 100644 sources diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da4a35a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/disruptor-3.4.4.tar.gz diff --git a/disruptor-3.3.2-jmock.patch b/disruptor-3.3.2-jmock.patch new file mode 100644 index 0000000..2f4797e --- /dev/null +++ b/disruptor-3.3.2-jmock.patch @@ -0,0 +1,21 @@ +--- disruptor-3.3.2/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java 2015-02-25 10:09:57.000000000 +0100 ++++ disruptor-3.3.2/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java.jmock 2015-06-03 15:52:43.997446568 +0200 +@@ -23,6 +23,7 @@ + import org.jmock.api.Action; + import org.jmock.api.Invocation; + import org.jmock.integration.junit4.JMock; ++import org.jmock.lib.concurrent.Synchroniser; + import org.junit.Test; + import org.junit.runner.RunWith; + +@@ -35,7 +36,9 @@ + @RunWith(JMock.class) + public final class BatchEventProcessorTest + { +- private final Mockery context = new Mockery(); ++ private final Mockery context = new Mockery() {{ ++ setThreadingPolicy(new Synchroniser()); ++ }}; + private final Sequence lifecycleSequence = context.sequence("lifecycleSequence"); + private final CountDownLatch latch = new CountDownLatch(1); + diff --git a/disruptor-3.4.4.pom b/disruptor-3.4.4.pom new file mode 100644 index 0000000..64eea72 --- /dev/null +++ b/disruptor-3.4.4.pom @@ -0,0 +1,37 @@ + + + 4.0.0 + com.lmax + disruptor + 3.4.4 + Disruptor Framework + Disruptor - Concurrent Programming Framework + http://lmax-exchange.github.com/disruptor + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + team + LMAX Disruptor Development Team + lmax-disruptor@googlegroups.com + + + + scm:git@github.com:LMAX-Exchange/disruptor.git + scm:git@github.com:LMAX-Exchange/disruptor.git + + + + junit + junit + 4.12 + test + + + diff --git a/disruptor.spec b/disruptor.spec new file mode 100644 index 0000000..0a33137 --- /dev/null +++ b/disruptor.spec @@ -0,0 +1,152 @@ +Name: disruptor +Version: 3.4.4 +Release: 2%{?dist} +Summary: Concurrent Programming Framework +License: ASL 2.0 +URL: https://lmax-exchange.github.io/disruptor/ +BuildArch: noarch + +Source0: https://github.com/LMAX-Exchange/disruptor/archive/%{version}/%{name}-%{version}.tar.gz +Source1: https://repo1.maven.org/maven2/com/lmax/%{name}/%{version}/%{name}-%{version}.pom + +BuildRequires: maven-local-openjdk8 +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) + +%description +A High Performance Inter-Thread Messaging Library. + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains javadoc for %{name}. + +%prep +%autosetup +# Cleanup +find . -name "*.class" -print -delete +find . -name "*.jar" -type f -print -delete + +cp -p %{SOURCE1} pom.xml + +# Add OSGi support +%pom_xpath_inject "pom:project" "bundle" +%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.3.7 . ' +true + + + %{url} + ${project.name} + LMAX Disruptor Development Team + + + + + bundle-manifest + process-classes + + manifest + + +' + +# fail to compile cause: incompatible hamcrest apis +rm -r src/test/java/com/lmax/disruptor/RingBufferTest.java \ + src/test/java/com/lmax/disruptor/RingBufferEventMatcher.java +# Failed to stop thread: Thread[com.lmax.disruptor.BatchEventProcessor@1d057a39,5,main] +rm -r src/test/java/com/lmax/disruptor/dsl/DisruptorTest.java +# Test fails due to incompatible jmock version +#rm -f src/test/java/com/lmax/disruptor/EventPollerTest.java + +%mvn_file :%{name} %{name} + +%build + +%mvn_build -- -Dproject.build.sourceEncoding=UTF-8 -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 + +%install +%mvn_install + +%files -f .mfiles +%doc README.md +%license LICENCE.txt + +%files javadoc -f .mfiles-javadoc +%license LICENCE.txt + +%changelog +* Wed Feb 23 2022 Mikolaj Izdebski - 3.4.4-2 +- Build with OpenJDK 8 + +* Mon Dec 13 2021 Sérgio Basto - 3.4.4-1 +- Update disruptor to 3.4.4 (#1953941) + +* Wed Jul 21 2021 Fedora Release Engineering - 3.4.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jun 28 2021 Mikolaj Izdebski - 3.4.2-5 +- Remove unneeded buildrequires on jmock and hamcrest + +* Tue Jan 26 2021 Fedora Release Engineering - 3.4.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 3.4.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Jiri Vanek - 3.4.2-2 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Tue May 12 2020 Alexander Scheel - 3.4.2-1 +- Rebase to disruptor upstream release v3.4.2 + +* Tue Jan 28 2020 Fedora Release Engineering - 3.3.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 3.3.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 3.3.6-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 3.3.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 3.3.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 3.3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 3.3.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Nov 11 2016 gil cattaneo 3.3.6-1 +- update to 3.3.6 + +* Thu Jun 23 2016 gil cattaneo 3.3.4-1 +- update to 3.3.4 + +* Wed Feb 03 2016 Fedora Release Engineering - 3.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 3.3.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jun 03 2015 gil cattaneo 3.3.2-2 +- build fix for jmock 2.8.1 + +* Wed Jun 3 2015 Mikolaj Izdebski - 3.3.2-1 +- Update to upstream version 3.3.2 + +* Sun Feb 01 2015 gil cattaneo 3.2.1-3 +- introduce license macro + +* Sat Jun 07 2014 Fedora Release Engineering - 3.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Apr 21 2014 gil cattaneo 3.2.1-1 +- update to 3.2.1 + +* Wed Aug 14 2013 gil cattaneo 3.2.0-1 +- initial rpm diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..f1bb5dd --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - rhel-9 +decision_contexts: + - osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans/Smoke.java b/plans/Smoke.java new file mode 100644 index 0000000..64fa8f7 --- /dev/null +++ b/plans/Smoke.java @@ -0,0 +1,51 @@ +import com.lmax.disruptor.dsl.Disruptor; +import com.lmax.disruptor.EventFactory; +import com.lmax.disruptor.RingBuffer; +import com.lmax.disruptor.util.DaemonThreadFactory; +import java.nio.ByteBuffer; + +class LongEvent +{ + private long value; + + public void set(long value) + { + this.value = value; + } +} + +class LongEventFactory implements EventFactory +{ + public LongEvent newInstance() + { + return new LongEvent(); + } +} + +public class Smoke +{ + public static void main(String[] args) throws Exception + { + System.out.println("SMOKE TEST START"); + + int bufferSize = 1024; + + Disruptor disruptor = + new Disruptor<>(LongEvent::new, bufferSize, DaemonThreadFactory.INSTANCE); + + disruptor.handleEventsWith((event, sequence, endOfBatch) -> + System.out.println("Event: " + event)); + disruptor.start(); + + RingBuffer ringBuffer = disruptor.getRingBuffer(); + ByteBuffer bb = ByteBuffer.allocate(8); + for (long l = 0; l < 10; l++) + { + bb.putLong(0, l); + ringBuffer.publishEvent((event, sequence, buffer) -> event.set(buffer.getLong(0)), bb); + Thread.sleep(100); + } + + System.out.println("SMOKE TEST COMPLETE"); + } +} diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..6b39f3b --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,8 @@ +summary: Basic smoke test +prepare: + how: install + package: java-1.8.0-openjdk-devel +execute: + script: + - /usr/lib/jvm/java-1.8.0-openjdk/bin/javac -cp /usr/share/java/disruptor.jar plans/Smoke.java + - /usr/lib/jvm/java-1.8.0-openjdk/bin/java -cp /usr/share/java/disruptor.jar:plans Smoke diff --git a/sources b/sources new file mode 100644 index 0000000..830924d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (disruptor-3.4.4.tar.gz) = 6027c6014a49499e4b7b831bfb3df916d7192a3a