Search in sources :

Example 16 with JMXBundleDeployer

use of aQute.remote.util.JMXBundleDeployer in project liferay-blade-samples by liferay.

the class BladeLanguageWebTest method create.

@Deployment
public static JavaArchive create() throws Exception {
    final File jarFile = new File(System.getProperty("languageWebJarFile"));
    final File languageJar = new File(System.getProperty("languageJarFile"));
    new JMXBundleDeployer().deploy(_languageJarBSN, languageJar);
    return ShrinkWrap.createFromZipFile(JavaArchive.class, jarFile);
}
Also used : JMXBundleDeployer(aQute.remote.util.JMXBundleDeployer) File(java.io.File) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 17 with JMXBundleDeployer

use of aQute.remote.util.JMXBundleDeployer in project liferay-blade-samples by liferay.

the class BladePortletGreedyPolicyOptionTest method testBladePortletReluctant.

@Test
public void testBladePortletReluctant() throws Exception {
    _webDriver.get(_reluctantPortletURL.toExternalForm());
    Assert.assertTrue("Portlet was not deployed", BladeSampleFunctionalActionUtil.isVisible(_webDriver, _bladeSampleReluctantPortlet));
    Assert.assertTrue("Expected Reluctant Portlet, but saw " + _reluctantPortletTitle.getText(), _reluctantPortletTitle.getText().contentEquals("Reluctant Portlet"));
    Assert.assertTrue("Expected SomeService says I am Default!, but saw " + _reluctantPortletBody.getText(), _reluctantPortletBody.getText().contentEquals("SomeService says I am Default!"));
    final File higherRankedServiceJar = new File(System.getProperty("greedyHigherRankedServiceJarFile"));
    new JMXBundleDeployer().deploy(_higherRankedServiceJarBSN, higherRankedServiceJar);
    _webDriver.navigate().refresh();
    Assert.assertTrue("Expected SomeService says I am Default!, but saw " + _reluctantPortletBody.getText(), BladeSampleFunctionalActionUtil.isTextPresent(_webDriver, _reluctantPortletBody, "SomeService says I am Default!"));
    final File greedyServiceReferenceConfigFile = new File(System.getProperty("greedyServiceReferenceProjectdir"), "configs/com.liferay.blade.reluctant.vs.greedy.portlet.portlet." + "ReluctantPortlet.cfg");
    final File osgiConfigDir = new File(System.getProperty("liferayHome"), "osgi/configs");
    File configFile = new File(osgiConfigDir, "com.liferay.blade.reluctant.vs.greedy.portlet.portlet." + "ReluctantPortlet.cfg");
    IO.copy(greedyServiceReferenceConfigFile, configFile);
    Thread.sleep(10000);
    _webDriver.navigate().refresh();
    Assert.assertTrue("Expected SomeService says I am better, use me!, but saw " + _reluctantPortletBody.getText(), BladeSampleFunctionalActionUtil.isTextPresent(_webDriver, _reluctantPortletBody, "SomeService says I am better, use me!"));
}
Also used : JMXBundleDeployer(aQute.remote.util.JMXBundleDeployer) File(java.io.File) Test(org.junit.Test)

Aggregations

JMXBundleDeployer (aQute.remote.util.JMXBundleDeployer)17 File (java.io.File)12 Deployment (org.jboss.arquillian.container.test.api.Deployment)8 AfterClass (org.junit.AfterClass)4 Test (org.junit.Test)3 Jar (aQute.bnd.osgi.Jar)1 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 FileWriter (java.io.FileWriter)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 BundleDTO (org.osgi.framework.dto.BundleDTO)1