Skip to content

Commit daeb4dc

Browse files
chore: resolve upstream merge conflicts
2 parents a1dd311 + 44e3c31 commit daeb4dc

File tree

879 files changed

+30715
-15290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

879 files changed

+30715
-15290
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,18 @@ Create a sonatype account and update the maven settings.xml file with your sonat
248248

249249
**Prepare the release**
250250
`mvn release:prepare`
251-
In this step will ensure there are no uncommitted changes, ensure the versions number are correct, tag the scm, etc..
252-
A full list of checks is documented [here](https://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html):
251+
In this step will ensure there are no uncommitted changes, ensure the versions number are correct, tag the scm, etc.
252+
A full list of checks is documented [here](https://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html).
253253

254254
**Perform the release**
255-
`mvn release:perform`
256-
Checkout the release tag, build, sign and push the build binaries to sonatype.
255+
`mvn -Pdocs release:perform`
256+
Checkout the release tag, build, sign and push the build binaries to sonatype. The `docs` profile is needed in order
257+
to create required javadocs jars.
257258

258259
**Publish**
259260
Open the staging repository in [sonatype](https://s01.oss.sonatype.org/#stagingRepositories) and hit the *publish* button
260261

261262
**Note:**
262263
In order to keep the ant and maven builds in sync, before the prepare:release update the `version` in the
263264
dependencies\ant_settings.xml to match the release version number. After the release is completed the `version` should
264-
updated to match the next development snapshot version.
265+
updated to match the next development snapshotData version.

app/3d-viewer/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
<parent>
44
<groupId>org.phoebus</groupId>
55
<artifactId>app</artifactId>
6-
<version>4.7.1-SNAPSHOT</version>
6+
<version>4.7.2-SNAPSHOT</version>
77
</parent>
88
<artifactId>app-3d-viewer</artifactId>
99
<dependencies>
1010
<dependency>
1111
<groupId>org.phoebus</groupId>
1212
<artifactId>core-ui</artifactId>
13-
<version>4.7.1-SNAPSHOT</version>
13+
<version>4.7.2-SNAPSHOT</version>
1414
</dependency>
1515
<dependency>
1616
<groupId>org.phoebus</groupId>
1717
<artifactId>core-framework</artifactId>
18-
<version>4.7.1-SNAPSHOT</version>
18+
<version>4.7.2-SNAPSHOT</version>
1919
</dependency>
2020
<dependency>
21-
<groupId>junit</groupId>
22-
<artifactId>junit</artifactId>
21+
<groupId>org.junit.jupiter</groupId>
22+
<artifactId>junit-jupiter</artifactId>
2323
<version>${junit.version}</version>
2424
<scope>test</scope>
2525
</dependency>

app/3d-viewer/src/test/java/org/phoebus/app/viewer3d/Viewer3dParserDemo.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
*******************************************************************************/
88
package org.phoebus.app.viewer3d;
99

10-
import static org.junit.Assert.assertEquals;
11-
import static org.junit.Assert.assertTrue;
12-
13-
import java.io.ByteArrayInputStream;
14-
15-
import org.junit.Test;
16-
import org.phoebus.applications.viewer3d.Viewer3d;
17-
import org.phoebus.applications.viewer3d.Xform;
18-
1910
import javafx.application.Platform;
2011
import javafx.scene.paint.Color;
2112
import javafx.scene.paint.PhongMaterial;
2213
import javafx.scene.shape.Sphere;
14+
import org.junit.jupiter.api.Test;
15+
import org.phoebus.applications.viewer3d.Viewer3d;
16+
import org.phoebus.applications.viewer3d.Xform;
17+
18+
import java.io.ByteArrayInputStream;
19+
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
21+
import static org.junit.jupiter.api.Assertions.assertTrue;
2322

2423
/** Demo of 3D parser.
2524
*

app/alarm/Readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ kafka in `/opt/kafka`.
2525
cd examples
2626

2727
# Use wget, 'curl -O', or web browser to fetch a recent version of kafka
28-
wget https://dlcdn.apache.org/kafka/3.2.0/kafka_2.13-3.2.0.tgz
29-
tar -vzxf kafka_2.13-3.2.0.tgz
30-
ln -s kafka_2.13-3.2.0 kafka
28+
wget https://downloads.apache.org/kafka/3.3.1/kafka_2.13-3.3.1.tgz
29+
tar vzxf kafka_2.13-3.3.1.tgz
30+
ln -s kafka_2.13-3.3.1 kafka
3131

3232
Check `config/zookeeper.properties` and `config/server.properties`.
3333
By default these contain settings for keeping data in `/tmp/`, which works for initial tests,
@@ -384,6 +384,8 @@ Demos
384384
`examples/create_alarm_topics.sh Accelerator`
385385
Run to create the topics used by the following demos.
386386

387+
The demos are part of the test package included in the [app/alarm/model](https://github.com/ControlSystemStudio/phoebus/tree/master/app/alarm/model/src/test/java/org/phoebus/applications/alarm) module
388+
387389
`AlarmConfigProducerDemo`: Run to create demo configuration.
388390
Loading a demo config with a total of 100000 PVs arranged into several sub and sub-sub sections
389391
takes less than 5 seconds.

app/alarm/datasource/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<parent>
44
<groupId>org.phoebus</groupId>
55
<artifactId>app-alarm</artifactId>
6-
<version>4.7.1-SNAPSHOT</version>
6+
<version>4.7.2-SNAPSHOT</version>
77
</parent>
88
<artifactId>app-alarm-datasouce</artifactId>
99
<dependencies>
1010
<dependency>
11-
<groupId>junit</groupId>
12-
<artifactId>junit</artifactId>
11+
<groupId>org.junit.jupiter</groupId>
12+
<artifactId>junit-jupiter</artifactId>
1313
<version>${junit.version}</version>
1414
<scope>test</scope>
1515
</dependency>
@@ -22,32 +22,32 @@
2222
<dependency>
2323
<groupId>org.phoebus</groupId>
2424
<artifactId>core-framework</artifactId>
25-
<version>4.7.1-SNAPSHOT</version>
25+
<version>4.7.2-SNAPSHOT</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.phoebus</groupId>
2929
<artifactId>core-types</artifactId>
30-
<version>4.7.1-SNAPSHOT</version>
30+
<version>4.7.2-SNAPSHOT</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.phoebus</groupId>
3434
<artifactId>core-pv</artifactId>
35-
<version>4.7.1-SNAPSHOT</version>
35+
<version>4.7.2-SNAPSHOT</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.phoebus</groupId>
3939
<artifactId>core-util</artifactId>
40-
<version>4.7.1-SNAPSHOT</version>
40+
<version>4.7.2-SNAPSHOT</version>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.phoebus</groupId>
4444
<artifactId>core-ui</artifactId>
45-
<version>4.7.1-SNAPSHOT</version>
45+
<version>4.7.2-SNAPSHOT</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>org.phoebus</groupId>
4949
<artifactId>app-alarm-model</artifactId>
50-
<version>4.7.1-SNAPSHOT</version>
50+
<version>4.7.2-SNAPSHOT</version>
5151
</dependency>
5252
<dependency>
5353
<groupId>net.sf.sociaal</groupId>

app/alarm/datasource/src/main/java/org/phoebus/pv/alarm/AlarmContext.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.util.Iterator;
1717
import java.util.List;
1818
import java.util.Map;
19+
import java.util.Set;
1920
import java.util.logging.Level;
2021

2122
import static org.phoebus.pv.alarm.AlarmPVFactory.logger;
@@ -93,6 +94,8 @@ public static synchronized void releasePV(AlarmPV alarmPV)
9394
pvs.remove(alarmPV.getInfo().getCompletePath());
9495
}
9596
}
97+
98+
shutdownClientIfPossbile(alarmPV);
9699
}
97100

98101
public static synchronized void acknowledgePV(AlarmPV alarmPV, boolean ack)
@@ -297,4 +300,36 @@ static String decodedKafaPath(String path)
297300
{
298301
return path.replace("\\/","/");
299302
}
303+
304+
/**
305+
* Shuts down the alarm client, but only if no other alarm PVs in the same
306+
* alarm configuration are found in the list of registered PVs.
307+
* @param alarmPV Alarm PV
308+
*/
309+
private static void shutdownClientIfPossbile(AlarmPV alarmPV){
310+
String config = alarmPV.getInfo().getRoot();
311+
if(!remainingPVsInConfig(config)){
312+
AlarmClient alarmClient = alarmModels.get(config);
313+
if(alarmClient != null){
314+
alarmClient.shutdown();
315+
alarmModels.remove(config);
316+
}
317+
}
318+
}
319+
320+
/**
321+
* Checks if the list of registered PVs contains any items for the specified
322+
* configuration.
323+
* @param config An alarm configuration name, i.e. root of the {@link AlarmPV} path.
324+
* @return <code>true</code> if additional PVs are found, otherwise <code>false</code>.
325+
*/
326+
private static boolean remainingPVsInConfig(String config){
327+
Set<String> pvNames = pvs.keySet();
328+
for(String pvName : pvNames){
329+
if(pvName.startsWith("/" + config)){
330+
return true;
331+
}
332+
}
333+
return false;
334+
}
300335
}
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.phoebus.pv.alarm;
22

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44

5-
import static org.junit.Assert.assertEquals;
5+
import static org.junit.jupiter.api.Assertions.assertEquals;
66

77
public class AlarmContextTest {
88

@@ -17,9 +17,18 @@ public void testURLEncoding()
1717
String encodedPathWithColon = "OPR/TEST/SR%3Atest%3Apv";
1818
String encodedPathWithDelimiterAndColon = "OPR/TEST/sim%3A%2F%2FSR%3Atest%3Apv";
1919

20-
assertEquals("Failed to encode pv name the delimiter", encodedPathWithDelimiter, AlarmContext.encodedURLPath(pathWithDelimiter));
21-
assertEquals("Failed to encode pv name with colon", encodedPathWithColon, AlarmContext.encodedURLPath(pathWithColon));
22-
assertEquals("Failed to encode pv name with delimiter and colon", encodedPathWithDelimiterAndColon, AlarmContext.encodedURLPath(pathWithDelimiterAndColon));
20+
assertEquals(
21+
encodedPathWithDelimiter,
22+
AlarmContext.encodedURLPath(pathWithDelimiter),
23+
"Failed to encode pv name the delimiter");
24+
assertEquals(
25+
encodedPathWithColon,
26+
AlarmContext.encodedURLPath(pathWithColon),
27+
"Failed to encode pv name with colon");
28+
assertEquals(
29+
encodedPathWithDelimiterAndColon,
30+
AlarmContext.encodedURLPath(pathWithDelimiterAndColon),
31+
"Failed to encode pv name with delimiter and colon");
2332
}
2433

2534
@Test
@@ -33,27 +42,20 @@ public void testURLDecoding()
3342
String encodedPathWithColon = "OPR/TEST/SR%3Atest%3Apv";
3443
String encodedPathWithDelimiterAndColon = "OPR/TEST/sim%3A%2F%2FSR%3Atest%3Apv";
3544

36-
assertEquals("Failed to decode pv name the delimiter", pathWithDelimiter, AlarmContext.decodedURLPath(encodedPathWithDelimiter));
37-
assertEquals("Failed to decode pv name with colon", pathWithColon, AlarmContext.decodedURLPath(encodedPathWithColon));
38-
assertEquals("Failed to decode pv name with delimiter and colon", pathWithDelimiterAndColon, AlarmContext.decodedURLPath(encodedPathWithDelimiterAndColon));
45+
assertEquals(
46+
pathWithDelimiter,
47+
AlarmContext.decodedURLPath(encodedPathWithDelimiter),
48+
"Failed to decode pv name the delimiter");
49+
assertEquals(
50+
pathWithColon,
51+
AlarmContext.decodedURLPath(encodedPathWithColon),
52+
"Failed to decode pv name with colon");
53+
assertEquals(
54+
pathWithDelimiterAndColon,
55+
AlarmContext.decodedURLPath(encodedPathWithDelimiterAndColon),
56+
"Failed to decode pv name with delimiter and colon");
3957
}
4058

41-
// @Test
42-
// public void testKafkaPathEncoding()
43-
// {
44-
// String pathWithDelimiter = "OPR/TEST/sim://test";
45-
// String pathWithColon = "OPR/TEST/SR:test:pv";
46-
// String pathWithDelimiterAndColon = "OPR/TEST/sim://SR:test:pv";
47-
//
48-
// String kafkaPathWithDelimiter = "OPR/TEST/sim:\\/\\/test";
49-
// String kafkaPathWithColon = "OPR/TEST/SR:test:pv";
50-
// String kafkaPathWithDelimiterAndColon = "OPR/TEST/sim:\\/\\/SR:test:pv";
51-
//
52-
// assertEquals("Failed to encode pv kafka path with delimiter", kafkaPathWithDelimiter, AlarmContext.encodedKafkaPath(pathWithDelimiter));
53-
// assertEquals("Failed to encode pv kafka path with colon", kafkaPathWithColon, AlarmContext.encodedKafkaPath(pathWithColon));
54-
// assertEquals("Failed to encode pv kafka path with delimiter and colon", kafkaPathWithDelimiterAndColon, AlarmContext.encodedKafkaPath(pathWithDelimiterAndColon));
55-
// }
56-
5759
@Test
5860
public void testKafkaPathDecoding()
5961
{
@@ -65,8 +67,17 @@ public void testKafkaPathDecoding()
6567
String encodedPathWithColon = "OPR/TEST/SR:test:pv";
6668
String encodedPathWithDelimiterAndColon = "OPR/TEST/sim:\\/\\/SR:test:pv";
6769

68-
assertEquals("Failed to decode pv kafka path the delimiter", pathWithDelimiter, AlarmContext.decodedKafaPath(encodedPathWithDelimiter));
69-
assertEquals("Failed to decode pv kafka path with colon", pathWithColon, AlarmContext.decodedKafaPath(encodedPathWithColon));
70-
assertEquals("Failed to decode pv kafka path with delimiter and colon", pathWithDelimiterAndColon, AlarmContext.decodedKafaPath(encodedPathWithDelimiterAndColon));
70+
assertEquals(
71+
pathWithDelimiter,
72+
AlarmContext.decodedKafaPath(encodedPathWithDelimiter),
73+
"Failed to decode pv kafka path the delimiter");
74+
assertEquals(
75+
pathWithColon,
76+
AlarmContext.decodedKafaPath(encodedPathWithColon),
77+
"Failed to decode pv kafka path with colon");
78+
assertEquals(
79+
pathWithDelimiterAndColon,
80+
AlarmContext.decodedKafaPath(encodedPathWithDelimiterAndColon),
81+
"Failed to decode pv kafka path with delimiter and colon");
7182
}
7283
}

0 commit comments

Comments
 (0)