storage = new Temporary(); $this->storage->mkdir('foo/bar'); $this->storage->file_put_contents('foo/bar/file.txt', 'bar'); $this->storage->getScanner()->scan(''); } /** * @param $paths * @return ICacheEntry[] */ private function getFileInfos($paths) { $values = array_map(function ($path) { return $this->storage->getCache()->get($path); }, $paths); return array_combine($paths, $values); } public function testEtagPropagation(): void { $paths = ['', 'foo', 'foo/bar']; $oldInfos = $this->getFileInfos($paths); $this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time()); $newInfos = $this->getFileInfos($paths); foreach ($oldInfos as $i => $oldInfo) { $this->assertNotEquals($oldInfo->getEtag(), $newInfos[$i]->getEtag()); } } public function testTimePropagation(): void { $paths = ['', 'foo', 'foo/bar']; $oldTime = time() - 200; $targetTime = time() - 100; $now = time(); $cache = $this->storage->getCache(); $cache->put('', ['mtime' => $now]); $cache->put('foo', ['mtime' => $now]); $cache->put('foo/bar', ['mtime' => $oldTime]); $cache->put('foo/bar/file.txt', ['mtime' => $oldTime]); $this->storage->getPropagator()->propagateChange('foo/bar/file.txt', $targetTime); $newInfos = $this->getFileInfos($paths); $this->assertEquals($targetTime, $newInfos['foo/bar']->getMTime()); // dont lower mtimes $this->assertEquals($now, $newInfos['foo']->getMTime()); $this->assertEquals($now, $newInfos['']->getMTime()); } public function testSizePropagation(): void { $paths = ['', 'foo', 'foo/bar']; $oldInfos = $this->getFileInfos($paths); $this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time(), 10); $newInfos = $this->getFileInfos($paths); foreach ($oldInfos as $i => $oldInfo) { $this->assertEquals($oldInfo->getSize() + 10, $newInfos[$i]->getSize()); } } public function testSizePropagationNoNegative(): void { $paths = ['', 'foo', 'foo/bar']; $oldInfos = $this->getFileInfos($paths); $this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time(), -100); $newInfos = $this->getFileInfos($paths); foreach ($oldInfos as $i => $oldInfo) { $this->assertEquals(-1, $newInfos[$i]->getSize()); } } public function testBatchedPropagation(): void { $this->storage->mkdir('foo/baz'); $this->storage->mkdir('asd'); $this->storage->file_put_contents('asd/file.txt', 'bar'); $this->storage->file_put_contents('foo/baz/file.txt', 'bar'); $this->storage->getScanner()->scan(''); $paths = ['', 'foo', 'foo/bar', 'asd', 'foo/baz']; $oldInfos = $this->getFileInfos($paths); $propagator = $this->storage->getPropagator(); $propagator->beginBatch(); $propagator->propagateChange('asd/file.txt', time(), 10); $propagator->propagateChange('foo/bar/file.txt', time(), 2); $newInfos = $this->getFileInfos($paths); // no changes until we finish the batch foreach ($oldInfos as $i => $oldInfo) { $this->assertEquals($oldInfo->getSize(), $newInfos[$i]->getSize()); $this->assertEquals($oldInfo->getEtag(), $newInfos[$i]->getEtag()); $this->assertEquals($oldInfo->getMTime(), $newInfos[$i]->getMTime()); } $propagator->commitBatch(); $newInfos = $this->getFileInfos($paths); foreach ($oldInfos as $i => $oldInfo) { if ($oldInfo->getPath() !== 'foo/baz') { $this->assertNotEquals($oldInfo->getEtag(), $newInfos[$i]->getEtag(), "etag for {$oldInfo->getPath()} not updated"); } } $this->assertEquals($oldInfos['']->getSize() + 12, $newInfos['']->getSize()); $this->assertEquals($oldInfos['asd']->getSize() + 10, $newInfos['asd']->getSize()); $this->assertEquals($oldInfos['foo']->getSize() + 2, $newInfos['foo']->getSize()); $this->assertEquals($oldInfos['foo/bar']->getSize() + 2, $newInfos['foo/bar']->getSize()); $this->assertEquals($oldInfos['foo/baz']->getSize(), $newInfos['foo/baz']->getSize()); } } -gwt Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
summaryrefslogtreecommitdiffstats
path: root/documentation/layout/layout-splitpanel.asciidoc
blob: 0b9db3980e6b0885a71158ec2267918c6df8c0b7 (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