Package hudson.model

Examples of hudson.model.Node


     * @throws Exception if so.
     */
    @Test()
    public void testGetContainerOnNode() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        Node node = mock(Node.class);
        when(hudson.getNode("theNode")).thenReturn(node);
        DescribableList describableList = mock(DescribableList.class);
        when(node.getNodeProperties()).thenReturn(describableList);
        MetadataNodeProperty property = mock(MetadataNodeProperty.class);
        when(describableList.get(MetadataNodeProperty.class)).thenReturn(property);
        MetadataParent container = CliUtils.getContainer("theNode", null, null, false);
        assertNotNull(container);
        assertSame(property, container);
View Full Code Here


     * @throws Exception if so.
     */
    @Test(expected = CliUtils.NoMetadataException.class)
    public void testGetContainerNoPropertiesOnNode() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        Node node = mock(Node.class);
        when(hudson.getNode("theNode")).thenReturn(node);
        when(node.getNodeProperties()).thenReturn(null);
        CliUtils.getContainer("theNode", null, null, false);
    }
View Full Code Here

     * @throws Exception if so.
     */
    @Test(expected = CliUtils.NoMetadataException.class)
    public void testGetContainerNoPropertiesOnNodeCreate() throws Exception {
        Hudson hudson = MockUtils.mockHudson();
        Node node = mock(Node.class);
        when(hudson.getNode("theNode")).thenReturn(node);
        when(node.getNodeProperties()).thenReturn(null);
        CliUtils.getContainer("theNode", null, null, true);
    }
View Full Code Here

        String androidHome = Utils.expandVariables(build, listener,
                Utils.getConfiguredAndroidHome());
        EnvVars envVars = Utils.getEnvironment(build, listener);

        // Retrieve actual SDK root based on given value
        Node node = Computer.currentComputer().getNode();
        String discoveredAndroidHome = Utils.discoverAndroidHome(launcher, node, envVars,
                androidHome);

        // Get Android SDK object from the given root (or locate on PATH)
        final String androidSdkHome = (envVars != null && keepInWorkspace ? envVars
View Full Code Here

        // Emulator properties
        String commandLineOptions = Utils.expandVariables(envVars, buildVars, this.commandLineOptions);

        // SDK location
        Node node = Computer.currentComputer().getNode();
        String androidHome = Utils.expandVariables(envVars, buildVars, descriptor.androidHome);
        androidHome = Utils.discoverAndroidHome(launcher, node, envVars, androidHome);

        // Despite the nice inline checks and warnings when the user is editing the config,
        // these are not binding, so the user may have saved invalid configuration.
View Full Code Here

    }

    private static AndroidSdk doInstall(Launcher launcher, BuildListener listener, String androidSdkHome)
            throws SdkInstallationException, IOException, InterruptedException {
        // We should install the SDK on the current build machine
        Node node = Computer.currentComputer().getNode();

        // Install the SDK if required
        String androidHome;
        try {
            androidHome = installBasicSdk(listener, node).getRemote();
View Full Code Here

     * @return The semaphore for the current machine, which must be released once finished with.
     */
    private static Semaphore acquireLock() throws InterruptedException {
        // Retrieve the lock for this node
        Semaphore semaphore;
        final Node node = Computer.currentComputer().getNode();
        synchronized (node) {
            semaphore = mutexByNode.get(node);
            if (semaphore == null) {
                semaphore = new Semaphore(1);
                mutexByNode.put(node, semaphore);
View Full Code Here

    }

    protected void cancelBuild(String builderName, String label) {
        LOGGER.info("Cancelling build");
        try {
            Node existingNode = Hudson.getInstance().getNode(builderName);
            if (existingNode != null && existingNode instanceof OpenShiftSlave) {
                ((OpenShiftSlave) existingNode).terminate();
            }

            Queue.Item item = getItem(builderName, label);
View Full Code Here

        for (IApplication appInfo : this.getOpenShiftConnection().getUser()
                .getDomain(getNamespace()).getApplications()) {
            String appName = appInfo.getName();
            if (appName.endsWith(APP_NAME_BUILDER_EXTENSION) && !appName.equals(APP_NAME_BUILDER_EXTENSION)) {
                Node node = Hudson.getInstance().getNode(appName);
                OpenShiftSlave slave = null;
                if (node == null || !(node instanceof OpenShiftSlave)) {
                    LOGGER.info("Didn't find existing slave for: " + appName);
                    try {
                        String framework = appInfo.getCartridge().getName();
View Full Code Here

     * {@link IvyModule} uses the workspace of the {@link IvyModuleSet}, so it
     * always needs to be built on the same slave as the parent.
     */
    @Override
    public Label getAssignedLabel() {
        Node n = getParent().getLastBuiltOn();
        if (n == null)
            return null;
        return n.getSelfLabel();
    }
View Full Code Here

TOP

Related Classes of hudson.model.Node

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.