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 @@
//MattrixwvWebsite/src/main/java/com/mattrixwv/CipherStreamJava/polySubstitution/Columnar.java
//Mattrixwv
// Created: 01-16-22
//Modified: 04-26-23
//Modified: 05-04-23
package com.mattrixwv.cipherstream.polysubstitution;
@@ -18,19 +18,20 @@ import com.mattrixwv.cipherstream.exceptions.InvalidKeywordException;
public class Columnar{
protected static Logger logger = LoggerFactory.getLogger(Columnar.class);
private static final Logger logger = LoggerFactory.getLogger(Columnar.class);
//Fields
protected String inputString; //The message that needs to be encoded/decoded
protected String inputString; //The message that needs to be encoded/decoded
protected String outputString; //The encoded/decoded message
protected String keyword; //The keyword used to create the grid
protected String keyword; //The keyword used to create the grid
protected char characterToAdd; //The character that is added to the end of a string to bring it to the correct length
protected int charsAdded; //The number of characters that were added to the end of the message
protected int charsAdded; //The number of characters that were added to the end of the message
protected ArrayList<ArrayList<Character>> grid; //The grid used to encode/decode the message
protected boolean preserveCapitals; //Persist capitals in the output string
//Settings
protected boolean preserveCapitals; //Persist capitals in the output string
protected boolean preserveWhitespace; //Persist whitespace in the output string
protected boolean preserveSymbols; //Persist symbols in the output string
protected boolean removePadding; //Remove the padding letters added to the cipher
protected boolean preserveSymbols; //Persist symbols in the output string
protected boolean removePadding; //Remove the padding letters added to the cipher
//Strip the inputString of all non-letter characters and change them to capitals
protected String getCleanInputString(){
@@ -467,7 +468,7 @@ public class Columnar{
createOutputStringFromRows();
}
//Constructor
//Constructors
public Columnar() throws InvalidCharacterException{
preserveCapitals = false;
preserveWhitespace = false;
@@ -492,6 +493,7 @@ public class Columnar{
setCharacterToAdd(characterToAdd);
reset();
}
//Encodes inputString using keyword and returns the result
public String encode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
//Set the parameters
@@ -525,7 +527,8 @@ public class Columnar{
grid = new ArrayList<>();
charsAdded = 0;
}
//Gets
//Getters
public String getInputString(){
return inputString;
}