Skip to content

Commit

Permalink
Add versionless tests covering new errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cbridgha committed Jul 14, 2024
1 parent 7256f9e commit 4795a23
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ protected ProgramOutput runFeatureUtility(String testcase, String[] params) thro

protected ProgramOutput runFeatureUtility(String testcase, String[] params, boolean debug) throws Exception {
Properties envProps = new Properties();
// add beta property here
// envProps.put("JVM_ARGS", "-Dbeta.property=true");
//add beta property here
envProps.put("JVM_ARGS", "-Dbeta.property=true");
return runFeatureUtility(testcase, params, envProps);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,43 @@ public void testInvalidMultiVersionFeatures() throws Exception {
}

/**
* Test the install of versionless servlet from maven central. Multi-version is not
* supported with installServerFeature as it cannot be installed to same
* resource.
* Test the install of versionless with bogus platform name xxx from maven central. Should throw expected platform name not found
*
* @throws Exception
*/
@Ignore
@Test
public void testVersionlessWithPlatformFeatures() throws Exception {
final String METHOD_NAME = "testInvalidMultiVersionFeatures";
public void testVersionlessWithBadPlatformFeatures() throws Exception {
final String METHOD_NAME = "testVersionlessWithBadPlatformFeatures";
Log.entering(c, METHOD_NAME);

copyFileToMinifiedRoot("usr/servers/serverX", "publish/tmp/versionlessBadPlatform/server.xml");

String[] param1s = { "installServerFeatures", "serverX", "--verbose" };

ProgramOutput po = runFeatureUtility(METHOD_NAME, param1s);

checkCommandOutput(po, 21, "CWWKF1515E", null); //UnKnown platform error
Log.exiting(c, METHOD_NAME);
}

/**
* Test the install of versionless with no platform defined. Should throw expected platform can't be determined error
*
* @throws Exception
*/
@Ignore
@Test
public void testVersionlessWithNoPlatformFeatures() throws Exception {
final String METHOD_NAME = "testVersionlessWithNoPlatformFeatures";
Log.entering(c, METHOD_NAME);

copyFileToMinifiedRoot("usr/servers/serverX", "publish/tmp/versionlessWPlatform/server.xml");
copyFileToMinifiedRoot("usr/servers/serverX", "publish/tmp/versionlessNoPlatform/server.xml");

String[] param1s = { "installServerFeatures", "serverX", "--verbose" };
ProgramOutput po = runFeatureUtility(METHOD_NAME, param1s);

checkCommandOutput(po, 21, "CWWKF1405E", null);
checkCommandOutput(po, 21, "CWWKF1516E", null); //Platform not determined
Log.exiting(c, METHOD_NAME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Enable features -->
<featureManager>
<platform>jakartaee-10.0</platform>
<platform>xxx</platform>
<feature>servlet</feature>
</featureManager>
</server>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

<!-- Enable features -->
<featureManager>
<feature>servlet</feature>
</featureManager>
</server>

0 comments on commit 4795a23

Please sign in to comment.