Package net.xeoh.plugins.testplugins.testannotations

Examples of net.xeoh.plugins.testplugins.testannotations.TestAnnotations


    /**
     *
     */
    @Test
    public void testAllInterfaces() {
        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class);

        Collection<Class<? extends Plugin>> allPluginClasses = getAllPluginClasses(plugin);
        for (Class<? extends Plugin> class1 : allPluginClasses) {
            System.out.println(class1.getCanonicalName());
        }
View Full Code Here


    //@Test
    public void testGetPluginClassOfPPluginSelectorOfP() {

        Assert.assertNotNull(this.pm);

        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class, new OptionPluginSelector<TestAnnotations>(new PluginSelector<TestAnnotations>() {

            public boolean selectPlugin(final TestAnnotations plugiN) {
                return false;
            }
View Full Code Here

        props.setProperty(PluginManager.class, "cache.file", "jspf.cache");

        PluginManager pm = PluginManagerFactory.createPluginManager(props);
        pm.addPluginsFrom(new URI("classpath://*"));

        TestAnnotations plugin = pm.getPlugin(TestAnnotations.class);
        RemoteAPI remote = pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {

            public boolean selectPlugin(final RemoteAPI p) {
                if (p.getPublishMethod().equals(PublishMethod.JSON)) return true;
                return false;
View Full Code Here

    /**
     * @throws URISyntaxException   */
    @Test
    public void testDiscovery() throws URISyntaxException {
        RemoteAPILipe p = this.pm.getPlugin(RemoteAPILipe.class);
        TestAnnotations p2 = this.pm.getPlugin(TestAnnotations.class);

        System.out.println("GO");
        ExportResult exportPlugin = p.exportPlugin(p2);
        System.out.println("1");
        Assert.assertNotNull(exportPlugin);
        System.out.println("2");
        Plugin rp = p.getRemoteProxy(new URI("discover://nearest"), TestAnnotations.class);
        System.out.println(rp);
        Plugin remoteProxy = p.getRemoteProxy(new URI("discover://any"), Plugin.class);

        Assert.assertNotNull(remoteProxy);
        TestAnnotations remoteProxy2 = p.getRemoteProxy(new URI("discover://nearest"), TestAnnotations.class);
        Assert.assertNotNull(remoteProxy2);
        String injectionStatus = remoteProxy2.getInjectionStatus();
        Assert.assertEquals(injectionStatus, "INJECTION OK");
        System.out.println("YO");
        Plugin youngest = p.getRemoteProxy(new URI("discover://youngest"), Plugin.class);
        Assert.assertNotNull(youngest);
        Plugin oldest = p.getRemoteProxy(new URI("discover://oldest"), Plugin.class);
View Full Code Here

     */
    @Test
    public void testERMI() {
        Assert.assertNotNull(this.pm);

        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class);
        final RemoteAPI remote = this.pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {

            public boolean selectPlugin(final RemoteAPI p) {
                if (p.getPublishMethod().equals(PublishMethod.LIPE)) return true;
                return false;
            }

        }));

        Assert.assertNotNull(plugin);
        Assert.assertNotNull(remote);

        final ExportResult exportPluginURL = remote.exportPlugin(plugin);
        System.out.println(exportPluginURL);

        Assert.assertNotNull(exportPluginURL);

        final TestAnnotations remoteProxy = remote.getRemoteProxy(exportPluginURL.getExportURIs().iterator().next(), TestAnnotations.class);
        // System.out.println(remoteProxy);
        Assert.assertNotNull(remoteProxy);
        Assert.assertEquals(remoteProxy.getInitStatus(), "INIT OK");

    }
View Full Code Here

     */
    @Test
    public void testLIPE() {
        Assert.assertNotNull(this.pm);

        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class);
        final RemoteAPI remote = this.pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {

            public boolean selectPlugin(final RemoteAPI p) {
                if (p.getPublishMethod().equals(PublishMethod.LIPE)) return true;
                return false;
            }

        }));

        Assert.assertNotNull(plugin);
        Assert.assertNotNull(remote);

        final ExportResult exportPluginURL = remote.exportPlugin(plugin);
        System.out.println(exportPluginURL.getExportURIs().iterator().next());

        Assert.assertNotNull(exportPluginURL);

        final TestAnnotations remoteProxy = remote.getRemoteProxy(exportPluginURL.getExportURIs().iterator().next(), TestAnnotations.class);
        // System.out.println(remoteProxy);
        Assert.assertNotNull(remoteProxy);
        Assert.assertEquals(remoteProxy.getInitStatus(), "INIT OK");

    }
View Full Code Here

     */
    @Test
    public void testXMLRPC() {
        Assert.assertNotNull(this.pm);

        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class);

        this.pm.getPlugin(RemoteAPI.class);

        final RemoteAPI remote = this.pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {

            public boolean selectPlugin(final RemoteAPI p) {
                if (p.getPublishMethod().equals(PublishMethod.XMLRPC)) return true;
                return false;
            }

        }));

        Assert.assertNotNull(plugin);
        Assert.assertNotNull(remote);

        final ExportResult exportPluginURL = remote.exportPlugin(plugin);

        Assert.assertNotNull(exportPluginURL);

        final TestAnnotations remoteProxy = remote.getRemoteProxy(exportPluginURL.getExportURIs().iterator().next(), TestAnnotations.class);
        // System.out.println(remoteProxy);
        Assert.assertNotNull(remoteProxy);

        // TODO: Why does this line block sometimes?
        Assert.assertEquals(remoteProxy.getInitStatus(), "INIT OK");

    }
View Full Code Here

     */
    @Test
    public void testXMLRPCDelight() {
        Assert.assertNotNull(this.pm);

        final TestAnnotations plugin = this.pm.getPlugin(TestAnnotations.class);

        this.pm.getPlugin(RemoteAPI.class);

        final RemoteAPI remote = this.pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {

            public boolean selectPlugin(final RemoteAPI p) {
                if (p.getPublishMethod().equals(PublishMethod.XMLRPCDELIGHT))
                    return true;
                return false;
            }

        }));

        Assert.assertNotNull(plugin);
        Assert.assertNotNull(remote);

        final ExportResult exportPluginURL = remote.exportPlugin(plugin);

        Assert.assertNotNull(exportPluginURL);

        final TestAnnotations remoteProxy = remote.getRemoteProxy(exportPluginURL.getExportURIs().iterator().next(), TestAnnotations.class);
        // System.out.println(remoteProxy);
        Assert.assertNotNull(remoteProxy);

        // TODO: Why does this line block sometimes?
        Assert.assertEquals(remoteProxy.getInitStatus(), "INIT OK");

    }
View Full Code Here

    public void testDiscovery() {
        System.out.println(1);
        RemoteAPIXMLRPC p = this.pm.getPlugin(RemoteAPIXMLRPC.class);
        System.out.println(2);

        TestAnnotations p2 = this.pm.getPlugin(TestAnnotations.class);
        System.out.println(p);
        System.out.println(p2);

        p.exportPlugin(p2);
        System.out.println("exported to " + p2);
View Full Code Here

    /**
     * @throws URISyntaxException  
     * @throws InterruptedException */
    @Test
    public void testDiscovery() throws URISyntaxException, InterruptedException {
        TestAnnotations p2 = this.pm.getPlugin(TestAnnotations.class);
        RemoteDiscovery p = this.pm.getPlugin(RemoteDiscovery.class);

        System.out.println(1);
        p.announcePlugin(p2, PublishMethod.ERMI, new URI("ermi://lala:123/Jojo"));
        System.out.println(2);
View Full Code Here

TOP

Related Classes of net.xeoh.plugins.testplugins.testannotations.TestAnnotations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.