0% found this document useful (0 votes)
4 views37 pages

AJP REPORT2

The document is a micro-project report submitted by Soham Vilayatkar for the Weather App developed as part of the Advance Java Programming course at Dr. Panjabrao Deshmukh Polytechnic. The project aims to provide real-time weather updates using the OpenWeather API, featuring a user-friendly interface and dual input options for location retrieval. It emphasizes the integration of Java Swing for GUI development, JSON parsing, and the importance of practical programming skills in addressing real-world needs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views37 pages

AJP REPORT2

The document is a micro-project report submitted by Soham Vilayatkar for the Weather App developed as part of the Advance Java Programming course at Dr. Panjabrao Deshmukh Polytechnic. The project aims to provide real-time weather updates using the OpenWeather API, featuring a user-friendly interface and dual input options for location retrieval. It emphasizes the integration of Java Swing for GUI development, JSON parsing, and the importance of practical programming skills in addressing real-world needs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

DR.

PANJABRAO DESHMUKH POLYTECHNIC, AMRAVATI


Computer Engineering Department 2024-2025

MICRO-PROJECT REPORT

Submitted By:

SOHAM VILAYATKAR
Enrollment No. 2200240175
`

Subject: Advance Java Programming (22517)

Under the Guidance


of Prof. S.S.Patil

DEPARTMENT OF COMPUTER ENGINEERING


DR. PANJABRAO DESHMUKH POLYTECHNIC, AMRAVATI

VISION:

To educate students, to be computer technology expert & technocrat, with brainstorming and
learning hardware, software, cocurricular and extracurricular concept.

MISSION:

To enhance and pacify knowledge thirst in order to strengthen IT and Computer skills
in building blocks of Nation.

1|Page
DEPARTMENT OF COMPUTER ENGINEERING
DR. PANJABRAO DESHMUKH POLYTECHNIC, AMRAVATI
(A Govt Aided Institute)

CERTIFICATE

This is to certificate that the Mr. Soham Vilayatkar. Roll No 47 of Fifth Semester of Diploma in
Computer Engineering has completed the Project entitled ‘Weather App' satisfactorily in the
partial fulfilment of Project for the academic year 2024-25 as prescribed in the curriculum.

Guide by
Prof S.S.Patil HOD Principal
Prof.R.H.Rathod Dr.G.R.Gosavi

2|Page
ACKNOWLEDGEMENT
First, we would like to thank all the people that worked along with us with their patience and
openness they created an enjoyable working environment.

It is indeed with a great sense of pleasure and immense sense of gratitude that we acknowledge the
help of these individuals.

We would like to thank my Head of the Department for his constructive criticism throughout our
Microproject.

Nextly, We would like to thank my project guide Prof.S.S.Patil for his guidance throughout the
project.

We’re extremely grateful to our department staff members and friends who helped us in successful
completion of this project.

3|Page
STUDENT DETAILS
Title of the Micro-Project: “Weather App” Submitted By:

Sr.No. Name of the Student Roll no.

1.
Soham .P. Vilayatkar 47

Teacher’s Signature

4|Page
INDEX

Sr. No Contents Page No

1. Aim 06

2. Benefits 06

3. Course Outcomes 06

4. Introduction 07

5. Project Overview 09

6. Objective of the Weather App 10

Technologies Used 11
7.

8. Functional Requirement 13

9 ER Diagram 16

10 Use Case Diagram 17

11 Flowchart 18

12 Swing Classes and Methods Used in Weather App 19

13 Output and Test case 21

14 Conclusion 35

15 References 35

5|Page
1. Aim
Weather App.

2. Benefits
1. Real-time Updates: Provides accurate and instant weather information.
2. Dual Input Options: Users can search by city name or geographic coordinates.
3. User-Friendly Interface: Simple and intuitive design for easy interaction.
4. Practical Usage: Helps users plan activities based on current weather conditions.
5. Scalability: Can be enhanced with additional features like forecasts or graphical data.
6. API Integration Skills: Demonstrates the ability to integrate and utilize external APIs.
7. Learning Opportunity: Enhances understanding of Java Swing and JSON parsing.
8. Reusable Code: Can serve as a foundation for other Java-based API projects.

3. Course Outcomes
1. Develop programming using GUI Framework (AWT and Swing).
2. Handle events of AWT and Swings components.
3. Develop Java program using network concepts.
4. Develop program using database.
5. Develop program using servlet.

6|Page
4. Introduction
The Weather Application is a desktop-based program developed using Java Swing, designed to
provide real-time weather updates in a user-friendly interface. By leveraging the OpenWeather API,
the application fetches accurate weather information based on user inputs, offering two methods of
retrieval: city name or geographic coordinates (latitude and longitude). With its intuitive design, the
app displays essential weather details such as temperature, humidity, wind speed, and current
weather conditions. This project combines the power of API integration with robust Java
programming to deliver a practical tool for users seeking reliable and instant weather updates..

Key Features of the Project

1. Real-Time Weather Updates:


The application retrieves weather data from the OpenWeather API, ensuring users receive the latest
weather information. This feature ensures the app is up-to-date, providing reliable weather forecasts
and conditions based on the current time and location. The integration of the API makes the app
versatile for global weather reports.
2. Dual Input Options:
Users can choose between two convenient methods for retrieving weather data:

 City Name: By entering the name of a city, the app fetches the weather details specific to that city.
 Latitude and Longitude: Users can input geographic coordinates to receive weather information
for a precise location. This feature is particularly useful for remote areas or when users want more
specific weather details based on geographic positioning.

3. User-Friendly GUI:
The app’s graphical user interface (GUI) is built using Java Swing, offering a simple and intuitive
layout. The design includes text fields for input, buttons for interaction, and labels to display results. It
provides a smooth user experience, making it easy for anyone, even without technical expertise, to use
the application effectively.
4. Detailed Weather Information:
Upon fetching data, the app displays important weather metrics, including:

 Temperature: The current temperature in the selected city or location.


 Weather Conditions: Describes the current weather (e.g., clear skies, cloudy, rainy).
 Humidity: Displays the humidity level, helping users understand the moisture in the air.
 Wind Speed: Provides the current wind speed, which can be crucial for outdoor activities.
This ensures users have a comprehensive understanding of the weather in their chosen location.

5. Error Handling:
The app includes robust error handling to ensure a seamless user experience. If the user enters invalid
data (e.g., a misspelled city name or incorrect coordinates), the app provides clear error messages.
Additionally, it handles issues like network problems or incorrect API responses, ensuring that the
application remains functional even in case of minor errors.

7|Page
6. Compact Design:
The application is designed to be lightweight and efficient. The user interface is kept simple, and the
program is optimized for fast performance. This ensures that the app runs smoothly on most systems,
without consuming excessive resources, making it an accessible tool for users with varying system
capabilities.
7. Reusable Components:
The app’s modular design and clean code structure make it easy to extend or repurpose. The weather-
fetching logic and the GUI components can be reused in future projects or enhanced with additional
features such as long-term weather forecasts, graphical weather charts, or alerts for extreme weather
conditions.
8. Lightweight Application:
As a desktop application built using Java, the weather app is designed to be lightweight and does not
require much memory or processing power. It can run efficiently on systems with lower
specifications, ensuring that users don’t need high-end hardware to access and use the app. This
makes the application suitable for a wide range of devices, from personal computers to lower-end
laptops.

8|Page
5. Project Overview
Purpose of the Project
The purpose of the Weather Application project is to create a user-friendly and efficient desktop
solution for retrieving real-time weather updates. With the growing need for accurate weather
information in daily life, this application aims to provide users with essential weather details such as
temperature, humidity, wind speed, and conditions in a quick and accessible manner. By leveraging
the OpenWeather API, the project showcases the integration of external APIs into Java-based
applications, enhancing its functionality and reliability. It serves as a practical tool for users to plan
activities, travel, or make decisions based on current weather conditions. Additionally, the project
provides an excellent opportunity to deepen knowledge of Java Swing, JSON parsing, and API
usage while fostering a deeper understanding of software design and user interface development..

Importance of an RMS in the Restaurant Industry

1. Real-Time Weather Insights:


The application provides up-to-date weather information, helping users stay informed about
the current conditions. This is essential for planning activities, commuting, or traveling,
ensuring users can make well-informed decisions based on accurate data.
2. Practical Application:
Weather is a universal need, and this project addresses a common requirement by offering a
reliable source for weather updates. Its relevance makes it a valuable tool for a wide range of
users.
3. Enhanced User Experience:
The application is designed with an intuitive and user-friendly interface using Java Swing,
ensuring it is easy to use even for those with minimal technical knowledge. This focus on
usability makes the app accessible and appealing.
4. Technical Skill Development:
Developers working on this project gain hands-on experience in integrating APIs, parsing
JSON data, and designing GUI applications using Java Swing. These are critical skills in
modern software development, providing valuable learning opportunities.
5. Demonstration of Problem-Solving:
The project showcases the ability to address real-world problems by combining technical
skills with a user-focused approach. It demonstrates the practical application of programming
to create functional and meaningful solutions.
6. Foundation for Future Enhancements:
The modular design of the app makes it easy to expand. Features like weather forecasting,
graphical trend visualization, or severe weather alerts can be added, transforming it into a
more comprehensive weather service.
7. Cross-Disciplinary Relevance:
By integrating technology with meteorology, the project demonstrates how software can be
used to solve challenges in various fields. It highlights the interdisciplinary potential of
programming.

9|Page
6. Objective of the Weather App
The primary objective of the Weather Application is to develop a desktop-based solution that provides
users with real-time weather updates in a convenient and accessible manner. The project focuses on the
following detailed objectives:

1. Provide Accurate Weather Information:


To ensure users receive precise and reliable weather updates by integrating with the OpenWeather
API. The app aims to deliver information such as temperature, humidity, wind speed, and current
weather conditions specific to the location provided by the user.
2. Offer Dual Input Options:
To enhance flexibility by allowing users to fetch weather data using either the city name or
geographical coordinates (latitude and longitude). This ensures coverage for both general and specific
location-based queries.
3. Develop an Intuitive User Interface:
To create a user-friendly interface using Java Swing, enabling smooth navigation and interaction. The
design will focus on simplicity and clarity, making the application accessible to users of all technical
backgrounds.
4. Demonstrate Practical Use of APIs:
To showcase the integration of external APIs into Java-based applications, emphasizing how modern
applications rely on real-time data sources to function effectively.
5. Implement Error Handling:
To build robust error-handling mechanisms that manage invalid inputs, API connection failures, and
other potential issues gracefully. This ensures a seamless and reliable user experience.
6. Enhance Programming Skills:
To provide an opportunity for developers to deepen their understanding of Java Swing, JSON parsing,
API integration, and modular programming. This project acts as a practical learning experience for
building real-world applications.
7. Encourage Future Scalability:
To design the application in a modular way, allowing for future enhancements such as extended
weather forecasts, graphical data visualization, or integration with additional APIs. This scalability
ensures the application remains relevant and can grow with user needs.
8. Address Real-World Problems:
To cater to the universal need for weather information, enabling users to plan daily activities, travel,
and events efficiently. The app serves as a practical tool for both personal and professional use.

By meeting these objectives, the project not only solves a real-world problem but also acts as a
comprehensive demonstration of software development skills, making it a valuable contribution to both users
and developers.

10 | P a g
e
7. Technologies Used
1. Java:
o Core Language: The application is developed using Java, a versatile and widely-used
programming language known for its platform independence and object-oriented features.
o Key Usage: Java provides the logic for fetching and processing weather data, implementing
error handling, managing database interactions, and handling user inputs and outputs.
2. Java Swing:
o Graphical User Interface (GUI): Swing is utilized to create the user-friendly interface for the
application.
o Key Components: Text fields for user input (city name or coordinates), buttons for triggering
weather retrieval, and labels for displaying weather details such as temperature, humidity, and
wind speed.
3. MySQL:
o Database Management System: MySQL is used to store and manage historical weather data
fetched by the application.
o Key Usage:
 Storing user search queries (e.g., city names, coordinates).
 Archiving weather information for future reference.
 Enabling data retrieval for analysis or trend visualization.
o Integration: The application connects to the MySQL database using JDBC (Java Database
Connectivity) to perform operations like insertion, retrieval, and deletion of records.
4. OpenWeather API:
o API Integration: The application integrates with the OpenWeather API to fetch real-time
weather data based on the user's input.
o Key Features: Provides data such as current temperature, weather conditions, wind speed, and
humidity. The API is accessed using an HTTP request, and the response is parsed in the
application.
5. JSON Parsing:
o Data Handling: The weather data fetched from the OpenWeather API is in JSON format. Java
libraries, such as org.json or Jackson, are used to parse the JSON response and extract
relevant information.
o Key Usage: Extracting data fields like temperature, weather description, wind speed, and
humidity for display and storing it in the database.
6. HTTP Client Libraries:
o Networking: Libraries such as HttpURLConnection or third-party libraries like Apache
HttpClient are used to make HTTP GET requests to the OpenWeather API.
o Key Usage: Establishing a connection with the API, sending requests, and retrieving weather
data efficiently.
7. Integrated Development Environment (IDE):
o Development Tools: IDEs like IntelliJ IDEA, Eclipse, or NetBeans are used for writing,
debugging, and testing the application.
o Key Features: Code assistance, debugging tools, and GUI builders to streamline development.
8. Maven (Optional):
10 | P a g e
o Dependency Management: If used, Maven simplifies the inclusion of libraries (e.g., for
JSON parsing, HTTP requests, or database interaction) and manages project dependencies
efficiently.
o Key Usage: Ensures all required external libraries are included and updated easily.
9. Operating System:
o Cross-Platform Capability: The application is built using Java, which ensures it can run on
multiple operating systems such as Windows, macOS, and Linux without modification.
10. API Key Management:

 Security: The OpenWeather API requires an API key for access. The key is securely integrated into
the application to authenticate API requests.
 Key Usage: Enables authorized access to the API services while maintaining security best practices.

By incorporating MySQL, the project not only provides real-time weather updates but also enables data
storage for historical analysis and trends, enhancing the application's utility and scope.

10 | P a g e
1. Functional Requirements
User Input Handling

 City Name Input:


• Users must be able to enter a valid city name using a text field.
• The application should handle common errors such as empty inputs or invalid
characters (e.g., numbers or symbols in city names).
 Latitude and Longitude Input:
• Users must be able to enter numerical values for latitude and longitude using separate
input fields.
• Latitude should be restricted to values between -90 and 90, and longitude should be
restricted to values between -180 and 180.
• Validation must ensure inputs are numeric and within the acceptable range.
 Submit Button:
• A button to trigger the weather search based on the user’s input.

Fetch Weather Data

 The application must use the OpenWeather API to fetch real-time weather data.
 The API call should include:
• An authenticated API key.
• The user’s input (city name or coordinates).
• Units of measurement (e.g., Celsius or Fahrenheit) for consistency.
 API response should be processed promptly to avoid delays in the user experience.

Process and Display Weather Data

 Extract the following details from the API’s JSON response:


• Current temperature.
• Weather description (e.g., sunny, rainy, cloudy).
• Humidity percentage.
• Wind speed and direction.
 The GUI should display this information clearly and neatly, using appropriately labeled sections.
 Provide tooltips or explanations for terms like “humidity” or “wind speed” for users unfamiliar
with these concepts.

Error Handling

 Input Validation Errors:


• Notify the user if input fields are empty or contain invalid data.
 API Errors:
• Handle errors such as invalid API keys, exceeding API rate limits, or incorrect API
endpoints.
• Display messages like “Unable to fetch weather data. Please try again later.”
 Network Issues:
• Alert the user if there is no internet connection or if the API server is unreachable.
 Data Not Found:
• If the API does not return weather data for a given input, display a message like “City
not found” or “Invalid coordinates.”

113 | P a g
e
Database Operations (MySQL)

 Store Weather Data:


• Save the user’s input (city name or coordinates) along with the fetched weather data
into a MySQL database.
• Include timestamp information for each entry.
 Retrieve Historical Data:
• Allow users to view previously searched weather details stored in the database.
• Display data in a table format with sorting and filtering options (e.g., sort by date, filter
by city).
 Update Data:
• If the user searches for a previously queried city or coordinates, update the existing
database record with the latest weather data.
 Delete Records:
• Provide users the option to delete old or unwanted records from the database.

Graphical User Interface (GUI)

 The application’s GUI should include:


• Input Section: Fields for city name, latitude, and longitude with clear labels.
• Weather Display Section: A panel or table to display weather details fetched from the
API.
• Historical Data Section: A table to display previously fetched data stored in the
database.
• Buttons:
• “Search” to fetch weather data.
• “View History” to display database records.
• “Clear History” to delete selected or all database records.

Real-Time Functionality

 Ensure weather data displayed is up-to-date by querying the API each time a user searches.
 Provide a loading indicator while the application fetches data to inform the user about ongoing
processing.

Scalability and Extensibility

 Ensure the application design supports adding features like:


• Multi-day weather forecasts.
• Integration with additional APIs for richer data (e.g., satellite images or severe weather
alerts).
• Advanced filtering and chart visualization of historical weather data.

Logging and Monitoring

 Maintain a log file to record:


• User actions (e.g., searches made).
• Database operations (e.g., record additions, updates, or deletions).
• Errors encountered during application use.
 Logs should include timestamps for all actions and errors.

114 | P a g
e
Multithreading for Asynchronous Operations

 Use Java’s multithreading capabilities to handle API calls and database operations without
freezing the GUI.
 Ensure the user interface remains responsive during long-running tasks like fetching data or
querying the database.

User Notifications and Alerts

 Notify users of critical weather conditions, such as storms or extreme temperatures, if supported
by the API.
 Display these alerts prominently in the GUI, such as using color-coded labels.

By addressing these detailed functional requirements, the weather application ensures robust functionality, an
intuitive user experience, and room for future enhancements.

115 | P a g
e
10. ER Diagram

116 | P a g
e
11. Use Case Diagram

117 | P a g
e
118 | P a g
e
12.Flowchart

119 | P a g
e
13.Swing Classes and Methods Used in Weather app
Swing Classes

1. JFrame

 Represents the main application window.

 Methods:
o setTitle(String title)
o setSize(int width, int height)
o setVisible(boolean visible)
o setDefaultCloseOperation(int operation)

2. JPanel

 A container for organizing components.

 Methods:
o setLayout(LayoutManager layout)
o add(Component comp)
o setBackground(Color color)

3. JButton

 Represents a button that can trigger an action.

 Methods:
o setText(String text)
o addActionListener(ActionListener l)

4. JLabel

 Displays non-editable text.

 Methods:
o setText(String text)

120 | P a g
e
5. JTextField

 Allows user input of a single line of text.

 Methods:
o setText(String text)
o getText()

6. JTextArea

 Allows user input of multiple lines of text.

 Methods:
o setText(String text)
o getText()
o setEditable(boolean editable)

7. JComboBox

 A drop-down list for selecting an item.

 Methods:
o addItem(Object item)
o getSelectedItem()

8. JTable

 Displays data in a table format.

 Methods:
o setModel(TableModel model)
o getValueAt(int row, int column)

9. JOptionPane

 Displays standard dialog boxes.

 Methods:
o showMessageDialog(Component parent, Object message)
o showConfirmDialog(Component parent, Object message)

121 | P a g
e
JDBC Classes and Methods Used
JDBC Classes
1. DriverManager

 Manages a list of database drivers.

 Methods:
o getConnection(String url, String user, String password)
2. Connection

 Represents a connection to the database.

 Methods:
o createStatement()
o prepareStatement(String sql)
o close()
3. Statement

 Used for executing SQL statements.

 Methods:
o executeUpdate(String sql)
o executeQuery(String sql)
o close()
4. ResultSet

 Represents the result set of a query.

 Methods:
o next()
o getString(String columnLabel)
o getInt(String columnLabel)
o close()

HttpURLConnection Classes and Methods


1. HttpURLConnection

 Purpose: Manages HTTP requests and responses for fetching weather data from the OpenWeather API.
 Methods:
o setRequestMethod(String method): Sets the HTTP method (e.g., GET, POST).
o setRequestProperty(String key, String value): Adds a header property to the
request (e.g., API key).
122 | P a g
e
o getResponseCode(): Retrieves the HTTP response code (e.g., 200 for success).
o getInputStream(): Retrieves the input stream for reading data from the server.
o disconnect(): Closes the connection.

2. URL

 Purpose: Represents the URL of the API endpoint.


 Methods:
o URL(String spec): Creates a URL object from a string representation.
o openConnection(): Opens a connection to the specified URL and returns a
URLConnection object (cast to HttpURLConnection).

3. BufferedReader (Utility Class)

 Purpose: Reads data from the API response.


 Methods:
o BufferedReader(Reader in): Creates a reader for the input stream.
o readLine(): Reads a line of text from the input.
o close(): Closes the reader.

4. InputStreamReader (Utility Class)

 Purpose: Converts an input stream into a character stream.


 Methods:
o InputStreamReader(InputStream in): Initializes the reader with the input stream.

123 | P a g
e
14.Output and Test
case Login page

Module Name Login page

Tester Name Soham Vilayatkar

Testcase Description To check the functionality of Login Page page

Pre-Requirement Internet
Browser
Environment Setup Windows 11

Created Date 30/09/2024

Current Time 10.30 Am

21 | P a g e
Test Case Test Test Steps Test Inputs Expected Actual Status Comments
ID Scenario Result Result
TC_01 Successful 1. Open Username: User Homepage Pass None
Login the user123 should be displayed
application Password: redirected
2. Enter correctpasswor to the
valid d homepage
username
3. Enter
valid
password
4. Click on
Log in
button
TC_02 Login with 1. Open Username: Error Error Pass None
Empty the Password: message message
Fields application should displayed
2. Leave appear:
username "Username
and and
password Password
fields required"
blank
3. Click on
Log in
button
TC_03 Invalid 1. Open Username: Error Error Pass None
Username the wronguser message message
application Password: should displayed
2. Enter correctpasswor appear:
invalid d "Invalid
username Username
3. Enter or
valid Password"
password
4. Click on
Log in
button
TC_04 Invalid 1. Open Username: Error Error Pass None
Password the user123 message message
application Password: should displayed
2. Enter wrongpassword appear:
valid "Invalid
username Username
3. Enter or
invalid Password"
password
4. Click on
Log in
button
TC_05 Sign up 1. Open None User Sign-up Pass None
Link the should be page
application redirected displayed
2. Click on to the
"Sign up" Sign-up
link page
22 | P a g e
TC_06 Password 1. Open Password: Password Password Pass None
Masking the mypassword characters masked
application should be
2. Enter hidden
characters (e.g.,
in the *******)
password
field
TC_07 Login 1. Open Username: Log in Log in Fail Issue
Button the user123 button button observed
Disabled application Password: should enabled
2. Leave remain
either disabled
username
or
password
blank
TC_08 Responsive 1. Open Window UI UI Pass None
UI the Resizing elements adjusted
application should correctly
2. Resize adjust
the properly
window to without
different overlap
sizes

23 | P a g e
Signup Page

Module Name Signup page

Tester Name Soham Vilayatkar

Testcase Description To check the functionality of Signup page

Pre-Requirement Internet
Browser
Environment Setup Windows 11

Created Date 30/09/2024

Current Time 10.30 Am

24 | P a g e
Test Case Test Test Steps Test Inputs Expected Actual Status Comments
ID Scenario Result Result
TC_01 Successful 1. Open Name: John Doe User should Confirmatio Pass None
Sign-Up the Phone: 1234567890 be registered n message
applicatio Email: successfully, displayed
n [email protected] and a
2. Fill all Username: john123 confirmation
the fields Password: message
with valid password123 should
data appear
3. Click on
Sign up
button
TC_02 Sign-Up 1. Open All fields blank Error Error Pass None
with the message message
Empty applicatio should displayed
Fields n appear: "All
2. Leave fields are
all fields required"
blank
3. Click on
Sign up
button
TC_03 Invalid 1. Open Email: invalidemail Error Error Pass None
Email the Other fields valid message message
Format applicatio should displayed
n appear:
2. Enter an "Invalid
invalid email
email format"
format
3. Fill
other
fields with
valid data
4. Click on
Sign up
button
TC_04 Weak 1. Open Password: 123 Error Error Pass None
Password the message message
applicatio should displayed
n appear:
2. Enter a "Password is
weak too weak"
password
3. Fill
other
fields with
valid data
4. Click on
Sign up
button
TC_05 Already 1. Open None User should Log in page Pass None
Have the be displayed
Account applicatio redirected to
Link n the Log in
25 | P a g e
2. Click on page
"Already
have
account?
Log in"
link
TC_06 Password 1. Open Password: Password Password Pass None
Masking the mypassword characters masked
applicatio should be
n hidden (e.g.,
2. Enter *******)
characters
in the
password
field
TC_07 Phone 1. Open Phone: 1234abcd Error Error Pass None
Number the Other fields valid message message
Validation applicatio should displayed
n appear:
2. Enter "Invalid
invalid phone
phone number"
number
3. Fill
other
fields with
valid data
4. Click on
Sign up
button
TC_08 Responsive 1. Open Window Resizing UI elements UI adjusted Pass None
UI the should correctly
applicatio adjust
n properly
2. Resize without
the overlap
window to
different
sizes

26 | P a g e
Get Weather by City name

Module Name Get Weather By City Name

Tester Name Soham Vilayatkar


Testcase Description To check the functionality of Get Weather By City Name

Pre-Requirement Internet
Browser
Environment Setup Windows 11
Created Date 30/09/2024
Current Time 10.30 Am

27 | P a g e
Test Case Test Test Steps Test Inputs Expected Actual Status Comments
ID Scenario Result Result
TC_01 Fetch 1. Open the City: New Weather Weather Pass None
Weather by application York information info
City 2. Enter a for New displayed
valid city York should
name in the be displayed
input box
3. Click on
"Get
Weather"
button
TC_02 Empty City 1. Open the City: (empty) Error Error Pass None
Field application message message
2. Leave the should displayed
city field appear: "City
empty name cannot
3. Click on be empty"
"Get
Weather"
button
TC_03 Invalid City 1. Open the City: Error Error Pass None
Name application InvalidCity12 message message
2. Enter an 3 should displayed
invalid or appear: "City
non- not found"
existent city
name in the
input box
3. Click on
"Get
Weather"
button
TC_04 Fetch 1. Open the Latitude: Weather Weather Pass None
Weather by application 40.7128 information info
LatLng 2. Click on Longitude: - for the displayed
"LatLng" 74.0060 entered
button coordinates
3. Enter should be
valid displayed
latitude and
longitude
values
4. Click on
"Get
Weather"
button
TC_05 Fetch Map 1. Open the City: Paris Map of Paris Map Pass None
by City application should be displayed
2. Click on displayed
"Get Map"
button
3. Enter a
valid city
name in the
input box
28 | P a g e
TC_06 Responsive 1. Open the Window UI elements UI Pass None
UI application Resizing should adjust adjusted
2. Resize properly correctly
the window without
to different overlap
sizes
TC_07 Weather 1. Open the City: Tokyo Weather data Data Pass None
Data application should be displayed
Format 2. Enter a displayed in correctly
valid city a readable
name format
3. Click on (temperature,
"Get humidity,
Weather" etc.)
button
TC_08 City Name 1. Open the City: LoNDoN Weather Weather Pass None
Case application information info
Insensitivit 2. Enter a for London displayed
y city name should be
in different displayed
cases (e.g.,
"LoNDoN")
3. Click on
"Get
Weather"
button

29 | P a g e
Get Weather by Latitude & Longitude

Get Weather by Latitude & Longitude


Module Name
Tester Name Soham Vilayatkar

Testcase Description To check the functionality of Get Weather by Latitude &


Longitude

Pre-Requirement Internet
Browser
Environment Setup Windows 11

Created Date 30/09/2024

Current Time 10.30 Am

Test Case Test Scenario Test Steps Test Expected Result Actual Status Comments
210 | P a g
e
ID Inputs Result
TC_01 Fetch Weather by 1. Open Latitude: Weather Weather Pass None
LatLng the 37.7749 information for the info
application Longitude: entered coordinates displayed
2. Enter -122.4194 should be displayed
valid
latitude
and
longitude
values
3. Click on
"Get
Weather"
button
TC_02 Empty Latitude 1. Open Latitude: Error message Error Pass None
and Longitude the (empty) should appear: message
Fields application Longitude: "Latitude and displayed
2. Leave (empty) Longitude cannot
both be empty"
latitude
and
longitude
fields
empty
3. Click on
"Get
Weather"
button
TC_03 Invalid 1. Open Latitude: Error message Error Pass None
Latitude/Longitud the abc should appear: message
e Values application Longitude: "Invalid displayed
2. Enter xyz Latitude/Longitude
invalid values"
values in
latitude
and
longitude
fields
3. Click on
"Get
Weather"
button
TC_04 Partial Latitude or 1. Open Latitude: Error message Error Pass None
Longitude Input the 40.7128 should appear: message
application Longitude: "Both Latitude and displayed
2. Enter a (empty) Longitude are
value in required"
only one
of the
fields
(latitude or
longitude)
3. Click on
"Get
Weather"
button
211 | P a g
e
TC_05 Weather Data 1. Open Latitude: Weather Weather Pass None
Accuracy the 48.8566 information should info
application Longitude: match the data for matches
2. Enter 2.3522 the entered location location
valid (Paris)
latitude
and
longitude
values
3. Click on
"Get
Weather"
button
TC_06 Responsive UI 1. Open Window UI elements should UI Pass None
the Resizing adjust properly adjusted
application without overlap correctly
2. Resize
the
window to
different
sizes
TC_07 Latitude and 1. Open Latitude: - Error message Error Pass None
Longitude Bounds the 100 should appear: message
application Longitude: "Latitude must be displayed
2. Enter 200 between -90 and 90,
out-of- Longitude must be
bound between -180 and
values for 180"
latitude
and
longitude
3. Click on
"Get
Weather"
button
TC_08 Special Characters 1. Open Latitude: Error message Error Pass None
in LatLng the @!#$ should appear: message
application Longitude: "Invalid characters displayed
2. Enter *&^% in
special Latitude/Longitude"
characters
in latitude
and
longitude
fields
3. Click on
"Get
Weather"
button

212 | P a g
e
15. Conclusion
The Weather App is a robust and user-friendly application that combines the power of Java Swing for its
intuitive graphical interface, JDBC for efficient database management, and HttpURLConnection for
seamless API integration. By leveraging the OpenWeather API, the app provides real-time weather
updates based on user input, whether through city names or geographic coordinates. This ensures
accurate and accessible weather information for users, making it a valuable tool for daily planning and
decision-making.

The integration of MySQL as the backend database adds significant value to the project by enabling the
storage and retrieval of user search history. This functionality not only enhances the user experience by
allowing quick access to previous searches but also serves as a foundation for advanced features like
statistical analysis of weather data or user preferences. The application demonstrates the importance of
combining front-end and back-end technologies for creating functional and interactive software solutions.

From a technical perspective, the project highlights the effective use of Java's diverse ecosystem. The
modular design of the application ensures that each component—UI, database, and API communication
—is independently developed and seamlessly integrated. This approach simplifies future enhancements,
such as integrating weather forecasts, alerts, or additional APIs, ensuring scalability and adaptability to
evolving user needs.

In conclusion, the Weather App is not only a practical application for real-time weather updates but also a
testament to the potential of combining multiple technologies to solve real-world problems. It provides a
solid foundation for further innovation, making it a meaningful contribution to the field of software
development..

16. References

 OpenWeather API Documentation


https://openweathermap.org/api

 Java Swing Tutorial


https://docs.oracle.com/javase/tutorial/uiswing/

 MySQL Official Documentation


https://dev.mysql.com/doc/

 JDBC API Guide


https://docs.oracle.com/javase/tutorial/jdbc/

 HttpURLConnection Class Documentation


https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html

 Java URL Class Documentation


https://docs.oracle.com/javase/8/docs/api/java/net/URL.html

313 | P a g
e
 JSON in Java (org.json library)
https://stleary.github.io/JSON-java/

 Java BufferedReader Class


https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html

 How to Use Tables in Swing


https://docs.oracle.com/javase/tutorial/uiswing/components/table.html

 Best Practices for RESTful API Integration in Java


https://www.baeldung.com/java-http-client-rest

314 | P a g
e

You might also like