Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/org/labkey/test/params/FieldDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ else if (Character.isUpperCase(c) && Character.isLowerCase(chars[i - 1]))
}
}

// Multiple spaces in the UI are collapsed into a single space
return buf.toString().replaceAll("\\s+", " ");
return buf.toString();
}

public String getEffectiveLabel()
Expand Down
8 changes: 4 additions & 4 deletions src/org/labkey/test/util/TestDataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public static String randomDomainName(@Nullable String namePart, @Nullable Integ
String charSet = ALPHANUMERIC_STRING + DOMAIN_SPECIAL_STRING;
// TODO increase min to 5 and max to 50
String domainName = randomName(_namePart, getNumChars(numStartChars, 0), getNumChars(numEndChars, 10), charSet, null);
while (isDomainAndFieldNameInvalid(WebTestHelper.getRemoteApiConnection(false), _domainKind, domainName, null))
while (isDomainAndFieldNameInvalid(_domainKind, domainName, null))
domainName = randomName(_namePart, getNumChars(numStartChars, 0), getNumChars(numEndChars, 10), charSet, null);

// Multiple spaces in the UI are collapsed into a single space. If we need to test for handling of multiple spaces, we'll not use this generator
Expand Down Expand Up @@ -602,14 +602,14 @@ public static String randomFieldName(@NotNull String part, @Nullable Integer num

// TODO increase max to 50
String randomFieldName = randomName(part, getNumChars(numStartChars, 5), getNumChars(numEndChars, 5), chars, exclusion);
while (isDomainAndFieldNameInvalid(WebTestHelper.getRemoteApiConnection(false), _domainKind, null, randomFieldName))
while (isDomainAndFieldNameInvalid(_domainKind, null, randomFieldName))
randomFieldName = randomName(part, getNumChars(numStartChars, 5), getNumChars(numEndChars, 5), chars, exclusion);

TestLogger.log("Generated random field name for domainKind " + _domainKind + ": " + randomFieldName);
return randomFieldName;
}

private static boolean isDomainAndFieldNameInvalid(Connection connection, DomainUtils.DomainKind domainKind, @Nullable String domainName, @Nullable String fieldName)
private static boolean isDomainAndFieldNameInvalid(DomainUtils.DomainKind domainKind, @Nullable String domainName, @Nullable String fieldName)
{
SimplePostCommand command = new SimplePostCommand("property", "validateDomainAndFieldNames");
JSONObject domainDesign = new JSONObject();
Expand All @@ -630,7 +630,7 @@ private static boolean isDomainAndFieldNameInvalid(Connection connection, Domain

try
{
CommandResponse response = command.execute(connection, "/");
CommandResponse response = command.execute(WebTestHelper.getRemoteApiConnection(), "/home");
return response.getParsedData().containsKey("errors");
}
catch (CommandException | IOException e)
Expand Down