Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit f68a54d

Browse files
author
Libor Zoubek
committed
Bug 1188751 - Deploying Versioned WAR package from repository to JBOS
Fix itests - removed test for creating deployment child to serverGroup resource (removed from code base prior 3.3) (cherry picked from commit cb3d26e) Signed-off-by: Libor Zoubek <lzoubek@redhat.com>
1 parent 5f9baed commit f68a54d

File tree

4 files changed

+3
-44
lines changed

4 files changed

+3
-44
lines changed

modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/nonpc/UploadAndDeployTest.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -368,46 +368,4 @@ public void testUploadViaCreateChild1() throws Exception {
368368
}
369369
}
370370

371-
/**
372-
* Test the real API code for uploading - case 2: upload to /deployment and a server group
373-
* @throws Exception if anything goes wrong.
374-
*/
375-
public void testUploadViaCreateChild2() throws Exception {
376-
BaseComponent bc = new BaseComponent();
377-
bc.setPath("server-group=main-server-group");
378-
ResourceType rt = new ResourceType();
379-
rt.setName("Deployment");
380-
Resource resource = new Resource("server-group=main-server-group", TEST_WAR_FILE_NAME, rt);
381-
resource.setUuid(UUID.randomUUID().toString());
382-
StandaloneASComponent parentComponent = new StandaloneASComponent();
383-
parentComponent.setConnection(getDomainControllerASConnection());
384-
ResourceContext context = new ResourceContext(resource, parentComponent, null, null, null, null, null, null,
385-
null, null, null, null, null, null);
386-
bc.start(context);
387-
388-
String bytes_value = uploadToAs(TEST_WAR_PATH);
389-
390-
ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(TEST_WAR_FILE_NAME, "1.0",
391-
"deployment", "all"));
392-
CreateResourceReport report = new CreateResourceReport(TEST_WAR_FILE_NAME, rt, new Configuration(),
393-
new Configuration(), details);
394-
try {
395-
report = bc.runDeploymentMagicOnServer(report, TEST_WAR_FILE_NAME, TEST_WAR_FILE_NAME, bytes_value);
396-
assert report != null;
397-
assert report.getErrorMessage() == null : "Report contained an unexpected error: "
398-
+ report.getErrorMessage();
399-
assert report.getStatus() != null : "Report did not contain a status";
400-
assert report.getStatus() == CreateResourceStatus.SUCCESS : "Status was no success";
401-
assert report.getResourceName().equals(TEST_WAR_FILE_NAME);
402-
assert report.getResourceKey().equals("server-group=main-server-group,deployment=" + TEST_WAR_FILE_NAME) : "Resource key was wrong";
403-
} finally {
404-
Address sgd = new Address("server-group", "main-server-group");
405-
sgd.add("deployment", TEST_WAR_FILE_NAME);
406-
Remove r = new Remove(sgd);
407-
getDomainControllerASConnection().execute(r);
408-
r = new Remove("deployment", TEST_WAR_FILE_NAME);
409-
getDomainControllerASConnection().execute(r);
410-
}
411-
}
412-
413371
}

modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.rhq.core.domain.configuration.Configuration;
5353
import org.rhq.core.domain.configuration.PropertySimple;
5454
import org.rhq.core.domain.content.PackageDetailsKey;
55+
import org.rhq.core.domain.content.transfer.ContentResponseResult;
5556
import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
5657
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
5758
import org.rhq.core.domain.measurement.DataType;
@@ -209,7 +210,7 @@ public void testRedeploy() throws Exception {
209210
Collections.singleton(packageDetails));
210211

211212
DeployPackagesResponse response = pluginContainer.getContentManager().deployPackagesImmediately(request);
212-
213+
assertEquals(response.getOverallRequestResult(), ContentResponseResult.SUCCESS);
213214
testContentRetrieval(TestDeployments.DEPLOYMENT_2);
214215
} finally {
215216
//switch the served deployment back, so that other tests aren't affected

modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TestDeployments.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
enum TestDeployments {
1313
DEPLOYMENT_1("test-simple-1.0.war", "test-simple.war"), //
14-
DEPLOYMENT_2("test-simple-2.war"), //
14+
DEPLOYMENT_2("test-simple-2.0.war"), //
1515
JAVAEE6_TEST_APP("javaee6-test-app.war");
1616

1717
private String deploymentName;

0 commit comments

Comments
 (0)