01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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.internal.hibernate;
16:
17: import java.util.Collection;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.commons.logging.LogFactory;
21: import org.apache.tapestry.hibernate.HibernateSessionSource;
22: import org.apache.tapestry.internal.services.ClassNameLocatorImpl;
23: import org.apache.tapestry.ioc.internal.util.CollectionFactory;
24: import org.apache.tapestry.test.TapestryTestCase;
25: import org.testng.annotations.Test;
26:
27: public class HibernateSessionSourceImplTest extends TapestryTestCase {
28: private final Log _log = LogFactory
29: .getLog("tapestry.hibernate.HibernateSessionSourceTest");
30:
31: @Test
32: public void startup_without_packages() {
33: Collection<String> packageNames = CollectionFactory.newList(
34: "org.example.myapp.entities",
35: "org.example.app0.entities");
36:
37: HibernateSessionSource source = new HibernateSessionSourceImpl(
38: _log, packageNames, new ClassNameLocatorImpl());
39:
40: assertNotNull(source.create());
41: }
42: }
|