Package org.netmelody.cieye.core.domain

Examples of org.netmelody.cieye.core.domain.TargetDigestGroup


           
            never(contact).makeJsonRestCall(with(any(String.class)), with(JobDetail.class));
        }});
       
        final Feature feature = new Feature("myFeatureName", "myEndpoint", new CiServerType("JENKINS"));
        final TargetDigestGroup targets = spy.targetsConstituting(feature);
        context.assertIsSatisfied();
       
        context.checking(new Expectations() {{
            oneOf(contact).makeJsonRestCall(with(any(String.class)), with(JobDetail.class));
                will(returnValue(new JobDetail()));
        }});
        spy.statusOf(targets.iterator().next().id());
        context.assertIsSatisfied();
    }
View Full Code Here


            TargetDigest digest = new TargetDigest(featureName+targetName, "http://www.example.com/", targetName, UNKNOWN);
            digests.add(digest);
            recognisedTargets.put(digest.id(), new TargetInfo(featureName, targetName));
        }
       
        return new TargetDigestGroup(digests);
    }
View Full Code Here

        this.untrustedSpy = untrustedSpy;
    }

    @Override
    public TargetDigestGroup targetsConstituting(Feature feature) {
        final TargetDigestGroup untrustedResult = untrustedSpy.targetsConstituting(feature);
        final TargetDigestGroup result = (untrustedResult == null) ? new TargetDigestGroup() : untrustedResult;
       
        if (result.isEmpty()) {
            final TargetId noTargetId = new TargetId("UNK_" + feature.endpoint() + feature.name());
            TargetDigest noTarget = emptyFeatureTargets.get(noTargetId);
            if (null == noTarget) {
                noTarget = new TargetDigest(noTargetId.id(), feature.endpoint(), "EMPTY: " + feature.name(), Status.BROKEN);
                emptyFeatureTargets.put(noTargetId, noTarget);
            }
            return new TargetDigestGroup(ImmutableList.of(noTarget));
        }
        return result;
    }
View Full Code Here

            final TargetDigest targetDigest = new TargetDigest(job.url, job.url, job.name, job.status());
            digests.add(targetDigest);
            recognisedJobs.put(targetDigest.id(), job);
        }
       
        return new TargetDigestGroup(digests);
    }
View Full Code Here

    private void update() {
        final long cutoffTime = currentTimeMillis() - TimeUnit.MINUTES.toMillis(CUTOFF_PERIOD_MINUTES);
        final Iterable<Feature> features = transform(filter(requests.entrySet(), requestedAfter(cutoffTime)), toFeature());
       
        for (Feature feature : features) {
            final TargetDigestGroup targets = trustedSpy.targetsConstituting(feature);
           
            StatusResult intermediateStatus = statuses.get(feature);
            if (null == intermediateStatus) {
                intermediateStatus = new StatusResult(new TargetDetailGroup(targets));
                statuses.putIfAbsent(feature, intermediateStatus);
View Full Code Here

            allowing(contact).privileged(); will(returnValue(false));
        }});
       
        final TeamCitySpy spy = new TeamCitySpy("myEndpoint", detective, contact);
       
        final TargetDigestGroup result = spy.targetsConstituting(new Feature("", "myOtherEndpoint", new CiServerType("TEAMCITY")));
       
        assertThat(result, is(Matchers.<TargetDigest>emptyIterable()));
    }
View Full Code Here

                will(returnValue(projectNamed("myTarget")));
           
            never(contact).makeJsonRestCall(with(any(String.class)), with(BuildTypeDetail.class));
        }});
       
        final TargetDigestGroup digest = spy.targetsConstituting(new Feature("myFeatureName", "myEndpoint", new CiServerType("TEAMCITY")));
        context.assertIsSatisfied();
       
        context.checking(new Expectations() {{
            oneOf(contact).makeJsonRestCall(with(any(String.class)), with(BuildTypeDetail.class));
                will(returnValue(buildTypeDetail()));
            allowing(contact).makeJsonRestCall(with(any(String.class)), with(Builds.class));
                will(returnValue(new Builds()));
        }});
       
        spy.statusOf(digest.iterator().next().id());
        context.assertIsSatisfied();
    }
View Full Code Here

            final TargetDigest targetDigest = new TargetDigest(communicator.endpoint() + buildType.href, buildType.webUrl(), buildType.name, UNKNOWN);
            digests.add(targetDigest);
            recognisedBuildTypes.put(targetDigest.id(), buildType);
        }
       
        return new TargetDigestGroup(digests);
    }
View Full Code Here

    canPullFromTheJenkinsLiveInstance() {
        final GsonBuilder builder = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        final Contact realContact = new JsonRestRequester(builder.create());
        final JenkinsSpy witness = new JenkinsSpy("http://ci.jenkins-ci.org", new RecordedKnownOffenders(new SettingsFile(new File(""))), realContact);
       
        final TargetDigestGroup digests = witness.targetsConstituting(new Feature("Jenkins core", "http://ci.jenkins-ci.org", new CiServerType("JENKINS")));
       
        assertThat(witness.statusOf(digests.iterator().next().id()), is(notNullValue(TargetDetail.class)));
    }
View Full Code Here

    canPullFromSecureJenkinsLiveInstance() {
        final GsonBuilder builder = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        final Contact realContact = new JsonRestRequester(builder.create());
        final JenkinsSpy witness = new JenkinsSpy("https://jenkins.puppetlabs.com", new RecordedKnownOffenders(new SettingsFile(new File(""))), realContact);
       
        final TargetDigestGroup digests = witness.targetsConstituting(new Feature("MCO Core", "https://jenkins.puppetlabs.com", new CiServerType("JENKINS")));
       
        assertThat(witness.statusOf(digests.iterator().next().id()), is(notNullValue(TargetDetail.class)));
    }
View Full Code Here

TOP

Related Classes of org.netmelody.cieye.core.domain.TargetDigestGroup

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.