Skip to content

Commit

Permalink
Update cached data to Liberty 24.0.0.12 (#326)
Browse files Browse the repository at this point in the history
* new feature list and xsd

* move and update json

* Update code to use latest files

* Fix test cases
  • Loading branch information
cherylking authored Dec 10, 2024
1 parent dec2618 commit 83c67df
Show file tree
Hide file tree
Showing 11 changed files with 154,519 additions and 152,996 deletions.
2 changes: 1 addition & 1 deletion lemminx-liberty/src/it/schema-gen-ol-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<runtimeArtifact>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>24.0.0.11</version>
<version>24.0.0.12</version>
</runtimeArtifact>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testWorkspace() throws BadLocationException, IOException, URISyntaxE
testWorkspaceFolders.add(testWorkspace);
LibertyProjectsManager.getInstance().setWorkspaceFolders(testWorkspaceFolders);

String schemaFileName = "ol-24.0.0.11.xsd";
String schemaFileName = "ol-24.0.0.12.xsd";
File schemaFile = new File(LibertyUtils.getTempDir(LibertyProjectsManager.getInstance().getWorkspaceFolder(serverXmlFile.toURI().toString())), schemaFileName);
String serverGenXSDURI = schemaFile.toPath().toUri().toString().replace("///", "/");

Expand Down Expand Up @@ -79,8 +79,7 @@ public void testGetFeatures() throws BadLocationException {

CompletionItem jaxrsCompletion = c("jaxrs-2.1", "jaxrs-2.1");

// would be 348 if mpConfig-1.4 was not already specified - this is using ol-24.0.0.11
final int TOTAL_ITEMS = 348; // total number of available completion items
final int TOTAL_ITEMS = 352; // total number of available completion items

XMLAssert.testCompletionFor(serverXML, null, serverXmlFile.toURI().toString(), TOTAL_ITEMS, jaxrsCompletion);

Expand All @@ -89,7 +88,7 @@ public void testGetFeatures() throws BadLocationException {
XMLAssert.testCompletionFor(serverXML, null, serverXmlFile.toURI().toString(), TOTAL_ITEMS, websocket);

// Verify that a feature list was NOT generated. It should have downloaded the features.json from Maven Central.
String featureListName = "featurelist-ol-24.0.0.11.xml";
String featureListName = "featurelist-ol-24.0.0.12.xml";
File featurelistFile = new File(LibertyUtils.getTempDir(LibertyProjectsManager.getInstance().getWorkspaceFolder(serverXmlFile.toURI().toString())), featureListName);

org.junit.jupiter.api.Assertions.assertFalse(featurelistFile.exists(), "Found unexpected generated featurelist file: "+featureListName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public class LibertyXSDURIResolver implements URIResolverExtension, IExternalGra

// Changing this to contain the version in the file name since the file is copied to the local .lemminx cache.
// This is how we ensure the latest default server schema gets used in each developer environment.
private static final String XSD_RESOURCE_URL = "https://github.com/OpenLiberty/liberty-language-server/blob/master/lemminx-liberty/src/main/resources/schema/xsd/liberty/server-cached-24.0.0.11.xsd";
private static final String XSD_CLASSPATH_LOCATION = "/schema/xsd/liberty/server-cached-24.0.0.11.xsd";
private static final String XSD_RESOURCE_URL = "https://github.com/OpenLiberty/liberty-language-server/blob/master/lemminx-liberty/src/main/resources/schema/xsd/liberty/server-cached-24.0.0.12.xsd";
private static final String XSD_CLASSPATH_LOCATION = "/schema/xsd/liberty/server-cached-24.0.0.12.xsd";

/**
* SERVER_XSD_RESOURCE is the server schema that is located at XSD_CLASSPATH_LOCATION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public class FeatureService {

// This file is copied to the local .lemminx cache.
// This is how we ensure the latest default featurelist xml gets used in each developer environment.
private static final String FEATURELIST_XML_RESOURCE_URL = "https://github.com/OpenLiberty/liberty-language-server/blob/master/lemminx-liberty/src/main/resources/featurelist-cached-24.0.0.11.xml";
private static final String FEATURELIST_XML_CLASSPATH_LOCATION = "/featurelist-cached-24.0.0.11.xml";
private static final String FEATURELIST_XML_RESOURCE_URL = "https://github.com/OpenLiberty/liberty-language-server/blob/master/lemminx-liberty/src/main/resources/featurelist-cached-24.0.0.12.xml";
private static final String FEATURELIST_XML_CLASSPATH_LOCATION = "/featurelist-cached-24.0.0.12.xml";

/**
* FEATURELIST_XML_RESOURCE is the featurelist xml that is located at FEATURELIST_XML_CLASSPATH_LOCATION
Expand Down Expand Up @@ -140,7 +140,7 @@ private List<Feature> getDefaultFeatures() {
if (defaultFeatures == null) {
// Changing this to contain the version in the file name since the file is copied to the local .lemminx cache.
// This is how we ensure the latest default features json gets used in each developer environment.
InputStream is = getClass().getClassLoader().getResourceAsStream("features-cached-24.0.0.11.json");
InputStream is = getClass().getClassLoader().getResourceAsStream("features-cached-24.0.0.12.json");
InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8);

// Only need the public features
Expand Down
Loading

0 comments on commit 83c67df

Please sign in to comment.