Package com.atlassian.plugin.test

Examples of com.atlassian.plugin.test.PluginJarBuilder


                .build();
    }

    public static PluginJarBuilder startSimpleBuilder(String key, String name)
    {
        return new PluginJarBuilder(key + "-1")
                .addFormattedResource("atlassian-plugin.xml",
                         "<atlassian-plugin key='" + key + "' pluginsVersion='2' name='" + name + "'>",
                         "    <plugin-info>",
                         "        <version>1</version>",
                         "        <description>Desc</description>",
View Full Code Here


                .addResource("modules/", "");
    }

    public static File buildSimpleExtensionFile(String key) throws IOException, URISyntaxException
    {
        File jar = new PluginJarBuilder(key + "-1")
                .addFormattedResource("atlassian-extension.json",
                        "{'name'         : '" + key + "',",
                        " 'version'      : '1'",
                        "}")
                .addResource("js/", "")
View Full Code Here

    }

    @Test
    public void testCannotInstallOtherUsersPlugin() throws IOException
    {
        File jar = new PluginJarBuilder()
                .addFormattedResource("atlassian-plugin.xml",
                        "<atlassian-plugin key='plugin-tests' pluginsVersion='2' name='Plugin Tests'>",
                        "    <plugin-info>",
                        "        <version>2</version>",
                        "    </plugin-info>",
View Full Code Here

    }

    @Test
    public void testInstallPluginMissingModules() throws IOException
    {
        File jar = new PluginJarBuilder("Missing-Module")
                .addFormattedResource("atlassian-plugin.xml",
                        "<atlassian-plugin key='unresolved-test' pluginsVersion='2' name='Missing Module Test'>",
                        "    <plugin-info>",
                        "        <version>2</version>",
                        "    </plugin-info>",
View Full Code Here

        logout();
        assertTrue(product.visit(LoginPage.class)
               .login("barney", "barney", SpeakeasyUserPage.class)
                    .canEnable("plugin-tests"));

        File jar = new PluginJarBuilder("ConventionZip")
                .addFormattedResource("atlassian-extension.json",
                        "{'key'         : 'test-permission',",
                        " 'name'         : 'Test Permission',",
                        " 'version'      : '1',",
                        " 'permissions'  : ['ADMINS_ENABLE']",
View Full Code Here

    private void assertTransform(String id, List<String> source, Map<String,String> expectedHeaders) throws IOException, SAXException
    {
        String prefix = "/" + getClass().getPackage().getName().replace('.', '/') + "/" + id + "/";

        PluginJarBuilder builder = new PluginJarBuilder();
        Set<String> allDirs = newHashSet();
        for (String path : source)
        {
            builder.addFormattedResource(path, getResource(prefix + path));
            String[] dirs = path.split("/");
            StringBuilder pwd = new StringBuilder();
            for (int x=0; x<dirs.length - 1; x++)
            {
                pwd.append(dirs[x]).append("/");
                if (allDirs.add(pwd.toString()))
                {
                    builder.addResource(pwd.toString(), "");
                }
            }
        }
        File jar = builder.buildWithNoManifest();
        File zip = new File(jar.getPath() + ".zip");
        FileUtils.moveFile(jar, zip);

        final JarPluginArtifact jarArtifact = new JarPluginArtifact(zip);
        JsonManifest jsonMf = new JsonManifestHandler().read(jarArtifact);
View Full Code Here

TOP

Related Classes of com.atlassian.plugin.test.PluginJarBuilder

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.