Skip to content

Commit b59e3aa

Browse files
author
Prasanna Santhanam
committed
Reverting the range of commits that broke the build
This reverts commits 30c3341..f6a2c81 Signed-off-by: Prasanna Santhanam <tsp@apache.org>
1 parent a440072 commit b59e3aa

190 files changed

Lines changed: 903 additions & 1384 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.

api/src/org/apache/cloudstack/config/Configuration.java

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

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

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

19-
import java.util.Arrays;
20-
2119
import junit.framework.Assert;
2220
import junit.framework.TestCase;
2321

22+
import org.apache.cloudstack.api.ResponseGenerator;
23+
import org.apache.cloudstack.api.ServerApiException;
24+
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
2425
import org.junit.Before;
2526
import org.junit.Rule;
2627
import org.junit.Test;
2728
import org.junit.rules.ExpectedException;
2829
import org.mockito.Mockito;
2930

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-
3431
import com.cloud.exception.DiscoveryException;
3532
import com.cloud.exception.ResourceInUseException;
3633
import com.cloud.org.Cluster;
3734
import com.cloud.resource.ResourceService;
3835

36+
import edu.emory.mathcs.backport.java.util.Arrays;
37+
3938
public class AddClusterCmdTest extends TestCase {
4039

4140
private AddClusterCmd addClusterCmd;
@@ -45,7 +44,6 @@ public class AddClusterCmdTest extends TestCase {
4544
@Rule
4645
public ExpectedException expectedException = ExpectedException.none();
4746

48-
@Override
4947
@Before
5048
public void setUp() {
5149
/*
@@ -112,7 +110,8 @@ public void testExecuteForResult() throws Exception {
112110
Cluster cluster = Mockito.mock(Cluster.class);
113111
Cluster[] clusterArray = new Cluster[] { cluster };
114112

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

117116
addClusterCmd.execute();
118117

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

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

19-
import java.util.Arrays;
20-
2119
import junit.framework.Assert;
2220
import junit.framework.TestCase;
2321

24-
import org.junit.Before;
25-
import org.junit.Rule;
26-
import org.junit.Test;
27-
import org.junit.rules.ExpectedException;
28-
import org.mockito.Mockito;
29-
3022
import org.apache.cloudstack.api.ResponseGenerator;
3123
import org.apache.cloudstack.api.ServerApiException;
3224
import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
3325
import org.apache.cloudstack.api.response.HostResponse;
3426
import org.apache.cloudstack.api.response.ListResponse;
27+
import org.junit.Before;
28+
import org.junit.Rule;
29+
import org.junit.Test;
30+
import org.junit.rules.ExpectedException;
31+
import org.mockito.Mockito;
3532

3633
import com.cloud.exception.DiscoveryException;
3734
import com.cloud.exception.InvalidParameterValueException;
3835
import com.cloud.host.Host;
3936
import com.cloud.resource.ResourceService;
4037

38+
import edu.emory.mathcs.backport.java.util.Arrays;
39+
4140
public class AddHostCmdTest extends TestCase {
4241

4342
private AddHostCmd addHostCmd;
@@ -47,7 +46,6 @@ public class AddHostCmdTest extends TestCase {
4746
@Rule
4847
public ExpectedException expectedException = ExpectedException.none();
4948

50-
@Override
5149
@Before
5250
public void setUp() {
5351
resourceService = Mockito.mock(ResourceService.class);
@@ -127,12 +125,14 @@ public void testExecuteForResult() throws Exception {
127125

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

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

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

client/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@
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+
198205
<dependency>
199206
<groupId>org.apache.cloudstack</groupId>
200207
<artifactId>cloud-engine-network</artifactId>

client/tomcatconf/applicationContext.xml.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
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" />
8584

8685
<!--
8786
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="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl" />
49+
<bean id="configurationDaoImpl" class="com.cloud.configuration.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="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl">
55+
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
5656
<property name="configParams">
5757
<map>
5858
<entry key="premium" value="true" />

engine/compute/pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. 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,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<artifactId>cloud-engine-compute</artifactId>
23+
<name>Apache CloudStack Cloud Engine Compute Component</name>
24+
<parent>
25+
<groupId>org.apache.cloudstack</groupId>
26+
<artifactId>cloud-engine</artifactId>
27+
<version>4.3.0-SNAPSHOT</version>
28+
<relativePath>../pom.xml</relativePath>
29+
</parent>
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.apache.cloudstack</groupId>
33+
<artifactId>cloud-engine-api</artifactId>
34+
<version>${project.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.apache.cloudstack</groupId>
38+
<artifactId>cloud-framework-ipc</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.apache.cloudstack</groupId>
43+
<artifactId>cloud-engine-components-api</artifactId>
44+
<version>${project.version}</version>
45+
</dependency>
46+
</dependencies>
47+
<build>
48+
<defaultGoal>install</defaultGoal>
49+
<sourceDirectory>src</sourceDirectory>
50+
<testSourceDirectory>test</testSourceDirectory>
51+
</build>
52+
</project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. 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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.compute;
20+
21+
import java.util.logging.Handler;
22+
23+
public interface ComputeOrchestrator {
24+
/**
25+
* start the vm
26+
* @param vm vm
27+
* @param reservationId
28+
*/
29+
void start(String vm, String reservationId, Handler handler);
30+
31+
void cancel(String reservationId);
32+
33+
void stop(String vm, String reservationId);
34+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. 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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.compute;
20+
21+
import java.util.logging.Handler;
22+
23+
24+
public class ComputeOrchestratorImpl implements ComputeOrchestrator {
25+
26+
@Override
27+
public void cancel(String reservationId) {
28+
}
29+
30+
@Override
31+
public void stop(String vm, String reservationId) {
32+
// Retrieve the VM
33+
// Locate the HypervisorGuru based on the VM type
34+
// Call HypervisorGuru to stop the VM
35+
}
36+
37+
@Override
38+
public void start(String vm, String reservationId, Handler handler) {
39+
// TODO Auto-generated method stub
40+
41+
}
42+
}

0 commit comments

Comments
 (0)