|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
DefaultResourceLocalizerTest.java | - | 0% | 0% | 0% |
|
1 | // Copyright 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.tapestry.l10n; | |
16 | ||
17 | import java.util.Locale; | |
18 | ||
19 | import org.apache.hivemind.Resource; | |
20 | import org.apache.hivemind.test.HiveMindTestCase; | |
21 | ||
22 | /** | |
23 | * Tests for {@link org.apache.tapestry.l10n.DefaultResourceLocalizer}. | |
24 | * | |
25 | * @author Howard M. Lewis Ship | |
26 | * @since 4.0 | |
27 | */ | |
28 | public class DefaultResourceLocalizerTest extends HiveMindTestCase | |
29 | { | |
30 | 0 | public void testLocalizer() |
31 | { | |
32 | 0 | Resource root = newResource(); |
33 | 0 | Resource localized = newResource(); |
34 | 0 | Locale locale = Locale.getDefault(); |
35 | ||
36 | 0 | root.getLocalization(locale); |
37 | 0 | setReturnValue(root, localized); |
38 | ||
39 | 0 | replayControls(); |
40 | ||
41 | 0 | Resource actual = new DefaultResourceLocalizer().findLocalization(root, locale); |
42 | ||
43 | 0 | assertSame(localized, actual); |
44 | ||
45 | 0 | verifyControls(); |
46 | } | |
47 | ||
48 | 0 | private Resource newResource() |
49 | { | |
50 | 0 | return (Resource) newMock(Resource.class); |
51 | } | |
52 | } |
|