Reading view

There are new articles available, click to refresh the page.

How to resolve TestNG run option not shown in Eclipse?

Some users might face issue with TestNG run option not available under Run configurations due to below possibilities.

TestNG plugin is not installed: To use TestNG in Eclipse, you need to have the TestNG plugin installed. If it is not installed, you can install it from the Eclipse marketplace.

TestNG dependency to POM.xml file is missing.

Incorrect build path: Ensure that the TestNG library is included in your project build path. You can add the library to the build path by right-clicking on your project and selecting “Build Path” and then “Configure Build Path.”

Make sure project is selected with minimum Java version 1.8

The project should have @Test Annotation with or without main() class.

Follow below steps if TestNG option is not visible under Window->Show view->Other->TestNG, even after plugin installation and dependency are added.

  1. Help—>Install new software–>already installed —>TestNG (All)—> Uninstall —> restart now (Eclipse will restart)
  2. After restart again Help–>Install new software –> Clicks on ‘Add’ —> Name TESTNG URL – https://testng.org/testng-eclipse-update-site/7.4.0/ —> Ok
  3. After install restart now Eclipse
  4. Run as TestNG option is available

GitHub, Git & Jenkins

Github:

It allows collaboration with any developer all over the world. Open Source solutions enable potential developer to contribute and share the knowledge to benefit the Global Community. At a high level, GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code. To understand exactly what GitHub is, you need to know two connected principles:

  • Version control
  • Git

What Is Version Control?

Version control helps developers track and manage changes to a software project’s code. As a software project grows, version control becomes essential. Take WordPress…

At this point, WordPress is a pretty big project. If a core developer wanted to work on one specific part of the WordPress codebase, it wouldn’t be safe or efficient to have them directly edit the “official” source code.

Instead, version control lets developers safely work through branching and merging.

With branching, a developer duplicates part of the source code (called the repository). The developer can then safely make changes to that part of the code without affecting the rest of the project.

Then, once the developer gets his or her part of the code working properly, he or she can merge that code back into the main source code to make it official.

What Is Git?

Git is a specific open-source version control system created by Linus Torvalds in 2005.It is used for coordinating work among several people on a project and track progress over time. It is used for source code management for software development.

GitHub is a Git repository hosting service which provides a web-based graphical interface that helps every team member to work together on the project from anywhere and makes it easy to collaborate.

Jenkins

Jenkins is a Java-based open-source automation platform with plugins designed for continuous integration.

It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration, and continuous delivery, making it easier for developers and DevOps engineers to integrate changes to the project and for consumers to get a new build. It is a server-based system that runs in servlet containers such as Apache Tomcat.

Git vs Jenkins: What are the differences?

Git and Jenkins are both popular tools, Git is a distributed version control system and Jenkins is a continuous integration and automation tool. Let’s explore the key differences between the two:

  1. Code Management vs. Automated Builds: Git is primarily used for code management and version control. It allows developers to track changes, collaborate on code, and handle code branching and merging efficiently. On the other hand, Jenkins focuses on automated builds, testing, and deployment. It helps in integrating code changes from multiple team members and automates the build process, including compiling, testing, and packaging the software.
  2. Local vs. Remote: Git operates locally on the developer’s machine, allowing them to work offline and commit changes to their local repository. Developers can then push their changes to a remote repository, facilitating collaboration with other team members. In contrast, Jenkins is a remote tool that runs on a dedicated server or cloud platform. It continuously monitors the code repository and triggers automated builds or tests based on predefined conditions or schedules.
  3. Version Control vs. Continuous Integration: Git’s primary focus is on version control, tracking changes to files and directories over time. It provides features like branching, merging, and resolving conflicts to manage code versions effectively. Jenkins, on the other hand, emphasizes continuous integration (CI), which involves frequently integrating code changes from multiple developers into a shared repository. Jenkins automatically builds and tests the integrated code, highlighting any conflicts or issues that arise during the process.
  4. User Interface: Git primarily relies on a command-line interface (CLI) for executing various operations. However, there are also graphical user interface (GUI) clients available for more user-friendly interactions. Jenkins, on the other hand, provides a web-based graphical user interface that allows users to configure and manage Jenkins jobs, view build reports, and monitor the status of automated builds and tests.
  5. Plugin Ecosystem: Git has an extensive ecosystem of third-party plugins that extend its functionality and integrations with other development tools. These plugins cover various areas, including code review, issue tracking, and build automation. Jenkins, being an automation tool, has a rich plugin ecosystem as well. These plugins enable users to integrate Jenkins with different build tools, testing frameworks, version control systems, and deployment platforms, enhancing its capabilities and flexibility.
  6. Ease of Use: Git can have a steep learning curve for beginners, particularly when it comes to understanding concepts like branching, merging, and resolving conflicts. However, once users become familiar with its core functionality, it provides a powerful and flexible version control system. Jenkins, on the other hand, aims to simplify the CI process and provide an intuitive user interface for managing builds and automation. While some initial setup and configuration may be required, Jenkins offers ease of use in terms of managing continuous integration workflows.

In summary, Git focuses on code management and version control, while Jenkins specializes in continuous integration and automation. Git operates locally, while Jenkins runs remotely on dedicated servers. Git’s primary interface is command-line-based, with additional GUI clients available, whereas Jenkins offers a web-based graphical user interface. Both Git and Jenkins have plugin ecosystems that extend their functionality, but Jenkins prioritizes automation-related integrations. Finally, while Git has a steeper learning curve, Jenkins aims to provide ease of use in managing continuous integration workflows.

Source: https://stackshare.io/stackups/git-vs-jenkins#:~:text=Git%20operates%20locally%2C%20while%20Jenkins,web%2Dbased%20graphical%20user%20interface.

Part1 -Basic Linux commands

Below are few basic commands for beginners to get the grip of Linux usage.

  • locate  — test1.text it shows the path of test1.txt file
    pwd  — displays present working directory path
    wc   — test1.txt displays no of lines, no of words, size of the file ( 1, 10, 15)
  • date –date=”5 years ago” —- provides 5 years ago date information
  • grep ‘word’ test1.txt —- Search any line that contains the word in filename
  • grep -I ‘WORD’ test1.txt — Perform a case-insensitive search for the word ‘bar’

List Commands

  • ls -a  — Displays all files including hidden files and directories
  • ls -l  — long format with detailed information about files and directories.
  • ls -al  — long listing with hidden files
  • ls -lh  — long listing in human readable format of sizes like 1K, 29M
  • ls -ls — Files in sorted order
  • ls -lt  — latest modified file at the top with detailed information
  • ls -r — lists file in descending order or recursive order

Create Files

  • cat > test1.txt — Creates test1.txt file and prompts to insert content into this newly created file. Type a line and then press “Ctrl+D” to save the file.
  • echo “This is the File name file1” > test2.txt —- With Echo, content can be passed in the command itself.
  • cat test1.txt test2.txt — Prints the contents of the both files. 

Piping command

  • cat test1.txt | wc —Pipping command is used to join two commands functionality where test1.txt file is passed as input to check the Word Count command
  • cat test1.txt | grep create — “Create” word is searched and highlighted from test1.txt file contents

Retrieve History data

  • history | head — shows first 10 commands entered since you started the session and stores maximum 1K commands
  • history | tail — shows recent 10 commands from 1K list
  • history -d 4593 —  deletes the command by event number from history

Create directory

  • mkdir dir1 ——- creates a single directory
  • mkdir {dir1,dir2,dir3} ——- Creates multiple directories 
  • mkdir -v dir —– creates directory and prints information as created

Remove command

  • rm test1.txt —- removes the file
  • rm -i test1.txt —- asks for an option to confirm in an interactive mode, type y to remove
  • rm -r folder1 — recursively deletes directory and all its contents
  • rm *.txt — deletes all files with *.txt format

Man command to find its manual page

  • man mkdir – manual page of mkdir command is printed

WHO commands

  • who — displays username, ip and timestamp
  • whoami — displays username
  • who -r —- displays run level data
  • who -b —- displays boot level data

COPY command

  • cp test1.txt test1_backup.txt —– copies content from test1 to test2 file, used to take file backup

Move command Rename the file

  • mv test1.txt test3.txt — file name renamed to test3.txt
  • mv test3.txt Folder1 — moves test3.txt to directory “Folder1”

FIND command Search a file or directory and provide its path

  • find . -name test1.txt —- To search a file name under directories by mentioning DOT(.) as in all directory structure
  • find . -type f -name test1.txt ——- To search a file name by explicitly mentioning as -type f
  • find . -type d -name d1 —— To search a directory name explicitly mentioning as -type d

Environment Variable

  • env —- lists environment variables created for your system
  • export name=Mylearning ——— environment variable can be created for the session which is stored under env list
  • printenv name displays ‘name’ environment variable
  • df —— file system usage is displayed
  • df -h —– file system usage is displayed in human readable format
  • less test1.txt ” —- It helps to read the contents of the file in a page wise option. Press space to move to next page. Press up and down arrows to scroll up and down the lines”
  • sort test1.txt —— Sort is useful when a large data file needs to be read in an order
  • sort test1.txt sorted_file.txt —– Sorted data is stored in another file
  • sort -u text1.txt —- sorts and removes the duplicate data
  • uniq text1.txt —- displays only unique data from the file
  • uniq -c text1.txt —— no. of occurences are displayed for each data

❌