01: /*
02: * TestClassStringConstructor.java
03: *
04: * Created on October 16, 2006, 2:48 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09: /*
10: * Licensed to the Apache Software Foundation (ASF) under one
11: * or more contributor license agreements. See the NOTICE file
12: * distributed with this work for additional information
13: * regarding copyright ownership. The ASF licenses this file
14: * to you under the Apache License, Version 2.0 (the
15: * "License"); you may not use this file except in compliance
16: * with the License. You may obtain a copy of the License at
17: *
18: * http://www.apache.org/licenses/LICENSE-2.0
19: *
20: * Unless required by applicable law or agreed to in writing,
21: * software distributed under the License is distributed on an
22: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23: * KIND, either express or implied. See the License for the
24: * specific language governing permissions and limitations
25: * under the License.
26: */
27: package org.apache.openjpa.persistence.kernel;
28:
29: import org.apache.openjpa.persistence.kernel.common.apps.AppIdClassString;
30:
31: import org.apache.openjpa.persistence.OpenJPAEntityManager;
32:
33: public class TestClassStringConstructor extends BaseKernelTest {
34:
35: /**
36: * Creates a new instance of TestClassStringConstructor
37: */
38: public TestClassStringConstructor(String name) {
39: super (name);
40: }
41:
42: public void setUp() {
43: deleteAll(AppIdClassString.class);
44: }
45:
46: public void testConstructor() {
47: OpenJPAEntityManager pm = getPM();
48: startTx(pm);
49: AppIdClassString pc = new AppIdClassString(5);
50: pm.persist(pc);
51: endTx(pm);
52: endEm(pm);
53:
54: pm = getPM();
55: pc = pm.find(AppIdClassString.class,
56: new AppIdClassString.Idkey("5"));
57: assertEquals(5, pc.getPk());
58: endEm(pm);
59: }
60: }
|