### Install Java 21 on Linux Source: https://github.com/eclipse-kura/kura/blob/develop/README.md Installs the OpenJDK 21 package using apt. ```bash sudo apt install openjdk-21-jdk ``` -------------------------------- ### Git Branch Listing Example Source: https://github.com/eclipse-kura/kura/wiki/Kura-Github-Documentation Demonstrates how to list Kura documentation-related branches using git. ```bash git branch --list "docs*" docs-develop docs-release-5.1 docs-release-5.1 ``` -------------------------------- ### Network Adapter Test Examples Source: https://github.com/eclipse-kura/kura/wiki/Unit-Test-Guidelines-and-Recipes Demonstrates testing network adapter configurations for Wi-Fi and Ethernet, including both valid and invalid scenarios. ```java class networkImplTest{ @Test void testWifiBadExample(){ givenNetworkWifiAdapterWithNetworkAndWanSupport(); } @Test void testWifiGoodExample(){ givenNetworkAdapterWith("wlan0", Type.Wifi, EnabledForWan); } @Test void EthernetBadExample(){ givenNetworkEthernetAdapterWithNetworkAndWanSupport(); } @Test void EthernetGoodExampleWithMultipleDevices(){ givenNetworkAdapterWith("eth0", Type.Ethernet, EnabledForWan); givenNetworkAdapterWith("eth1", Type.Ethernet, EnabledForWan); givenNetworkAdapterWith("wlan0", Type.Wifi, Disabled); } } ``` -------------------------------- ### Install Java 21 on macOS Source: https://github.com/eclipse-kura/kura/blob/develop/README.md Installs Java 21 by downloading and unpacking a tar archive. Updates JAVA_HOME environment variable. ```bash sudo tar -xzf .tar.gz ``` ```bash export JAVA_HOME=/Library/Java/JavaVirtualMachines//Contents/Home ``` -------------------------------- ### Comprehensive Unit Test Example Source: https://github.com/eclipse-kura/kura/wiki/Unit-Test-Guidelines-and-Recipes An example demonstrating a complete unit test following the specified naming conventions and structure for 'given', 'when', and 'then' statements. ```java @Test public void applyShouldDisableGPSWithMissingGPSConfiguration() throws DBusException, IOException { givenBasicMockedDbusConnector(); givenMockedDeviceWith("1-5", "ttyACM17", NMDeviceType.NM_DEVICE_TYPE_MODEM, NMDeviceState.NM_DEVICE_STATE_ACTIVATED, true, false, false); givenMockedDeviceList(); givenNetworkConfigMapWith("net.interfaces", "1-5,"); givenNetworkConfigMapWith("net.interface.1-5.config.ip4.status", "netIPv4StatusEnabledWAN"); givenNetworkConfigMapWith("net.interface.1-5.config.dhcpClient4.enabled", true); givenNetworkConfigMapWith("net.interface.1-5.config.apn", "myAwesomeAPN"); whenApplyIsCalledWith(this.netConfig); thenNoExceptionWasThrown(); thenConnectionUpdateWasCalledFor("ttyACM17"); thenActivateConnectionWasCalledFor("ttyACM17"); thenLocationSetupWasCalledWith(EnumSet.of(MMModemLocationSource.MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI), false); } ``` -------------------------------- ### Install Kura™ on Linux Source: https://github.com/eclipse-kura/kura/blob/develop/README.md Installs Eclipse Kura™ on Linux systems using APT. Ensure you have curl and gpg installed first. ```bash # Install required tools sudo apt update sudo apt install -y curl gpg ``` -------------------------------- ### Gherkin Scenario with Steps Example Source: https://github.com/eclipse-kura/kura/wiki/Gherkin-Tests-Guidelines Illustrates a Gherkin scenario with multiple steps following the given-when-then structure. Step methods should be private and contain assertions. ```java @Test public void storeOnNotExistentTable() { givenDatabaseConnection(); givenConfigurationWithWrongTableName(); whenWireEnvelopeArrives(); thenThrowException(); thenDataNotStored(); } ``` -------------------------------- ### Install Maven 3.9 on macOS using Brew Source: https://github.com/eclipse-kura/kura/blob/develop/README.md Installs a specific version of Maven using Homebrew and adds it to the system's PATH. ```bash brew install maven@3.9 ``` ```bash export PATH="/usr/local/opt/maven@3.9/bin:$PATH" ``` -------------------------------- ### Commit Sign-off Example Source: https://github.com/eclipse-kura/kura/blob/develop/CONTRIBUTING.md Example of how to sign-off your commit records using the '-s' flag with Git. This ensures your email matches your Eclipse account. ```bash $> git commit -s -m "Shave the yak some more" ``` -------------------------------- ### Kura GitHub Pages Environment Setup Source: https://github.com/eclipse-kura/kura/wiki/Kura-Github-Documentation Provides commands to set up a local environment for working with the Kura GitHub Pages branch. Ensure to perform all Git operations on the 'gh-pages' branch to avoid conflicts with the main source code. ```java mkdir ~/dev/kura_github_pages cd ~/dev/kura_github_pages git clone https://github.com/eclipse/kura.git -b gh-pages cd kura ``` -------------------------------- ### Update Package Index and Install Eclipse Kura Source: https://github.com/eclipse-kura/kura/blob/develop/README.md Updates the APT package index and installs the Eclipse Kura package. Requires sudo privileges. ```bash sudo apt update sudo apt install -y kura ``` -------------------------------- ### Run Jekyll Server with Drafts Source: https://github.com/eclipse-kura/kura/wiki/Kura-Github-Documentation Command to start the Jekyll server including documents from the _drafts folder. Useful for editing new documents. ```bash bundle exec jekyll server --baseurl="" --watch --drafts ``` -------------------------------- ### Install Rosetta for M1 Compatibility Source: https://github.com/eclipse-kura/kura/wiki/Developing-Kura-with-Apple-M1-chip Install Rosetta on your M1 Mac to enable the execution of x86_64 binaries. This is a prerequisite for the build modifications to function correctly. ```bash softwareupdate --install-rosetta ```