View Javadoc
1   package org.apache.turbine.services.jsonrpc;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import static org.junit.Assert.assertNotNull;
23  
24  import java.util.HashMap;
25  import java.util.Map;
26  
27  import org.apache.turbine.TurbineConstants;
28  import org.apache.turbine.test.BaseTestCase;
29  import org.apache.turbine.util.TurbineConfig;
30  import org.jabsorb.JSONRPCBridge;
31  import org.junit.AfterClass;
32  import org.junit.BeforeClass;
33  import org.junit.Test;
34  
35  public class JsonrpcServicelTest
36          extends BaseTestCase
37  {
38      private static TurbineConfig turbineConfig = null;
39  
40  
41      @BeforeClass
42      public static void setUp() throws Exception {
43  //        serviceManager = TurbineServices.getInstance();
44  //        serviceManager.setApplicationRoot(".");
45  
46          Map<String, String> initParams = new HashMap<String, String>();
47          initParams.put(TurbineConfig.PROPERTIES_PATH_KEY, "conf/test/CompleteTurbineResources.properties"); // "conf/test/TurbineResources.properties"
48          initParams.put(TurbineConstants.LOGGING_ROOT_KEY, "target/test-logs");
49  
50          turbineConfig = new TurbineConfig(".", initParams);
51          turbineConfig.initialize();
52      }
53  
54      @AfterClass
55      public static void destroy() throws Exception {
56          turbineConfig.dispose();
57      }
58  
59  
60      @Test public void testBridgeAccess()
61      {
62          JSONRPCBridge bridge = new JSONRPCBridge();
63          assertNotNull(bridge);
64      }
65  
66  }