Updating tests

This commit is contained in:
2023-05-05 20:19:27 -04:00
parent b3ca4754ea
commit 9c41f10576
45 changed files with 2729 additions and 2239 deletions

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/main/java/com/mattrixwv/cipherstream/polysubstitution/LargePolybiusSquare.java
//Mattrixwv
// Created: 04-21-23
// Modified: 04-21-23
// Modified: 05-04-23
package com.mattrixwv.cipherstream.polysubstitution;
@@ -16,9 +16,10 @@ import com.mattrixwv.cipherstream.exceptions.InvalidKeywordException;
public class LargePolybiusSquare extends PolybiusSquare{
protected static Logger logger = LoggerFactory.getLogger(LargePolybiusSquare.class);
private static final Logger logger = LoggerFactory.getLogger(LargePolybiusSquare.class);
//Create the grid from the keyword
@Override
protected void createGrid(){
logger.debug("Creating grid");
@@ -30,6 +31,7 @@ public class LargePolybiusSquare extends PolybiusSquare{
}
}
}
//Strips invalid characters from the string that needs encoded/decoded
@Override
protected void setInputStringEncode(String inputString) throws InvalidCharacterException, InvalidInputException{
if(inputString == null){
@@ -73,6 +75,7 @@ public class LargePolybiusSquare extends PolybiusSquare{
throw new InvalidInputException("Input must contain at least 1 letter");
}
}
//Returns the input string ready for encoding
@Override
protected String getPreparedInputStringEncode(){
logger.debug("Preparing input string for encoding");
@@ -84,6 +87,7 @@ public class LargePolybiusSquare extends PolybiusSquare{
return cleanString;
}
//Strips invalid characters from the keyword and creates the grid
@Override
protected void setKeyword(String keyword) throws InvalidKeywordException{
if(keyword == null){
@@ -112,6 +116,7 @@ public class LargePolybiusSquare extends PolybiusSquare{
//Create the grid from the sanitized keyword
createGrid();
}
//Adds characters that aren't letters to the output
@Override
protected void addCharactersToCleanStringEncode(String cleanString){
logger.debug("Formatting output string");
@@ -166,6 +171,8 @@ public class LargePolybiusSquare extends PolybiusSquare{
outputString = fullOutput.toString();
logger.debug("Saving output string {}", outputString);
}
//Makes sure all variables are empty
@Override
public void reset(){
logger.debug("Resetting");
@@ -176,6 +183,7 @@ public class LargePolybiusSquare extends PolybiusSquare{
keyword = "";
}
//Constructors
public LargePolybiusSquare() throws InvalidCharacterException{
super();
}