Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Dear students,
your first homework is about writing ten assertion cases (at least with 5 different ypes of assertion
statements) (two-student groups will have 20 assertion cases) from your software projects. (50 points).
Two test suits will be implemented (you will/can use assertions you have written before). (20 points)
Do not write redundant cases, please.
You will present the project with your group members (2 student groups) or individually.
You will present your homework in no more than 5-10 minutes.
I need to see the UML class diagrams of your project first shortly. (20 points)
A parameterized test must be in your homework, please. (10 points)

 

 

PROJECTS TOPİC IS WRITTEN IN THE IMAGE FOLLOW THE IMAGE

WE HAVE FOUND THE PROJECT AND THE CODES ARE IN THE BELOW IMAGE CAN YOU WRITE 10 MORE ASSERTION CASES PLEASE 

 

Pseudocode
// Main class with GUI and file moving functionality
FUNCTION actionPerformed(ActionEvent e)
 // Get user input
 sourceDir = sourceDirTextField.getText()
 destDir = destDirTextField.getText()
 isEncrypt = encryptRadioButton.isSelected()
 isCompress = compressRadioButton.isSelected()
 isHide = hideRadioButton.isSelected()
 // Validate directories
 IF sourceDir is not a directory OR destDir is not a directory
 DISPLAY error message
 RETURN
 // Create file filter based on user selection
 fileFilter = (File file) ->
 IF allFilesCheckBox.isSelected()
 RETURN TRUE
 ELSE
 fileName = file.getName()
 fileExtension = GET_FILE_EXTENSION(fileName)
 IF txtCheckBox.isSelected() AND fileExtension EQUALS "txt"
 RETURN TRUE
 ELSE IF pdfCheckBox.isSelected() AND fileExtension EQUALS "pdf"
 RETURN TRUE
 ELSE IF pngCheckBox.isSelected() AND fileExtension EQUALS "png"
 RETURN TRUE
 ELSE
 RETURN FALSE
 // Get list of files to move
 filesToMove = sourceDirectory.listFiles(fileFilter)
 IF filesToMove is empty
 DISPLAY message that no files were found
 RETURN
 // Iterate through files and move them
 FOR EACH file IN filesToMove
 fileName = file.getName()
 fileExtension = GET_FILE_EXTENSION(fileName)
 // Optional encryption (incomplete implementation)
 encryptedFileName = IF isEncrypt THEN encryptFileName(fileName) ELSE fileName
 // Optional compression (not implemented)
 compressedFileName = IF isCompress THEN COMPRESS_FILENAME(encryptedFileName)
ELSE encryptedFileName
 // Create hidden filename
 hiddenFileName = IF isHide THEN "." + compressedFileName ELSE compressedFileName
 destinationFile = new File(destDir, hiddenFileName)
 IF destinationFile does not exist
 // Copy file to destination
 COPY file to destinationFile
 DISPLAY success message for fileName
 ELSE
 DISPLAY message that file already exists
// Function to get file extension
FUNCTION GET_FILE_EXTENSION(fileName)
 dotIndex = fileName.lastIndexOf(".")
 IF dotIndex > 0 AND dotIndex < fileName.length() - 1
 RETURN fileName.substring(dotIndex + 1)
 ELSE
 RETURN ""
// Function to encrypt filename (incomplete implementation)
FUNCTION encryptFileName(fileName)
 secretKey = "secretKey"
 key = secretKey.getBytes("UTF-8")
 sha = MessageDigest.getInstance("SHA-1")
 key = sha.digest(key)
 key = Arrays.copyOf(key, 16)
 secretKeySpec = new SecretKeySpec(key, "AES")
 cipher = Cipher.getInstance("AES")
 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec)
 // Missing: Actual encryption logic using cipher.doFinal()
 // Return empty string as the encryption is incomplete
 RETURN ""
// Function to compress filename (not implemented)
FUNCTION COMPRESS_FILENAME(fileName)
 // Optional implementation for compressing the filename
 // Can use a library like Apache Commons Compress
 RETURN fileName + ".zip"
// Function to convert bytes to hex string
FUNCTION bytesToHex(bytes)
 result = StringBuilder()
 FOR EACH byte IN bytes
 result.append(Integer.toString((byte & 0xff) + 0x100, 16).substring(1))
 RETURN result.toString()

(Can be found in code directory as an png)
Explanation of the Code:
Functionality:
This code implements a desktop application for moving files with optional features like encryption
and hiding. Users can select a source directory, a destination directory, and choose which files to
move based on extensions (all files, txt, pdf, png). They can also choose to encrypt filenames and
hide them in the destination directory.
Logic Flow:
1. Initialization:
о The GUI is created with labels, text fields, checkboxes, radio buttons, and a button.
2. User Interaction:
User enters source and destination directory paths.
User selects file types to move (all or specific extensions).
User chooses encryption and hiding options (optional).
User clicks the "MOVE" button.
3. File Moving:
The code checks if both source and destination directories exist.
о
о
It creates a file filter based on the selected file types.
It retrieves a list of files to move from the source directory using the filter.
For each file:
The filename is optionally encrypted (not fully implemented).
A compressed filename is created (optional, not implemented).
A hidden filename is created by prepending a dot (.).
expand button
Transcribed Image Text:(Can be found in code directory as an png) Explanation of the Code: Functionality: This code implements a desktop application for moving files with optional features like encryption and hiding. Users can select a source directory, a destination directory, and choose which files to move based on extensions (all files, txt, pdf, png). They can also choose to encrypt filenames and hide them in the destination directory. Logic Flow: 1. Initialization: о The GUI is created with labels, text fields, checkboxes, radio buttons, and a button. 2. User Interaction: User enters source and destination directory paths. User selects file types to move (all or specific extensions). User chooses encryption and hiding options (optional). User clicks the "MOVE" button. 3. File Moving: The code checks if both source and destination directories exist. о о It creates a file filter based on the selected file types. It retrieves a list of files to move from the source directory using the filter. For each file: The filename is optionally encrypted (not fully implemented). A compressed filename is created (optional, not implemented). A hidden filename is created by prepending a dot (.).
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education