Examples of PackageType


Examples of org.rhq.core.domain.content.PackageType

        //public method will be tested, while the rest will be mocked.
        ApplicationComponent objectUnderTest = mock(ApplicationComponent.class);

        //tell the method story as it happens: mock or create dependencies and configure
        //those dependencies to get the method under test to completion.
        PackageType mockPackageType = mock(PackageType.class);

        @SuppressWarnings("unchecked")
        ResourceContext<JBossASServerComponent<?>> mockResourceContext = mock(ResourceContext.class);
        when(objectUnderTest.getResourceContext()).thenReturn(mockResourceContext);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

*/
@Test
public class SerializableTest {
    public void testSerialization() {
        List<Serializable> objects = new ArrayList<Serializable>();
        Serializable[] simpleObjects = new Serializable[] { new AvailabilityReport("fakeAgent"), new PackageType(),
            new Architecture(), new Repo(), new ContentServiceRequest(), new ContentSource(), new ContentSourceType(),
            new InstalledPackage(), new Package(), new PackageInstallationStep(), new PackageType(),
            new PackageVersion() };
        objects.addAll(Arrays.asList(simpleObjects));

        ResourceType resourceType = new ResourceType("name", "plugin", ResourceCategory.PLATFORM, null);
        Resource resource = new Resource("key", "name", resourceType);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        ServerDescriptor server0 = servers.get(0);
        List<ContentDescriptor> contentDescriptors = server0.getContent();

        assert contentDescriptors != null : "No content descriptors in server: " + server0.getName();

        PackageType packageType;

        packageType = ContentMetadataParser.parseContentDescriptor(contentDescriptors.get(0));

        assert packageType != null : "Null type received from parser";
        assert packageType.getName().equals("artifact1") : "Name not read correctly";
        assert packageType.getDisplayName().equals("Artifact One") : "Display name not read correctly ["
            + packageType.getDisplayName() + "]";
        assert packageType.getCategory() == PackageCategory.CONFIGURATION : "Category not read correctly";
        assert packageType.getDescription().equals("Artifact Description") : "Description not read correctly";

        packageType = ContentMetadataParser.parseContentDescriptor(contentDescriptors.get(1));

        assert packageType != null : "Null type recevied from parser";
        assert packageType.getName().equals("artifact2") : "Name not read correctly";
        assert packageType.getDescription() == null : "Description was not null";
        assert packageType.getDiscoveryInterval() == 5000 : "Discovery interval read incorrectly";
    }
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        //those dependencies to get the method under test to completion.
        File mockFile = mock(File.class);
        when(mockFile.exists()).thenReturn(true);
        when(mockFile.getName()).thenReturn("testFileName");

        PackageType mockPackageType = mock(PackageType.class);

        FileContentDelegate mockFileContentDelegate = mock(FileContentDelegate.class);
        PowerMockito.whenNew(FileContentDelegate.class).withArguments(any(File.class), isNull())
            .thenReturn(mockFileContentDelegate);
        when(mockFileContentDelegate.saveDeploymentSHA(any(File.class), any(File.class), any(File.class))).thenReturn(
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        Configuration mockConfiguration = mock(Configuration.class);
        when(mockResourceContext.getPluginConfiguration()).thenReturn(mockConfiguration);
        when(mockConfiguration.getSimpleValue(eq("filename"), isNull(String.class))).thenReturn(
            fileUsedInTest.getAbsolutePath());

        PackageType mockPackageType = mock(PackageType.class);

        when(objectUnderTest.discoverDeployedPackages(any(PackageType.class))).thenCallRealMethod();

        //run code under test
        Set<ResourcePackageDetails> actualResult = objectUnderTest.discoverDeployedPackages(mockPackageType);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

            Configuration mockConfiguration = mock(Configuration.class);
            when(mockResourceContext.getPluginConfiguration()).thenReturn(mockConfiguration);
            when(mockConfiguration.getSimpleValue(eq("filename"), isNull(String.class))).thenReturn(
                deploymentFolderUsedInTest.getAbsolutePath());

            PackageType mockPackageType = mock(PackageType.class);

            when(objectUnderTest.discoverDeployedPackages(any(PackageType.class))).thenCallRealMethod();

            //run code under test
            Set<ResourcePackageDetails> actualResult = objectUnderTest.discoverDeployedPackages(mockPackageType);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        Configuration mockConfiguration = mock(Configuration.class);
        when(mockResourceContext.getPluginConfiguration()).thenReturn(mockConfiguration);
        when(mockConfiguration.getSimpleValue(eq("filename"), isNull(String.class))).thenReturn(
            fileUsedInTest.getAbsolutePath());

        PackageType mockPackageType = mock(PackageType.class);

        when(objectUnderTest.discoverDeployedPackages(any(PackageType.class))).thenCallRealMethod();

        //run code under test
        Set<ResourcePackageDetails> actualResult = objectUnderTest.discoverDeployedPackages(mockPackageType);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        when(objectUnderTest.getResourceContext()).thenReturn(mockResourceContext);
        Configuration mockConfiguration = mock(Configuration.class);
        when(mockResourceContext.getPluginConfiguration()).thenReturn(mockConfiguration);
        when(mockConfiguration.getSimpleValue(eq("filename"), isNull(String.class))).thenReturn(null);

        PackageType mockPackageType = mock(PackageType.class);

        when(objectUnderTest.discoverDeployedPackages(any(PackageType.class))).thenCallRealMethod();

        //run code under test
        Set<ResourcePackageDetails> actualResult = objectUnderTest.discoverDeployedPackages(mockPackageType);
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

        // we installed version 2.5 then upgraded to 3.0
        // now we want to revert back to 2.5
        ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType);
        Repo repo = new Repo("test-bundle-two");
        PackageType packageType = new PackageType("test-bundle-two", resourceType);
        Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "2.5", bundle,
            getRecipeFromFile("test-bundle-two.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup(
            "testSimpleBundle2Group"), DEST_BASE_DIR_NAME, this.destDir.getAbsolutePath());
View Full Code Here

Examples of org.rhq.core.domain.content.PackageType

     */
    private void doAntBundleInitialInstall(boolean startClean) throws Exception {
        ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null);
        BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType);
        Repo repo = new Repo("test-bundle-two");
        PackageType packageType = new PackageType("test-bundle-two", resourceType);
        Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType);
        BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "2.5", bundle,
            getRecipeFromFile("test-bundle-two.xml"));
        BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup(
            "testSimpleBundle2Group"), DEST_BASE_DIR_NAME, this.destDir.getAbsolutePath());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.