summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-02-03 22:26:47 +0200
committerArtur Signell <artur@vaadin.com>2012-02-03 22:26:47 +0200
commit04dabc72d1cce709c848b52d0f83f331104ebe92 (patch)
tree1a59a751c51f3f102c59d14d790d66e4379dc23b /tests
parent4ede774d6c121f51537078ae9890bbf44f835e12 (diff)
parent9d18b93a069503a9b9b90bd78836fde687af051d (diff)
downloadvaadin-framework-04dabc72d1cce709c848b52d0f83f331104ebe92.tar.gz
vaadin-framework-04dabc72d1cce709c848b52d0f83f331104ebe92.zip
Merge remote-tracking branch 'origin/6.8'
Conflicts: src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java tests/test.xml
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests.xml2
-rw-r--r--tests/server-side/com/vaadin/tests/server/SourceFileChecker.java77
-rw-r--r--tests/test.xml2
-rw-r--r--tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.html92
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java154
6 files changed, 309 insertions, 20 deletions
diff --git a/tests/integration_tests.xml b/tests/integration_tests.xml
index 22ad356338..3350a0d215 100644
--- a/tests/integration_tests.xml
+++ b/tests/integration_tests.xml
@@ -13,7 +13,7 @@
<fail unless="test.integration.antfile" message="test.integration.antfile must be set for integration tests to run" />
<!-- Test with these browsers -->
- <property name="test_browsers" value="winxp-firefox9" />
+ <property name="test_browsers" value="winxp-firefox10" />
<!-- Path to key file. Default value -->
<property name="sshkey.file" value="id_dsa" />
diff --git a/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java b/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java
index 5d39472712..3115ce49c8 100644
--- a/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java
+++ b/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java
@@ -4,6 +4,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashSet;
+import java.util.Set;
import junit.framework.Assert;
import junit.framework.TestCase;
@@ -23,6 +24,13 @@ public class SourceFileChecker extends TestCase {
+ "tests/server-side";
public static final String CLIENTSIDE_SRC_DIR = getBaseDir()
+ "tests/client-side";
+ private String externalJavaFiles = "com/vaadin/external";
+ private String buildFiles = "build";
+ private Set<String> alwaysIgnore = new HashSet<String>();
+ {
+ alwaysIgnore.add(".settings");
+ alwaysIgnore.add("eclipse");
+ }
public static String getBaseDir() {
if (baseDirectory != null) {
@@ -37,7 +45,7 @@ public class SourceFileChecker extends TestCase {
}
}
- baseDirectory = "";
+ baseDirectory = "./";
return baseDirectory;
}
@@ -45,14 +53,31 @@ public class SourceFileChecker extends TestCase {
TESTBENCH_SRC_DIR, SERVERSIDE_SRC_DIR, CLIENTSIDE_SRC_DIR };
public void testJavaFilesContainsLicense() throws IOException {
- validateJavaFiles(SRC_DIR, new LicenseChecker(),
- "The following files are missing license information:\n{0}");
+ Set<String> ignore = new HashSet<String>(alwaysIgnore);
+ ignore.add(externalJavaFiles);
+ validateFiles(SRC_DIR, new LicenseChecker(), ignore,
+ "The following files are missing license information:\n{0}",
+ ".java");
+ }
+
+ public void testNonJavaFilesUseUnixNewline() throws IOException {
+ Set<String> ignore = new HashSet<String>(alwaysIgnore);
+ ignore.add(buildFiles);
+
+ for (String suffix : new String[] { ".html", ".css", ".xml" }) {
+ validateFiles(getBaseDir(), new DosNewlineDetector(), ignore,
+ "The following files contain CRLF instead of LF:\n{0}",
+ suffix);
+ }
}
public void testJavaFilesUseUnixNewline() throws IOException {
+ Set<String> ignore = new HashSet<String>(alwaysIgnore);
+ ignore.add(externalJavaFiles);
for (String dir : ALL_SRC_DIRS) {
- validateJavaFiles(dir, new DosNewlineDetector(),
- "The following files contain CRLF instead of LF:\n{0}");
+ validateFiles(dir, new DosNewlineDetector(), ignore,
+ "The following files contain CRLF instead of LF:\n{0}",
+ ".java");
}
}
@@ -60,27 +85,45 @@ public class SourceFileChecker extends TestCase {
void validateFile(File f) throws Exception;
}
- private void validateJavaFiles(String directory, FileValidator validator,
- String errorMessage) {
+ private void validateFiles(String directory, FileValidator validator,
+ Set<String> ignore, String errorMessage, String ending) {
File srcDir = new File(directory);
- System.out.println(new File(".").getAbsolutePath());
HashSet<String> missing = new HashSet<String>();
- validateFiles(srcDir, missing, validator, ".java");
+ validateFiles(directory, srcDir, missing, validator, ending, ignore);
if (!missing.isEmpty()) {
- throw new RuntimeException(errorMessage.replace("{0}",
- missing.toString()));
+ throw new RuntimeException(errorMessage.replace("{0}", missing
+ .toString().replace(',', '\n')));
}
}
- private void validateFiles(File srcDir, HashSet<String> missing,
- FileValidator validator, String suffix) {
- Assert.assertTrue("Directory " + srcDir + " does not exist",
- srcDir.exists());
+ private void validateFiles(String baseDirectory, File directory,
+ HashSet<String> missing, FileValidator validator, String suffix,
+ Set<String> ignores) {
+ Assert.assertTrue("Directory " + directory + " does not exist",
+ directory.exists());
+
+ File[] files = directory.listFiles();
+ if (files == null) {
+ throw new RuntimeException("Listing of directory "
+ + directory.getPath() + " failed");
+ }
+ for (File f : files) {
+ boolean ignoreThis = false;
+ for (String ignore : ignores) {
+ if (new File(baseDirectory, ignore).equals(f)) {
+ ignoreThis = true;
+ continue;
+ }
+ }
+
+ if (ignoreThis) {
+ continue;
+ }
- for (File f : srcDir.listFiles()) {
if (f.isDirectory()) {
- validateFiles(f, missing, validator, suffix);
+ validateFiles(baseDirectory, f, missing, validator, suffix,
+ ignores);
} else if (f.getName().endsWith(suffix)) {
try {
validator.validateFile(f);
diff --git a/tests/test.xml b/tests/test.xml
index 9d060c9a29..2baa26218a 100644
--- a/tests/test.xml
+++ b/tests/test.xml
@@ -11,7 +11,7 @@
<!-- Configuration -->
<!-- ================================================================== -->
<!-- Browsers to use for testing -->
- <property name="browsers-windows" value="winxp-ie8,win7-ie9,winxp-firefox9,winxp-safari5,winxp-googlechrome-stable,winxp-opera11" />
+ <property name="browsers-windows" value="winxp-ie8,win7-ie9,winxp-firefox10,winxp-safari5,winxp-googlechrome-stable,winxp-opera11" />
<property name="browsers-linux" value="linux-firefox3,linux-opera10,linux-googlechrome8" />
<property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" />
diff --git a/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java b/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java
index 0fb346736e..b3a7af42b9 100644
--- a/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java
+++ b/tests/testbench/com/vaadin/launcher/DevelopmentServerLauncher.java
@@ -64,7 +64,7 @@ public class DevelopmentServerLauncher {
try {
url = runServer(serverArgs, "Development Server Mode");
// Start Browser
- if (!serverArgs.containsKey("nogui") && url != null) {
+ if (serverArgs.containsKey("gui") && url != null) {
System.out.println("Starting Web Browser.");
// Open browser into application URL
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.html b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.html
new file mode 100644
index 0000000000..dfd001bf5c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.html
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.HeaderFooterClickLeftRightMiddle?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td>59,8</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>1. Click on header col1 using left</td>
+</tr>
+<tr>
+ <td>mouseDownRight</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseUpRight</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>2. Click on header col1 using right</td>
+</tr>
+<tr>
+ <td>doubleClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>3. Double click on header col1 using*</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td>59,8</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>4. Click on footer col2 using left</td>
+</tr>
+<tr>
+ <td>mouseDownRight</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseUpRight</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>5. Click on footer col2 using right</td>
+</tr>
+<tr>
+ <td>doubleClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VScrollTable[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableHeaderFooterClickLeftRightMiddle::PID_SLog_row_0</td>
+ <td>6. Double click on footer col2 using*</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
new file mode 100644
index 0000000000..642067d826
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
@@ -0,0 +1,154 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.FooterClickEvent;
+import com.vaadin.ui.Table.FooterClickListener;
+import com.vaadin.ui.Table.HeaderClickEvent;
+import com.vaadin.ui.Table.HeaderClickListener;
+
+public class HeaderFooterClickLeftRightMiddle extends TestBase {
+
+ private Log log = new Log(10);
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ table.setColumnReorderingAllowed(true);
+ table.setContainerDataSource(createContainer());
+ table.setWidth("400px");
+ table.setHeight("400px");
+ table.setImmediate(true);
+ table.setFooterVisible(true);
+
+ CheckBox immediateCheckbox = new CheckBox("Immediate");
+ immediateCheckbox.setImmediate(true);
+ immediateCheckbox.setValue(table.isImmediate());
+ immediateCheckbox.addListener(new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ table.setImmediate(event.getButton().booleanValue());
+ }
+ });
+
+ CheckBox headerClickListenerCheckbox = new CheckBox(
+ "Header click listener");
+ headerClickListenerCheckbox.setImmediate(true);
+ headerClickListenerCheckbox.addListener(new ValueChangeListener() {
+
+ private HeaderClickListener headerClickListener = new HeaderClickListener() {
+
+ public void headerClick(HeaderClickEvent event) {
+ String type = event.isDoubleClick() ? "Double click"
+ : "Click";
+ log.log(type + " on header "
+ + event.getPropertyId().toString() + " using "
+ + event.getButtonName());
+ }
+
+ };
+
+ public void valueChange(ValueChangeEvent event) {
+ if (table.getListeners(HeaderClickEvent.class).isEmpty()) {
+ table.addListener(headerClickListener);
+ } else {
+ table.removeListener(headerClickListener);
+ }
+ }
+ });
+ headerClickListenerCheckbox.setValue(true);
+
+ CheckBox footerClickListenerCheckbox = new CheckBox(
+ "Footer click listener");
+ footerClickListenerCheckbox.setImmediate(true);
+ footerClickListenerCheckbox.addListener(new ValueChangeListener() {
+
+ private FooterClickListener footerClickListener = new FooterClickListener() {
+
+ public void footerClick(FooterClickEvent event) {
+ String type = event.isDoubleClick() ? "Double click"
+ : "Click";
+ log.log(type + " on footer "
+ + event.getPropertyId().toString() + " using "
+ + event.getButtonName());
+ }
+ };
+
+ public void valueChange(ValueChangeEvent event) {
+ if (table.getListeners(FooterClickEvent.class).isEmpty()) {
+ table.addListener(footerClickListener);
+ } else {
+ table.removeListener(footerClickListener);
+ }
+ }
+ });
+ footerClickListenerCheckbox.setValue(true);
+
+ CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
+ sortEnabledCheckbox.setImmediate(true);
+ sortEnabledCheckbox.setValue(!table.isSortDisabled());
+ sortEnabledCheckbox.addListener(new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ table.setSortDisabled(!event.getButton().booleanValue());
+ }
+ });
+
+ CheckBox columnReorderingCheckbox = new CheckBox(
+ "Column reordering allowed");
+ columnReorderingCheckbox.setImmediate(true);
+ columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
+ columnReorderingCheckbox.addListener(new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ table.setColumnReorderingAllowed(event.getButton()
+ .booleanValue());
+ }
+ });
+
+ addComponent(immediateCheckbox);
+ addComponent(headerClickListenerCheckbox);
+ addComponent(footerClickListenerCheckbox);
+ addComponent(sortEnabledCheckbox);
+ addComponent(columnReorderingCheckbox);
+ addComponent(table);
+ addComponent(log);
+
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests the header click listener";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 4515;
+ }
+
+ private Container createContainer() {
+ IndexedContainer container = new IndexedContainer();
+ container.addContainerProperty("col1", String.class, "");
+ container.addContainerProperty("col2", String.class, "");
+ container.addContainerProperty("col3", String.class, "");
+
+ for (int i = 0; i < 100; i++) {
+ Item item = container.addItem("item " + i);
+ item.getItemProperty("col1").setValue("first" + i);
+ item.getItemProperty("col2").setValue("middle" + i);
+ item.getItemProperty("col3").setValue("last" + i);
+ }
+
+ return container;
+ }
+
+}
tion value='backport/49153/stable28'>backport/49153/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/core/l10n/mk.js
blob: 488a0ca675cecdfb97cdfbca93c5307a789b9b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399