Commit 47f300fb authored by Munilla Christophe's avatar Munilla Christophe
Browse files

- add frascati-jmx bundle plus tests

- add frascati-native bundle plus tests
parent de54ae4d
<?xml version="1.0"?>
<!--
* OW2 FraSCAti OSGi
*
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>frascati-jmx-test-equinox</artifactId>
<name>FraSCAti in OSGi - Test JMX Bundle in Eclipse Equinox</name>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test-framework</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.osgi.fio</groupId>
<artifactId>frascati-osgi-equinox</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude> **/*.jar</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* OW2 FraSCAti OSGi
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
*/
package org.ow2.frascati.osgi.test;
/**
* Test in Eclipse Equinox
*/
public class FraSCAtiInEquinoxTest extends FraSCAtiInOSGiJMXTest
{
}
\ No newline at end of file
<?xml version="1.0"?>
<!--
* OW2 FraSCAti OSGi
*
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>frascati-jmx-test-felix</artifactId>
<name>FraSCAti in OSGi - Test JMX Bundle in Apache Felix</name>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test-framework</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.osgi.fio</groupId>
<artifactId>frascati-osgi-felix</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude> **/*.jar</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* OW2 FraSCAti OSGi
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
*/
package org.ow2.frascati.osgi.test;
/**
* Test in Apache Felix
*/
public class FraSCAtiInFelixTest extends FraSCAtiInOSGiJMXTest
{
}
\ No newline at end of file
<?xml version="1.0"?>
<!--
* OW2 FraSCAti OSGi
*
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>frascati-jmx-test-framework</artifactId>
<name>FraSCAti in OSGi - Test JMX Bundle in OSGi</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-bundles</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/classes</outputDirectory>
<stripVersion>true</stripVersion>
<failBuild>false</failBuild>
<failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
<failOnWarning>false</failOnWarning>
<overWriteIfNewer>true</overWriteIfNewer>
<artifactItems>
<artifactItem>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.bundle</artifactId>
<version>2.2.0</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>2.2.0</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.webconsole</artifactId>
<version>3.1.8</version>
</artifactItem>
<artifactItem>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.enterprise</artifactId>
<version>4.2.0</version>
</artifactItem>
<artifactItem>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>4.2.0</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/**
* OW2 FraSCAti OSGi
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
*/
package org.ow2.frascati.osgi.test;
import static org.junit.Assert.assertNotNull;
import java.lang.management.ManagementFactory;
import java.util.Set;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.Test;
import org.ow2.frascati.osgi.test.FraSCAtiInOSGiTest;
/**
* FraSCAti in OSGi JMX Bundle TestCase
*/
public abstract class FraSCAtiInOSGiJMXTest extends FraSCAtiInOSGiTest
{
public static final String PACKAGE = "org.ow2.frascati.jmx";
public static final String DOMAIN = "SCA domain";
public static final String STARTED = "STARTED";
public static final String STOPPED = "STOPPED";
@Test
public void testJMX() throws Exception
{
System.out.println("... do testJMX");
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.invoke(new ObjectName(PACKAGE + ":name=FrascatiJmx"),
"load", null, null);
// check there a some exposed components
Set<ObjectName> components = mbs.queryNames(new ObjectName(DOMAIN + ":*"), null);
Assert.assertFalse(components.isEmpty());
// check state of a component
ObjectName tested = new ObjectName(DOMAIN + ":name0=org.ow2.frascati.FraSCAti,name1=jmx");
Assert.assertEquals(STARTED, mbs.getAttribute(tested, "state"));
mbs.invoke(tested, "stop", null, null);
Assert.assertEquals(STOPPED, mbs.getAttribute(tested, "state"));
mbs.invoke(tested, "start", null, null);
Assert.assertEquals(STARTED, mbs.getAttribute(tested, "state"));
System.out.println("... testJMX done");
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="w">bundle-frascati-api.jar:true</entry>
<entry key="v">bundle-frascati-explorer.jar:false</entry>
<entry key="u">bundle-frascati-eclipse.jar:true</entry>
<entry key="t">bundle-frascati-binding-http.jar:false</entry>
<entry key="s">bundle-frascati-binding-rmi.jar:false</entry>
<entry key="r">bundle-frascati-binding-jsonrpc.jar:false</entry>
<entry key="q">bundle-frascati-binding-ws.jar:false</entry>
<entry key="p">bundle-frascati-binding-rest.jar:false</entry>
<entry key="o">bundle-frascati-binding-jms.jar:false</entry>
<entry key="n">bundle-frascati-web-explorer.jar:false</entry>
<entry key="m">bundle-frascati-introspection.jar:false</entry>
<entry key="l">bundle-frascati-introspection-fscript.jar:false</entry>
<entry key="k">bundle-frascati-fscript.jar:false</entry>
<entry key="j">bundle-frascati-native.jar:false</entry>
<entry key="i">bundle-frascati-jmx.jar:true</entry>
<entry key="h">bundle-frascati-implementation-bpel.jar:false</entry>
<entry key="g">bundle-frascati-implementation-scripts.jar:false</entry>
<entry key="f">bundle-frascati-implementation-xquery.jar:false</entry>
<entry key="e">bundle-frascati-implementation-spring.jar:false</entry>
<entry key="d">bundle-frascati-implementation-velocity.jar:false</entry>
<entry key="c">bundle-frascati-cxf-libs.jar:true</entry>
<entry key="b">bundle-frascati-resources.jar:true</entry>
<entry key="a">bundle-frascati-core.jar:true</entry>
</properties>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti OSGi
*
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>frascati-jmx-test-jboss</artifactId>
<name>FraSCAti in OSGi - Test JMX Bundle in JBoss OSGi</name>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.osgi.fio.test</groupId>
<artifactId>frascati-jmx-test-framework</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.osgi.fio</groupId>
<artifactId>frascati-osgi-jboss</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude> **/*.jar</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* OW2 FraSCAti OSGi
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
*/
package org.ow2.frascati.osgi.test;
/**
* Test in JBoss OSGi
*/
public class FraSCAtiInJBossTest extends FraSCAtiInOSGiJMXTest
{
}
\ No newline at end of file