Skip to content

Commit

Permalink
Merge branch 'develop' into log-offloading-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael7371 committed Nov 3, 2023
2 parents 599790c + 35e4202 commit bcd4c3e
Show file tree
Hide file tree
Showing 188 changed files with 2,243 additions and 933 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ The current version and release history of the JPO-ODE: [ODE Release Notes](<doc
10. [Credits and Acknowledgement](#credits-and-acknowledgement)
11. [Code.gov Registration Info](#codegov-registration-info)
12. [Kubernetes](#kubernetes)
13. Sonar Token Configuration([#Sonar cloud](https://sonarqube.ow2.org/documentation/user-guide/user-token/))
13. [Sonar Cloud](#sonar-token-configuration) ([Documentation](https://sonarcloud.io/documentation/user-guide/user-token/))
14. [SNMP](#snmp)

<!--
#########################################
Expand Down Expand Up @@ -118,9 +119,9 @@ Supported message types:
- Minimum RAM: 16 GB
- Minimum storage space: 100 GB
- Supported operating systems:
- Ubuntu 18.04 Linux (Recommended)
- Windows 10 Professional (Professional version required for Docker virtualization)
- OSX 10 Mojave
- Ubuntu 22.04 Linux (Recommended)
- Windows 10/11 Professional (Professional version required for Docker virtualization)
- OSX 13

The ODE software can run on most standard Window, Mac, or Linux based computers with
Pentium core processors. Performance of the software will be based on the computing power and available RAM in
Expand Down Expand Up @@ -598,23 +599,27 @@ Contact Name: James Lieu

Contact Phone: (202) 366-3000

<a name="kubernetes"/>

## 12. Kubernetes
The ODE can be run in a k8s environment.
See [this document](./docs/Kubernetes.md) for more details about this.

[Back to top](#toc)

<a name="sonar-token-configuration"/>

## 13. Sonar Token Configuration
Generating and Using Tokens
Users can generate tokens that can be used to run analyses or invoke web services without access to the user's actual credentials.

USDOT-JPO-ODE SonarCloud Organization : https://sonarcloud.io/organizations/usdot-jpo-ode-1/

## Generating a token
### Generating a token
You can generate new tokens at User > My Account > Security.
The form at the bottom of the page allows you to generate new tokens. Once you click the Generate button, you will see the token value. Copy it immediately; once you dismiss the notification you will not be able to retrieve it.

## Using a token
### Using a token
SonarScanners running in GitHub Actions can automatically detect branches and pull requests being built so you don't need to specifically pass them as parameters to the scanner.

**<ins>To analyze your projects with GitHub Actions, you need to: </ins>**
Expand All @@ -632,5 +637,19 @@ Configure your workflow YAML file as below:

Commit and push your code to start the analysis.

## Revoking a token
### Revoking a token
You can revoke an existing token at User > My Account > Security by clicking the Revoke button next to the token.

<a name="snmp"/>

## 14. SNMP
The ODE is capable of communicating with RSUs to:
- Query TIMs
- Deposit TIMs
- Delete TIMs

The following SNMP protocols are supported for communication with RSUs:
- DSRC 4.1 (defined in 'Dedicated Short-Range Communications Roadside Unit Specifications')
- NTCIP1218 (defined in 'National Transportation Communications for ITS Protocol')

Additionally, the ODE supports the execution of PDM operations on RSUs. PDM operations are not defined in NTCIP1218, but are defined DSRC 4.1.
2 changes: 1 addition & 1 deletion jpo-ode-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20231013</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import java.net.UnknownHostException;
import java.util.Arrays;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import mockit.Capturing;
import us.dot.its.jpo.ode.util.CodecUtils;
Expand All @@ -44,7 +44,7 @@ public void testConstrcutor() throws UnknownHostException {
assertNull(pkt.getPayload());
}

@Test @Ignore
@Test @Disabled
public void test() throws UnknownHostException {
test("127.0.0.1", 12, "01234567890".getBytes());
test("::1", 47561, "0123456789001234567890".getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
import java.util.Arrays;

import us.dot.its.jpo.ode.eventlog.EventLogger;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import mockit.Capturing;
import us.dot.its.jpo.ode.util.CodecUtils;
Expand Down Expand Up @@ -65,7 +66,7 @@ private enum TestCase {
TestForwardPacketInbound, TestSendPacketOutbound, TestIPv6ForwardOutbound, TestIPv4ForwardOutboundForward, TestIPv4ForwardOutboundSend, TestIPv6SendOutbound, TestIPv4SendOutbound,
};

@BeforeClass
@BeforeAll
public static void init() {
}

Expand All @@ -91,13 +92,13 @@ public void testForwardPacketInbound(String hostname)
checkBackgroundThreadAssertion();
}

@Test @Ignore
@Test @Disabled
public void testSendPacketOutboundIPv4() throws UnknownHostException, InterruptedException, InetPacketException {
// Use case: Forwarder sends outgoing IPv4 packet out
testSendPacketOutbound(CLIENT_HOST_IPV4);
}

@Test @Ignore
@Test @Disabled
public void testSendPacketOutboundIPv6() throws UnknownHostException, InterruptedException, InetPacketException {
// Use case: Forwarder sends outgoing IPv6 packet out
testSendPacketOutbound(CLIENT_HOST_IPV6);
Expand Down Expand Up @@ -150,7 +151,7 @@ public void testIPv4ForwardOutboundSend() throws InterruptedException, UnknownHo
checkBackgroundThreadAssertion();
}

@Test @Ignore
@Test @Disabled
public void testIPv6SendOutbound() throws InterruptedException, UnknownHostException, InetPacketException {
// Use case: Transport or Data Sink send IPv6 message out directly
startUdpListener(CLIENT_PORT, TestCase.TestIPv6SendOutbound);
Expand All @@ -160,7 +161,7 @@ public void testIPv6SendOutbound() throws InterruptedException, UnknownHostExcep
checkBackgroundThreadAssertion();
}

@Test @Ignore
@Test @Disabled
public void testIPv4SendOutbound() throws InterruptedException, UnknownHostException, InetPacketException {
// Use case: Transport or Data Sink send IPv4 message out directly
startUdpListener(CLIENT_PORT, TestCase.TestIPv4SendOutbound);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import mockit.Expectations;
import mockit.Mock;
Expand All @@ -40,7 +40,7 @@ public class InetPacketTest {

@Mocked InetAddress mockAddress;

@Before
@BeforeEach
public void setup() {
new MockUp<InetAddress>() {
@Mock InetAddress getByName(String host) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

Expand All @@ -25,7 +26,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import mockit.Capturing;
import mockit.Expectations;
Expand All @@ -48,39 +49,48 @@ public void testStringConstructorCreatesAddress() {
}
}

@Test(expected = AssertionError.class)
@Test
public void testStringConstructorFailsNullAddress() {
try {
new Expectations() {
{
InetAddress.getByName(anyString).getAddress();
result = null;
}
};
new InetPoint("something123", 5, true);
} catch (UnknownHostException e) {
fail("Unexpected exception: " + e);
}
assertThrows(AssertionError.class, () -> {
try {
new Expectations() {
{
InetAddress.getByName(anyString).getAddress();
result = null;
}
};
new InetPoint("something123", 5, true);
} catch (UnknownHostException e) {
fail("Unexpected exception: " + e);
}
});
}

@Test
public void testByteConstructorCreatesAddress() {
new InetPoint(new byte[] { 1, 2, 3 }, 5, true);
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testByteConstructorFailsNullAddress() {
new InetPoint((byte[]) null, 5, true);
Exception err = assertThrows(IllegalArgumentException.class, () -> {
new InetPoint((byte[]) null, 5, true);
});

assertEquals("IP Address is required", err.getMessage());
}

@Test
public void testBBytePortConstructorCreatesAddress() {
new InetPoint(new byte[] { 1, 2, 3 }, 5);
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testBytePortConstructorFailsNullAddress() {
new InetPoint((byte[]) null, 5);
Exception err = assertThrows(IllegalArgumentException.class, () -> {
new InetPoint((byte[]) null, 5);
});
assertEquals("IP Address is required", err.getMessage());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.ByteOrder;
import java.util.Arrays;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class CodecUtilsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class CrcCccittTest {

@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
}

@Before
@BeforeEach
public void setUp() throws Exception {
}

@After
@AfterEach
public void tearDown() throws Exception {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import junit.framework.TestCase;
import us.dot.its.jpo.ode.util.DateTimeUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.stream.Stream;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import junit.framework.TestCase;
import us.dot.its.jpo.ode.util.GeoUtils;
Expand All @@ -29,19 +33,8 @@ public class GeoUtilsTest extends TestCase {
public void testNearestPointOnLine() {
}

@Test
public void testPointOffset() {
assertOffset(5.0, 5.0, 10.0, 5.0, 5.0, 8.0); //0 deg
assertOffset(5.0, 5.0, 10.0, 10.0, 2.878, 7.121); //45 deg
assertOffset(5.0, 5.0, 5.0, 10.0, 2.0, 5.0); //90 deg
assertOffset(5.0, 5.0, 0.0, 10.0, 2.878, 2.878); //135 deg
assertOffset(5.0, 5.0, 0.0, 5.0, 5.0, 2.0); //180 deg
assertOffset(5.0, 5.0, 0.0, 0.0, 7.121, 2.878); //225 deg
assertOffset(5.0, 5.0, 5.0, 0.0, 8.0, 5.0); //270 deg
assertOffset(5.0, 5.0, 10.0, 0.0, 7.121, 7.121); //315 deg
}

@Test
@ParameterizedTest
@MethodSource("provideArgs")
public void assertOffset(double ax, double ay, double bx, double by, double ox, double oy) {
Point2D a = new Point2D.Double(ax, ay);
Point2D b = new Point2D.Double(bx, by);
Expand All @@ -55,6 +48,19 @@ public void assertOffset(double ax, double ay, double bx, double by, double ox,
assertEquals((long) (ox * scale), p1x);
assertEquals((long) (oy * scale), p1y);
}

private static Stream<Arguments> provideArgs() {
return Stream.of(
Arguments.of(5.0, 5.0, 10.0, 5.0, 5.0, 8.0),
Arguments.of(5.0, 5.0, 10.0, 10.0, 2.878, 7.121),
Arguments.of(5.0, 5.0, 5.0, 10.0, 2.0, 5.0),
Arguments.of(5.0, 5.0, 0.0, 10.0, 2.878, 2.878),
Arguments.of(5.0, 5.0, 0.0, 5.0, 5.0, 2.0),
Arguments.of(5.0, 5.0, 0.0, 0.0, 7.121, 2.878),
Arguments.of(5.0, 5.0, 5.0, 0.0, 8.0, 5.0),
Arguments.of(5.0, 5.0, 10.0, 0.0, 7.121, 7.121)
);
}

@Test
public void testDistanceInMapCoordinates() {
Expand Down Expand Up @@ -107,4 +113,4 @@ public void testDistanceInLatLng() {
assertEquals(d1, d3, GeoUtils.ERROR_MARGIN);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.Iterator;
import java.util.Map.Entry;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import java.math.BigDecimal;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class SerializationUtilsTest {

Expand Down
Loading

0 comments on commit bcd4c3e

Please sign in to comment.