Search in sources :

Example 96 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class GoPluginDescriptorModelTest method shouldNotAddHttpToUrlIfSecureProtocolIsAlreadyPresent.

@Test
public void shouldNotAddHttpToUrlIfSecureProtocolIsAlreadyPresent() throws Exception {
    GoPluginDescriptor.Vendor vendor = new GoPluginDescriptor.Vendor(null, "https://ali.com");
    GoPluginDescriptor.About about = new GoPluginDescriptor.About(null, null, "13.3.0", "some description", vendor, Arrays.asList("Linux", "Windows"));
    GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin.jar", "1", about, "some_path", new File("bundle_location"), false);
    GoPluginDescriptor descriptorModel = GoPluginDescriptorModel.convertToDescriptorWithAllValues(descriptor);
    assertThat(descriptorModel.about().vendor().url(), is("https://ali.com"));
}
Also used : GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) File(java.io.File) Test(org.junit.Test)

Example 97 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PluginSettingsMetadataLoaderTest method setUp.

@Before
public void setUp() {
    initMocks(this);
    pluginDescriptor = new GoPluginDescriptor("plugin-id", "1.0", null, null, null, true);
    extensions = Arrays.asList(packageRepositoryExtension, scmExtension, taskExtension, notificationExtension, authenticationExtension, configRepoExtension);
    metadataLoader = new PluginSettingsMetadataLoader(extensions, pluginManager);
    PluginSettingsMetadataStore.getInstance().clear();
}
Also used : GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) Before(org.junit.Before)

Example 98 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class AuthenticationViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : registry.getAuthenticationPlugins()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, AuthenticationExtension.EXTENSION_NAME, null, null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)

Example 99 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PackageViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : PackageMetadataStore.getInstance().pluginIds()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, PackageRepositoryExtension.EXTENSION_NAME, null, null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)

Example 100 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PluggableTaskViewModelBuilder method pluginInfoFor.

public PluginInfo pluginInfoFor(String pluginId) {
    if (!PluggableTaskConfigStore.store().hasPreferenceFor(pluginId)) {
        return null;
    }
    GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
    TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
    List<PluginConfiguration> pluginConfigurations = configurations(taskPreference.getConfig());
    PluginView pluginView = new PluginView(taskPreference.getView().template());
    return new PluginInfo(descriptor, TaskExtension.TASK_EXTENSION, taskPreference.getView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
Also used : PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) PluginView(com.thoughtworks.go.server.ui.plugins.PluginView) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) TaskPreference(com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)

Aggregations

GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)197 Test (org.junit.Test)155 File (java.io.File)17 PluginManager (com.thoughtworks.go.plugin.infra.PluginManager)16 TinyBundle (org.ops4j.pax.tinybundles.core.TinyBundle)15 PluggableInstanceSettings (com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings)14 Before (org.junit.Before)14 AnalyticsPluginInfo (com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo)12 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)12 ElasticAgentPluginInfo (com.thoughtworks.go.plugin.domain.elastic.ElasticAgentPluginInfo)11 PluginView (com.thoughtworks.go.server.ui.plugins.PluginView)11 GoPlugin (com.thoughtworks.go.plugin.api.GoPlugin)10 TaskView (com.thoughtworks.go.plugin.api.task.TaskView)9 PluginInfo (com.thoughtworks.go.server.ui.plugins.PluginInfo)9 InvocationOnMock (org.mockito.invocation.InvocationOnMock)9 Answer (org.mockito.stubbing.Answer)9 TaskPreference (com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)8 TaskConfig (com.thoughtworks.go.plugin.api.task.TaskConfig)8 ArrayList (java.util.ArrayList)8 PluginConfiguration (com.thoughtworks.go.domain.config.PluginConfiguration)7