Skip to content

Some tests generate failures due to trailing space #333

Description

@pmerry96

The following tests generated failures:

TEST-com.sforce.ws.codegen.SObjectCodeGeneratorTest.xml
TEST-com.sforce.ws.codegen.ConnectorCodeGeneratorTest.xml
TEST-com.sforce.ws.codegen.AggregateCodeGeneratorTest.xml

Version: 61.1.0 - I have the tag checked out
Environment: Windows 10
Java version: openjdk-22 and the corretto-1.8 version of the Java 1.8 JDK.

Issue:
The issue I ran into was that tests would fail when running "mvn clean package" with a similar result to the example I will paste below:

<failure message="expected:<...rce.soap.enterprise;[ import com.sforce.ws.ConnectorConfig; import com.sforce.ws.ConnectionException; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public class Connector { public static final String END_POINT = "https://login.salesforce.com/services/Soap/c/16.0"; public static EnterpriseConnection newConnection(String username, String password) throws ConnectionException { ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); return newConnection(config); } public static EnterpriseConnection newConnection(ConnectorConfig config) throws ConnectionException { if (config.getAuthEndpoint() == null) { config.setAuthEndpoint(END_POINT); } if (config.getServiceEndpoint() == null) { config.setServiceEndpoint(END_POINT); } return new EnterpriseConnection(config); } } ] > but was:<...rce.soap.enterprise;[ import com.sforce.ws.ConnectorConfig; import com.sforce.ws.ConnectionException; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public class Connector { public static final String END_POINT = "https://login.salesforce.com/services/Soap/c/16.0"; public static EnterpriseConnection newConnection(String username, String password) throws ConnectionException { ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); return newConnection(config); } public static EnterpriseConnection newConnection(ConnectorConfig config) throws ConnectionException { if (config.getAuthEndpoint() == null) { config.setAuthEndpoint(END_POINT); } if (config.getServiceEndpoint() == null) { config.setServiceEndpoint(END_POINT); } return new EnterpriseConnection(config); } }] >" type="junit.framework.ComparisonFailure">
</failure>

Text was copied directly from output - I will put a formatted version below:

<failure message="expected:
<...rce.soap.enterprise;[ import com.sforce.ws.ConnectorConfig; import com.sforce.ws.ConnectionException; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public class Connector { public static final String END_POINT = "https://login.salesforce.com/services/Soap/c/16.0"; public static EnterpriseConnection newConnection(String username, String password) throws ConnectionException { ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); return newConnection(config); } public static EnterpriseConnection newConnection(ConnectorConfig config) throws ConnectionException { if (config.getAuthEndpoint() == null) { config.setAuthEndpoint(END_POINT); } if (config.getServiceEndpoint() == null) { config.setServiceEndpoint(END_POINT); } return new EnterpriseConnection(config); } } ] >

 but was:
 
 <...rce.soap.enterprise;[ import com.sforce.ws.ConnectorConfig; import com.sforce.ws.ConnectionException; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public class Connector { public static final String END_POINT = "https://login.salesforce.com/services/Soap/c/16.0"; public static EnterpriseConnection newConnection(String username, String password) throws ConnectionException { ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); return newConnection(config); } public static EnterpriseConnection newConnection(ConnectorConfig config) throws ConnectionException { if (config.getAuthEndpoint() == null) { config.setAuthEndpoint(END_POINT); } if (config.getServiceEndpoint() == null) { config.setServiceEndpoint(END_POINT); } return new EnterpriseConnection(config); } }] >" type="junit.framework.ComparisonFailure">
</failure>

Youll notice the expected/observed output is the same except for the very end in the bracketing. It appears to be related to a missing space following the closing } of the generated code.

Expected: ...} } ] >
Recieved: ...} }] >

This generates what is essentially an ignorable test failure, but should be resolved so the provided instructions to perform a "mvn clean package" generate a successful result with no errors.

I may be able to make a PR relating to this, but no promises on the time frame I can get to it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions