Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimomulloy committed Jun 5, 2023
1 parent 9a7f4bd commit 7cd3fb5
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 432 deletions.
2 changes: 1 addition & 1 deletion instrument-aws/instrument-s3handler-st/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
Expand Down
4 changes: 1 addition & 3 deletions instrument-command/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
<version>${surefire-plugin.version}</version>
<configuration>
<systemProperties>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemProperties>
</configuration>
</plugin>
Expand Down Expand Up @@ -212,8 +211,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down
71 changes: 30 additions & 41 deletions instrument-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,76 +26,74 @@
<maven.compiler.parameters>true</maven.compiler.parameters>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.0.3.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
<client.version>1.0.0</client.version>
<exec.maven.plugin.version>1.6.0</exec.maven.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<quarkus-plugin.version>${quarkus.platform.version}</quarkus-plugin.version>
<jakarta.jakartaee-api.version>10.0.0</jakarta.jakartaee-api.version>
<microprofile.version>3.0.3</microprofile.version>
<microprofile.version>3.3</microprofile.version>
<weld-se-core>5.1.0.Final</weld-se-core>
<weld-junit5>4.0.0.Final</weld-junit5>
<junit-jupiter>5.6.2</junit-jupiter>
<mockito-core>5.3.1</mockito-core>
<jmc.common>8.3.0</jmc.common>
<commons-lang3>3.12.0</commons-lang3>
<commons-math3>3.6.1</commons-math3>
<jandex-maven-plugin.version>1.2.3</jandex-maven-plugin.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${jakarta.jakartaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>${microprofile.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-junit5</artifactId>
<version>${weld-junit5}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
<scope>provided</scope>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>${weld-se-core}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmc</groupId>
<artifactId>common</artifactId>
<version>8.3.0</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
<scope>provided</scope>
<version>${jmc.common}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
<version>${commons-math3}</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
Expand All @@ -122,45 +120,37 @@
<artifactId>tritonus-share</artifactId>
<version>0.3.7.4</version>
</dependency>

<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>tritonus-all</artifactId>
<version>0.3.7.2</version>
</dependency>

<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>jlayer</artifactId>
<version>1.0.1.4</version>
</dependency>

<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>mp3spi</artifactId>
<version>1.9.5.4</version>
</dependency>

<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>jorbis</artifactId>
<version>0.0.17.4</version>
</dependency>

<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>vorbisspi</artifactId>
<version>1.0.3.3</version>
</dependency>

<dependency>
<groupId>com.github.psambit9791</groupId>
<artifactId>jdsp</artifactId>
<version>2.0.1</version>
</dependency>
<!--dependency> <groupId>jomuddlo</groupId> <artifactId>tarsos</artifactId>
<version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/library/TarsosDSP-2.4.jar</systemPath>
</dependency -->

</dependencies>

<build>
Expand All @@ -179,7 +169,6 @@
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
Expand Down
2 changes: 0 additions & 2 deletions instrument-core/src/main/java/jomu/instrument/Instrument.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.logging.Logger;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;
import jakarta.inject.Inject;
import jomu.instrument.control.Controller;
import jomu.instrument.control.Coordinator;
Expand All @@ -23,7 +22,6 @@
* @author Jim O'Mulloy
*/
@ApplicationScoped
@Default
public class Instrument implements Organ, InstrumentFactory {

private static final Logger LOG = Logger.getLogger(Instrument.class.getName());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package jomu.instrument.actuation;

import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Logger;

import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiUnavailableException;

import io.vertx.core.impl.ConcurrentHashSet;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jomu.instrument.InstrumentException;
Expand Down Expand Up @@ -55,7 +55,7 @@ public class Voice implements Organ {

ConcurrentLinkedQueue<SendMessage> smq = new ConcurrentLinkedQueue<>();

Set<String> deadStreams = new ConcurrentHashSet<>();
Set<String> deadStreams = ConcurrentHashMap.newKeySet();

public AudioSynthesizer buildAudioSynthesizer() {
audioSynthesizer = new TarsosAudioSynthesizer(parameterManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import javax.sound.midi.Synthesizer;
import javax.sound.midi.Track;

import io.quarkus.runtime.StartupEvent;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.Startup;
import jakarta.inject.Inject;
import jomu.instrument.InstrumentException;
import jomu.instrument.cognition.cell.Cell.CellTypes;
Expand Down Expand Up @@ -137,7 +137,7 @@ public class MidiSynthesizer implements ToneMapConstants {

boolean synthesizerRunning = false;

public void onStartup(@Observes StartupEvent startupEvent) {
public void onStartup(@Observes Startup startupEvent) {
Runtime.getRuntime().addShutdownHook(new Thread() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ public void accept(List<NuMessage> messages) throws InstrumentException {
ToneTimeFrame currentFrame = onsetToneMap.getTimeFrame(sequence);
ToneTimeFrame previousFrame = cqToneMap.getTimeFrame(sequence - 1);
currentFrame.onsetEdge(previousFrame, (double) onsetEdgeFactor / 100.0);
}

if (sequence > onsetPeaksSweep) {
ToneTimeFrame currentFrame = onsetToneMap.getTimeFrame(sequence);
ToneTimeFrame previousFrame = onsetToneMap.getTimeFrame(sequence - 1);
currentFrame.onsetPeaks(previousFrame, onsetPeaksEdgeFactor, onsetPeaksSweep, onsetPeaksThreshold);
if (sequence > onsetPeaksSweep) {
currentFrame = onsetToneMap.getTimeFrame(sequence);
previousFrame = onsetToneMap.getTimeFrame(sequence - 1);
currentFrame.onsetPeaks(previousFrame, onsetPeaksEdgeFactor, onsetPeaksSweep, onsetPeaksThreshold);
}
}

ToneTimeFrame ottf = onsetToneMap.getTimeFrame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import java.util.Properties;
import java.util.logging.Logger;

import io.quarkus.runtime.StartupEvent;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.Startup;
import jomu.instrument.InstrumentException;

@ApplicationScoped
Expand All @@ -25,7 +25,7 @@ public class ParameterManager {
Properties parameters = new Properties();
ParameterValidator parameterValidator = new ParameterValidator();

public void onStartup(@Observes StartupEvent startupEvent) {
public void onStartup(@Observes Startup startupEvent) {
reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@

import static org.junit.jupiter.api.Assertions.assertFalse;

import org.jboss.weld.junit5.EnableWeld;
import org.jboss.weld.junit5.WeldInitiator;
import org.jboss.weld.junit5.WeldSetup;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import jomu.instrument.Instrument;
import jomu.instrument.workspace.Atlas;
import jomu.instrument.workspace.tonemap.ToneMap;

@QuarkusTest
@EnableWeld
class AudioTunerTest {

ToneMap toneMap;

@WeldSetup // This tells weld to consider only Bar, nothing else
WeldInitiator weld = WeldInitiator.performDefaultDiscovery();

@Inject
Instrument instrument;

Expand All @@ -25,6 +30,7 @@ class AudioTunerTest {

@BeforeEach
public void init() {
System.out.println(">>Weld test");
Instrument.setInstance(instrument);
instrument.initialise();
instrument.start();
Expand Down
4 changes: 2 additions & 2 deletions instrument-desktop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<version>${surefire-plugin.version}</version>
<configuration>
<systemProperties>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemProperties>
</configuration>
</plugin>
Expand Down Expand Up @@ -219,7 +219,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jomu.instrument.monitor;
package jomu.instrument.desktop.control;

import jakarta.enterprise.context.ApplicationScoped;
import jomu.instrument.desktop.monitor.DemoMetrics;

@ApplicationScoped
public class DemoMetricsScheduler {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jomu.instrument.control;
package jomu.instrument.desktop.control;

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package jomu.instrument.monitor;
package jomu.instrument.desktop.monitor;

import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;

import io.micrometer.core.instrument.Counter;
Expand Down
Loading

0 comments on commit 7cd3fb5

Please sign in to comment.