01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.lucene.store.jdbc;
18:
19: import junit.framework.TestCase;
20:
21: /**
22: * @author kimchy
23: */
24: public class JdbcDirectorySettingsTests extends TestCase {
25:
26: public void testDefaultSettings() {
27: JdbcDirectorySettings settings = new JdbcDirectorySettings();
28:
29: assertEquals("name_", settings.getNameColumnName());
30: assertEquals("size_", settings.getSizeColumnName());
31: assertEquals("value_", settings.getValueColumnName());
32: assertEquals("deleted_", settings.getDeletedColumnName());
33: assertEquals("lf_", settings.getLastModifiedColumnName());
34:
35: assertEquals(50, settings.getNameColumnLength());
36: assertEquals(500 * 1000, settings.getValueColumnLengthInK());
37:
38: assertEquals(10, settings.getQueryTimeout());
39:
40: assertEquals(60 * 60 * 1000, settings
41: .getDeleteMarkDeletedDelta());
42: }
43:
44: public void testFileEntrySettings() {
45: JdbcDirectorySettings settings = new JdbcDirectorySettings();
46: JdbcFileEntrySettings feSettings = new JdbcFileEntrySettings();
47: settings.registerFileEntrySettings("tst", feSettings);
48: assertEquals(feSettings, settings.getFileEntrySettings("tst"));
49: assertEquals(feSettings, settings.getFileEntrySettings("1.tst"));
50: assertEquals(settings.getDefaultFileEntrySettings(), settings
51: .getFileEntrySettings("test"));
52: assertEquals(settings.getDefaultFileEntrySettings(), settings
53: .getFileEntrySettings("1.test"));
54: }
55: }
|