Skip to content

Commit 5495f10

Browse files
author
Alex Huang
committed
Revert "Reverting the range of commits that broke the build"
This reverts commit b59e3aa.
1 parent d38ed20 commit 5495f10

190 files changed

Lines changed: 1384 additions & 903 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.config;
18+
19+
import java.util.Date;
20+
21+
/**
22+
* Configuration represents one global configuration parameter for CloudStack.
23+
* Its scope should indicate whether this parameter can be set at different
24+
* organization levels in CloudStack.
25+
*
26+
*/
27+
public interface Configuration {
28+
29+
/**
30+
* @return Category of the parameter.
31+
*/
32+
String getCategory();
33+
34+
/**
35+
* @return Server instance that uses this parameter.
36+
*/
37+
String getInstance();
38+
39+
/**
40+
* @return Component that introduced this parameter.
41+
*/
42+
String getComponent();
43+
44+
/**
45+
* @return Name of the parameter.
46+
*/
47+
String getName();
48+
49+
/**
50+
* @return Value set by the administrator. Defaults to the defaultValue.
51+
*/
52+
String getValue();
53+
54+
/**
55+
* @return Description of the value and the range of the value.
56+
*/
57+
String getDescription();
58+
59+
/**
60+
* @return Default value for this parameter. Null indicates this parameter is optional.
61+
*/
62+
String getDefaultValue();
63+
64+
/**
65+
* @return Scope for the parameter. Null indicates that this parameter is
66+
* always global. A non-null value indicates that this parameter can be
67+
* set at a certain organization level.
68+
*/
69+
String getScope();
70+
71+
/**
72+
* @return can the configuration parameter be changed without restarting the server.
73+
*/
74+
boolean isDynamic();
75+
76+
/**
77+
* @return The date this VO was updated by the components. Note that this is not
78+
* a date for when an administrator updates the value. This is when the system
79+
* updated this value. By searching on this field gives you all the config
80+
* parameters that have changed in an upgrade. Null value indicates that this
81+
* parameter is no longer used and can be deleted.
82+
*/
83+
Date getUpdated();
84+
}

api/test/org/apache/cloudstack/api/command/test/AddClusterCmdTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,26 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.test;
1818

19+
import java.util.Arrays;
20+
1921
import junit.framework.Assert;
2022
import junit.framework.TestCase;
2123

22-
import org.apache.cloudstack.api.ResponseGenerator;
23-
import org.apache.cloudstack.api.ServerApiException;
24-
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
2524
import org.junit.Before;
2625
import org.junit.Rule;
2726
import org.junit.Test;
2827
import org.junit.rules.ExpectedException;
2928
import org.mockito.Mockito;
3029

30+
import org.apache.cloudstack.api.ResponseGenerator;
31+
import org.apache.cloudstack.api.ServerApiException;
32+
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
33+
3134
import com.cloud.exception.DiscoveryException;
3235
import com.cloud.exception.ResourceInUseException;
3336
import com.cloud.org.Cluster;
3437
import com.cloud.resource.ResourceService;
3538

36-
import edu.emory.mathcs.backport.java.util.Arrays;
37-
3839
public class AddClusterCmdTest extends TestCase {
3940

4041
private AddClusterCmd addClusterCmd;
@@ -44,6 +45,7 @@ public class AddClusterCmdTest extends TestCase {
4445
@Rule
4546
public ExpectedException expectedException = ExpectedException.none();
4647

48+
@Override
4749
@Before
4850
public void setUp() {
4951
/*
@@ -110,8 +112,7 @@ public void testExecuteForResult() throws Exception {
110112
Cluster cluster = Mockito.mock(Cluster.class);
111113
Cluster[] clusterArray = new Cluster[] { cluster };
112114

113-
Mockito.when(resourceService.discoverCluster(addClusterCmd))
114-
.thenReturn(Arrays.asList(clusterArray));
115+
Mockito.doReturn(Arrays.asList(clusterArray)).when(resourceService).discoverCluster(addClusterCmd);
115116

116117
addClusterCmd.execute();
117118

api/test/org/apache/cloudstack/api/command/test/AddHostCmdTest.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,28 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.test;
1818

19+
import java.util.Arrays;
20+
1921
import junit.framework.Assert;
2022
import junit.framework.TestCase;
2123

22-
import org.apache.cloudstack.api.ResponseGenerator;
23-
import org.apache.cloudstack.api.ServerApiException;
24-
import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
25-
import org.apache.cloudstack.api.response.HostResponse;
26-
import org.apache.cloudstack.api.response.ListResponse;
2724
import org.junit.Before;
2825
import org.junit.Rule;
2926
import org.junit.Test;
3027
import org.junit.rules.ExpectedException;
3128
import org.mockito.Mockito;
3229

30+
import org.apache.cloudstack.api.ResponseGenerator;
31+
import org.apache.cloudstack.api.ServerApiException;
32+
import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
33+
import org.apache.cloudstack.api.response.HostResponse;
34+
import org.apache.cloudstack.api.response.ListResponse;
35+
3336
import com.cloud.exception.DiscoveryException;
3437
import com.cloud.exception.InvalidParameterValueException;
3538
import com.cloud.host.Host;
3639
import com.cloud.resource.ResourceService;
3740

38-
import edu.emory.mathcs.backport.java.util.Arrays;
39-
4041
public class AddHostCmdTest extends TestCase {
4142

4243
private AddHostCmd addHostCmd;
@@ -46,6 +47,7 @@ public class AddHostCmdTest extends TestCase {
4647
@Rule
4748
public ExpectedException expectedException = ExpectedException.none();
4849

50+
@Override
4951
@Before
5052
public void setUp() {
5153
resourceService = Mockito.mock(ResourceService.class);
@@ -125,14 +127,12 @@ public void testExecuteForResult() throws Exception {
125127

126128
HostResponse responseHost = new HostResponse();
127129
responseHost.setName("Test");
128-
Mockito.when(resourceService.discoverHosts(addHostCmd)).thenReturn(
129-
Arrays.asList(mockArray));
130-
Mockito.when(responseGenerator.createHostResponse(host)).thenReturn(
131-
responseHost);
130+
Mockito.doReturn(Arrays.asList(mockArray)).when(resourceService).discoverHosts(addHostCmd);
131+
Mockito.when(responseGenerator.createHostResponse(host)).thenReturn(responseHost);
132132
addHostCmd.execute();
133133
Mockito.verify(responseGenerator).createHostResponse(host);
134-
ListResponse<HostResponse> actualResponse = ((ListResponse<HostResponse>) addHostCmd
135-
.getResponseObject());
134+
@SuppressWarnings("unchecked")
135+
ListResponse<HostResponse> actualResponse = ((ListResponse<HostResponse>)addHostCmd.getResponseObject());
136136
Assert.assertEquals(responseHost, actualResponse.getResponses().get(0));
137137
Assert.assertEquals("addhostresponse", actualResponse.getResponseName());
138138

@@ -144,8 +144,7 @@ public void testExecuteForDiscoveryException() {
144144
addHostCmd._resourceService = resourceService;
145145

146146
try {
147-
Mockito.when(resourceService.discoverHosts(addHostCmd)).thenThrow(
148-
DiscoveryException.class);
147+
Mockito.when(resourceService.discoverHosts(addHostCmd)).thenThrow(DiscoveryException.class);
149148
} catch (InvalidParameterValueException e) {
150149
e.printStackTrace();
151150
} catch (IllegalArgumentException e) {

client/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@
195195
<artifactId>cloud-engine-components-api</artifactId>
196196
<version>${project.version}</version>
197197
</dependency>
198-
199-
<dependency>
200-
<groupId>org.apache.cloudstack</groupId>
201-
<artifactId>cloud-engine-compute</artifactId>
202-
<version>${project.version}</version>
203-
</dependency>
204-
205198
<dependency>
206199
<groupId>org.apache.cloudstack</groupId>
207200
<artifactId>cloud-engine-network</artifactId>

client/tomcatconf/applicationContext.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
</bean>
8282

8383
<bean id="messageBus" class = "org.apache.cloudstack.framework.messagebus.MessageBusBase" />
84+
<bean id="configDepot" class = "org.apache.cloudstack.framework.config.ConfigDepotImpl" />
8485

8586
<!--
8687
DAO with customized configuration

client/tomcatconf/componentContext.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
-->
4747

4848
<bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
49-
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl" />
49+
<bean id="configurationDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl" />
5050
<bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
5151

5252
<!--

client/tomcatconf/nonossComponentContext.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<!--
5353
DAO with customized configuration under non-OSS deployment
5454
-->
55-
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
55+
<bean id="configurationDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl">
5656
<property name="configParams">
5757
<map>
5858
<entry key="premium" value="true" />

engine/compute/pom.xml

Lines changed: 0 additions & 52 deletions
This file was deleted.

engine/compute/src/org/apache/cloudstack/compute/ComputeOrchestrator.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

engine/compute/src/org/apache/cloudstack/compute/ComputeOrchestratorImpl.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)