Skip to content

Commit

Permalink
mgmt, web, runtime for tomcat java17 (#27445)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Mar 7, 2022
1 parent d3c274a commit fa28aae
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Supported Tomcat 10 and Java 8, 11, 17 in `RuntimeStack` for `WebApp`.

## 2.12.0 (2022-02-14)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public class RuntimeStack {
/** Tomcat 9.0-jre8 image with catalina root set to Azure wwwroot. */
public static final RuntimeStack TOMCAT_9_0_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "9.0-jre8"));

/** Tomcat 10.0-java17 image with catalina root set to Azure wwwroot. */
public static final RuntimeStack TOMCAT_10_0_JAVA17 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-java17"));

/** Tomcat 10.0-jre11 image with catalina root set to Azure wwwroot. */
public static final RuntimeStack TOMCAT_10_0_JRE11 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-jre11"));

/** Tomcat 10.0-jre8 image with catalina root set to Azure wwwroot. */
public static final RuntimeStack TOMCAT_10_0_JRE8 = COLLECTION.addValue(new RuntimeStack("TOMCAT", "10.0-jre8"));

/** JBOSS EAP 7.2-java8. */
public static final RuntimeStack JBOSS_EAP_7_2_JAVA8 =
COLLECTION.addValue(new RuntimeStack("JBOSSEAP", "7.2-java8"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile

@Override
protected void cleanUpResources() {
resourceManager.resourceGroups().beginDeleteByName(rgName2);
resourceManager.resourceGroups().beginDeleteByName(rgName1);
if (rgName2 != null) {
resourceManager.resourceGroups().beginDeleteByName(rgName2);
}
if (rgName1 != null) {
resourceManager.resourceGroups().beginDeleteByName(rgName1);
}
}

@Test
Expand Down Expand Up @@ -190,4 +194,29 @@ public void canCRUDLinuxJava11WebApp() throws Exception {
Assertions.assertTrue(body.contains("Hello world from linux 4"));
}
}

@Test
public void canCRUDLinuxJava17WebApp() throws Exception {
// Create with new app service plan
WebApp webApp1 =
appServiceManager
.webApps()
.define(webappName1)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName1)
.withNewLinuxPlan(PricingTier.BASIC_B1)
.withBuiltInImage(RuntimeStack.TOMCAT_10_0_JAVA17)
.create();
Assertions.assertNotNull(webApp1);
Assertions.assertEquals(Region.US_WEST, webApp1.region());
AppServicePlan plan1 = appServiceManager.appServicePlans().getById(webApp1.appServicePlanId());
Assertions.assertNotNull(plan1);
Assertions.assertEquals(Region.US_WEST, plan1.region());
Assertions.assertEquals(PricingTier.BASIC_B1, plan1.pricingTier());
Assertions.assertEquals(OperatingSystem.LINUX, plan1.operatingSystem());
Assertions.assertEquals(OperatingSystem.LINUX, webApp1.operatingSystem());
Assertions.assertEquals(String.format("%s|%s", RuntimeStack.TOMCAT_10_0_JAVA17.stack(), RuntimeStack.TOMCAT_10_0_JAVA17.version()), webApp1.linuxFxVersion());

rgName2 = null;
}
}
Loading

0 comments on commit fa28aae

Please sign in to comment.