Skip to content

Commit

Permalink
LPD-22405 Source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
petershin authored and brianchandotcom committed Apr 9, 2024
1 parent 9d4f105 commit a37a4e3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ext.expectedFilePath = "LCP.json"
ext.expectedContentStrings = [
'"foo" : "bar"',
'"kind" : "Deployment"',
'"foo": "bar"',
'"kind": "Deployment"',
]
ext.taskPath = ":client-extension-no-classification:createClientExtensionConfig"
ext.unexpectedContentStrings = [
'"kind" : "Job"',
'"kind": "Job"',
]

apply from: project.property("commonScript.testClientExtensionBuildFileContentsTestCase.gradle")
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ext.expectedFilePath = "LCP.json"
ext.expectedContentStrings = [
'"foo" : "bar"',
'"dependencies" : [ "foo", "bar" ]',
'"memory" : 500',
'"LIFERAY_ROUTES_DXP" : "/etc/liferay/lxc/dxp-metadata"'
'"foo": "bar"',
'"dependencies": [ "foo", "bar" ]',
'"memory": 500',
'"LIFERAY_ROUTES_DXP": "/etc/liferay/lxc/dxp-metadata"'
]
ext.taskPath = ":client-extension-override-lcp-json:createClientExtensionConfig"
ext.unexpectedContentStrings = [
'"memory" : 300',
'"memory": 300',
]

apply from: project.property("commonScript.testClientExtensionBuildFileContentsTestCase.gradle")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ext.expectedContentStrings = [' ":configurator:policy" : "force"', ' "buildTimestamp" : ']
ext.expectedContentStrings = [' ":configurator:policy": "force"', ' "buildTimestamp": ']
ext.expectedFilePath = "site-initializer.client-extension-config.json"
ext.taskPath = ":site-initializer:createClientExtensionConfig"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ext.expectedContentStrings = [
'"externalReferenceCode" : "External Reference Code"',
'"membershipType" : "open"',
'"name" : "Site Name"',
'"parentSiteKey" : "Parent Site Name"',
'"templateKey" : "Sample Template Key"',
'"templateType" : "site-initializer"',
'"externalReferenceCode": "External Reference Code"',
'"membershipType": "open"',
'"name": "Site Name"',
'"parentSiteKey": "Parent Site Name"',
'"templateKey": "Sample Template Key"',
'"templateType": "site-initializer"',
]
ext.expectedFilePath = "site-initializer/site-initializer.json"
ext.taskPath = ":site-initializer:createClientExtensionConfig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ runGradleTest {
assert file.exists()

expectedContentStrings.each {
assert file.text.contains(it)
assert _contains(file, it)
}

unexpectedContentStrings.each {
assert !file.text.contains(it)
assert !_contains(file, it)
}
}
}

private boolean _contains(File file, String s) {
if (file.text.contains(s)) {
return true
}

if (file.text.contains(s.replaceAll('"(\\S+)": ', '"\$1" : '))) {
return true
}

return false
}

0 comments on commit a37a4e3

Please sign in to comment.