Skip to content

Commit 45b64ec

Browse files
committed
Added another test
1 parent 5079301 commit 45b64ec

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

test/src/suite/diagnostics.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,16 @@ suite("Apache Dispatcher Config Language Support for Visual Studio Code Diagnost
227227
assert.strictEqual(diagnostics[i].severity, vscode.DiagnosticSeverity.Warning);
228228
}
229229
});
230+
231+
test("'dispatcher.any' File With 0 Duplicate Properties/Strings Has 0 Diagnostic Warnings", async () => {
232+
const textEditor: vscode.TextEditor = await openDocumentByRelativeUri("generic/dispatcher.any");
233+
const document: vscode.TextDocument = textEditor.document;
234+
235+
await sleep(DIAGNOSTIC_SLEEP_TIMEOUT_MS);
236+
237+
const diagnostics: vscode.Diagnostic[] = vscode.languages.getDiagnostics(document.uri);
238+
const totalDiagnostics: number = diagnostics.length;
239+
240+
assert.strictEqual(totalDiagnostics === 0, true, `Expected exactly 0 diagnostic warnings, found ${totalDiagnostics}`);
241+
});
230242
});
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# This file was borrowed from https://github.com/adobe/aem-dispatcher-experiments/blob/main/dispatcher-config-basic/private/etc/apache2/conf/dispatcher.any and modified
2+
3+
/farms {
4+
/publish {
5+
/clientheaders {
6+
"*"
7+
}
8+
9+
/virtualhosts {
10+
"aem-publish.local"
11+
}
12+
13+
/renders {
14+
/rend01 {
15+
/hostname "127.0.0.1"
16+
/port "4503"
17+
}
18+
}
19+
20+
/filter {
21+
/0000 { /url "/*" /type "allow" }
22+
/0001 { /type "deny" /url '/(system|crx|admin)(/.*)?' }
23+
/0002 { /type "allow" /url "/system/sling/logout*" }
24+
}
25+
26+
/cache {
27+
/docroot "/Library/WebServer/docroot/publish"
28+
29+
/statfileslevel "0"
30+
31+
/allowAuthorized "0"
32+
33+
/rules {
34+
/0000 {
35+
/glob "*"
36+
/type "deny"
37+
}
38+
39+
/0005 {
40+
/glob "/content/*"
41+
/type "allow"
42+
}
43+
44+
/0006 {
45+
/glob "/etc.clientlibs/*"
46+
/type "allow"
47+
}
48+
49+
/0007 {
50+
/glob "/favicon.ico"
51+
/type "allow"
52+
}
53+
54+
/0008 {
55+
/glob "/conf/*"
56+
/type "allow"
57+
}
58+
}
59+
60+
/invalidate {
61+
/0000 {
62+
/glob "*"
63+
/type "deny"
64+
}
65+
66+
/0001 {
67+
/glob "*.html"
68+
/type "allow"
69+
}
70+
71+
/0002 {
72+
/glob "/etc/segmentation.segment.js"
73+
/type "allow"
74+
}
75+
76+
/0003 {
77+
/glob "*/analytics.sitecatalyst.js"
78+
/type "allow"
79+
}
80+
}
81+
82+
/allowedClients {
83+
/0000 {
84+
/glob "*"
85+
/type "deny"
86+
}
87+
88+
/0001 {
89+
/glob "127.0.0.1"
90+
/type "allow"
91+
}
92+
}
93+
94+
/ignoreUrlParams {
95+
/0001 { /glob "*" /type "deny" }
96+
/0002 { /glob "utm_campaign" /type "allow" }
97+
}
98+
}
99+
100+
/statistics {
101+
/categories {
102+
/html {
103+
/glob "*.html"
104+
}
105+
106+
/others {
107+
/glob "*"
108+
}
109+
}
110+
}
111+
}
112+
}

0 commit comments

Comments
 (0)