예제 #1
0
 @Test
 public void testDefaultAdapter() {
   String veryLongVarName =
       defaultAdapter.nameTopVariable(veryLongSignatureVarName, defaultSuffix, emptyVarSet);
   assertEquals(
       veryLongVarName, defaultAdapter.sqlQuote(veryLongSignatureVarName + defaultSuffix));
 }
예제 #2
0
 @Test(expected = RuntimeException.class)
 public void testOracleTooMuchSimilarVars() {
   Set<String> assignedVars = new HashSet<>();
   int createdVarNb = (int) (Math.pow(10, OracleSQLDialectAdapter.VARIABLE_NUMBER_LENGTH) + 1);
   for (int i = 0; i < createdVarNb; i++) {
     assignedVars.add(
         oracleAdapter.nameTopVariable(veryLongSignatureVarName, defaultSuffix, assignedVars));
   }
 }
예제 #3
0
 @Test
 public void testOracleOneShot() {
   String veryLongVarName =
       oracleAdapter.nameTopVariable(veryLongSignatureVarName, defaultSuffix, emptyVarSet);
   assertTrue(veryLongVarName.length() <= OracleSQLDialectAdapter.VARIABLE_NAME_MAX_LENGTH);
   assertTrue(veryLongVarName.contains(defaultSuffix));
   assertTrue(veryLongVarName.contains("veryVery"));
   assertEquals(veryLongVarName, "\"veryVeryVeryVeryVeryV0Suffix\"");
 }
예제 #4
0
 @Test
 public void testOracleTenSimilarVars() {
   Set<String> assignedVars = new HashSet<>();
   int createdVarNb = (int) Math.pow(10, OracleSQLDialectAdapter.VARIABLE_NUMBER_LENGTH);
   for (int i = 0; i < createdVarNb; i++) {
     assignedVars.add(
         oracleAdapter.nameTopVariable(veryLongSignatureVarName, defaultSuffix, assignedVars));
   }
   assertEquals(assignedVars.size(), createdVarNb);
 }
예제 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void testOracleExcessiveSuffix2() {
   oracleAdapter.nameTopVariable("short", excessiveSuffix + "More", emptyVarSet);
 }
예제 #6
0
 @Test
 public void testOracleMaxNonModifiedVarName() {
   String limitVarName =
       oracleAdapter.nameTopVariable(limitSignatureVarName, defaultSuffix, emptyVarSet);
   assertEquals(limitVarName, oracleAdapter.sqlQuote(limitSignatureVarName + defaultSuffix));
 }