use of org.motechproject.admin.bundles.BundleInformation in project motech by motech.
the class BundleAdminServiceTest method testStopBundle.
@Test
public void testStopBundle() throws BundleException {
setupBundleRetrieval();
BundleInformation bundleInfo = moduleAdminService.stopBundle(BUNDLE_ID);
assertEquals(new BundleInformation(bundle), bundleInfo);
verify(bundleContext).getBundle(BUNDLE_ID);
verify(bundle).stop();
}
use of org.motechproject.admin.bundles.BundleInformation in project motech by motech.
the class BundleAdminServiceTest method testRestartBundle.
@Test
public void testRestartBundle() throws BundleException {
setupBundleRetrieval();
BundleInformation bundleInfo = moduleAdminService.restartBundle(BUNDLE_ID);
assertEquals(new BundleInformation(bundle), bundleInfo);
verify(bundleContext).getBundle(BUNDLE_ID);
verify(bundle).stop();
verify(bundle).start();
}
use of org.motechproject.admin.bundles.BundleInformation in project motech by motech.
the class BundleAdminControllerTest method testStartBundle.
@Test
public void testStartBundle() throws BundleException {
when(moduleAdminService.startBundle(BUNDLE_ID)).thenReturn(bundleInformation);
BundleInformation result = controller.startBundle(BUNDLE_ID);
assertEquals(bundleInformation, result);
verify(moduleAdminService).startBundle(BUNDLE_ID);
}
use of org.motechproject.admin.bundles.BundleInformation in project motech by motech.
the class BundleAdminControllerTest method testStopBundle.
@Test
public void testStopBundle() throws BundleException {
when(moduleAdminService.stopBundle(BUNDLE_ID)).thenReturn(bundleInformation);
BundleInformation result = controller.stopBundle(BUNDLE_ID);
assertEquals(bundleInformation, result);
verify(moduleAdminService).stopBundle(BUNDLE_ID);
}
use of org.motechproject.admin.bundles.BundleInformation in project motech by motech.
the class BundleAdminControllerTest method testUploadBundle.
@Test
public void testUploadBundle() throws BundleException {
when(moduleAdminService.installBundle(bundleFile, true)).thenReturn(bundleInformation);
when(moduleAdminService.installBundle(bundleFile, false)).thenReturn(bundleInformation);
BundleInformation result = controller.uploadBundle("File", null, bundleFile, "on");
assertEquals(bundleInformation, result);
verify(moduleAdminService).installBundle(bundleFile, true);
result = controller.uploadBundle("File", null, bundleFile, null);
assertEquals(bundleInformation, result);
verify(moduleAdminService).installBundle(bundleFile, false);
}
Aggregations