Statistics
| Branch: | Revision:

root / extensions / enterprise / src / test / java / org / jclouds / enterprise / config / EnterpriseConfigurationModuleTest.java @ 35e7942d

History | View | Annotate | Download (1.9 kB)

1
/**
2
 *
3
 * Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
4
 *
5
 * ====================================================================
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 * ====================================================================
18
 */
19
package org.jclouds.enterprise.config;
20

    
21
import static org.jclouds.Constants.PROPERTY_IO_WORKER_THREADS;
22
import static org.jclouds.Constants.PROPERTY_MAX_CONNECTIONS_PER_CONTEXT;
23
import static org.jclouds.Constants.PROPERTY_MAX_CONNECTIONS_PER_HOST;
24
import static org.jclouds.Constants.PROPERTY_USER_THREADS;
25

    
26
import java.util.Properties;
27

    
28
import org.jclouds.http.BaseHttpCommandExecutorServiceIntegrationTest;
29
import org.testng.annotations.Test;
30

    
31
import com.google.inject.Module;
32

    
33
/**
34
 * Tests the functionality of the {@link EnterpriseConfigurationModule}
35
 * 
36
 * @author Adrian Cole
37
 */
38
@Test
39
public class EnterpriseConfigurationModuleTest extends BaseHttpCommandExecutorServiceIntegrationTest {
40

    
41
   protected Module createConnectionModule() {
42
      return new EnterpriseConfigurationModule();
43
   }
44

    
45
   protected void addConnectionProperties(Properties props) {
46
      props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 50 + "");
47
      props.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 50 + "");
48
      // IO workers not used in this executor
49
      props.setProperty(PROPERTY_IO_WORKER_THREADS, 0 + "");
50
      props.setProperty(PROPERTY_USER_THREADS, 5 + "");
51
   }
52

    
53
}