Examples of DescriptorImpl


Examples of org.glassfish.hk2.utilities.DescriptorImpl

               
                BufferedReader reader = new BufferedReader(new InputStreamReader(urlStream));
               
                boolean goOn = true;
                while (goOn) {
                    DescriptorImpl bindMe = new DescriptorImpl();
               
                    goOn = bindMe.readObject(reader);
                    if (goOn == true) {
                        config.bind(bindMe);
                    }
                }
               
View Full Code Here

Examples of org.glassfish.hk2.utilities.DescriptorImpl

     */
    @Override
    public void visitEnd() {
        if (!isAService) return;
       
        DescriptorImpl di = new DescriptorImpl();
        di.setImplementation(implName);
        if (scopeClass == null) {
            // The default for classes with Service is Singelton
            di.setScope(Singleton.class.getName());
        }
        else {
            di.setScope(scopeClass.getName());
        }
       
        di.addAdvertisedContract(implName);
        for (String iFace : iFaces) {
            di.addAdvertisedContract(iFace);
        }
       
        for (String qualifier : qualifiers) {
            di.addQualifier(qualifier);
        }
       
        if (name != null) {
            di.setName(name);
        }
       
        if (verbose) {
            System.out.println("Binding service " + di);
        }
View Full Code Here

Examples of org.glassfish.hk2.utilities.DescriptorImpl

     */
    @Override
    public void visitEnd() {
        if (!isAService) return;
       
        DescriptorImpl di = new DescriptorImpl();
        di.setImplementation(implName);
        if (scopeClass == null) {
            // The default for classes with Service is Singelton
            di.setScope(Singleton.class.getName());
        }
        else {
            di.setScope(scopeClass.getName());
        }
       
        di.addAdvertisedContract(implName);
        for (String iFace : iFaces) {
            di.addAdvertisedContract(iFace);
        }
       
        for (String qualifier : qualifiers) {
            di.addQualifier(qualifier);
        }
       
        if (name != null) {
            di.setName(name);
        }
       
        if (verbose) {
            System.out.println("Binding service " + di);
        }
View Full Code Here

Examples of org.glassfish.hk2.utilities.DescriptorImpl

   
    private static DescriptorImpl createDescriptor(
            String typeName,
            HK2Loader cl,
            Map<String, List<String>> metadata) {
        DescriptorImpl retVal = new DescriptorImpl();
       
        retVal.setImplementation(typeName);
        retVal.addAdvertisedContract(typeName);
        retVal.setLoader(cl);
        retVal.setMetadata(metadata);
       
        return retVal;
    }
View Full Code Here

Examples of org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl

    pulls.put(pullId, pullRequest);
    Map<String, ConcurrentMap<Integer, GhprbPullRequest>> jobs = new HashMap<String, ConcurrentMap<Integer, GhprbPullRequest>>(1);
    jobs.put("project", pulls);

    GithubProjectProperty projectProperty = new GithubProjectProperty("https://github.com/jenkinsci/ghprb-plugin");
    DescriptorImpl descriptor = trigger.getDescriptor();
   
    PrintStream logger = mock(PrintStream.class);

       
    given(project.getTrigger(GhprbTrigger.class)).willReturn(trigger);
    given(project.getName()).willReturn("project");
    given(project.getProperty(GithubProjectProperty.class)).willReturn(projectProperty);
   
    given(build.getCause(GhprbCause.class)).willReturn(cause);
    given(build.getResult()).willReturn(Result.SUCCESS);
    given(build.getParent()).willCallRealMethod();
   
    given(pullRequest.getPullRequest()).willReturn(pr);
   
       
        given(cause.getPullID()).willReturn(pullId);
        given(cause.isMerged()).willReturn(true);
        given(cause.getTriggerSender()).willReturn(triggerSender);
        given(cause.getCommitAuthor()).willReturn(committer);
       
       
        given(listener.getLogger()).willReturn(logger);
       
       
        doNothing().when(repo).addComment(anyInt(), anyString());
        doNothing().when(logger).println();
   

    Field parentField = Run.class.getDeclaredField("project");
    parentField.setAccessible(true);
    parentField.set(build, project);
   
   
   
    Field jobsField = descriptor.getClass().getDeclaredField("jobs");
    jobsField.setAccessible(true);
    jobsField.set(descriptor, jobs);
   

        helper = spy(new Ghprb(project, trigger, pulls));
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.