Examples of Answer


Examples of org.mockito.stubbing.Answer

        this.answers.add(answer);
    }

    public Object answer(InvocationOnMock invocation) throws Throwable {
        //see ThreadsShareGenerouslyStubbedMockTest
        Answer a;
        synchronized(answers) {
            a = answers.size() == 1 ? answers.peek() : answers.poll();
        }
        return a.answer(invocation);
    }
View Full Code Here

Examples of org.mockito.stubbing.Answer

        loader.put(p);
        loader.flushcache();
      }

      HRegion spyR = spy(r);
      doAnswer(new Answer() {
        public Object answer(InvocationOnMock invocation) throws Throwable {
          r.writestate.writesEnabled = false;
          return invocation.callRealMethod();
        }
      }).when(spyR).doRegionCompactionPrep();
View Full Code Here

Examples of org.mockito.stubbing.Answer

    // Path f = new Path(src);

    FSDataOutputStream a_out = new FSDataOutputStream(mockDfs.create(src, true)); // fs.create(f);
    a_out.writeBytes("something");

    doAnswer(new Answer() {
      public Object answer(InvocationOnMock invocation) {
        Object[] args = invocation.getArguments();
        try {
          invocation.callRealMethod();
          return (Void) invocation.callRealMethod();
View Full Code Here

Examples of org.mockito.stubbing.Answer

            LeftTupleSource leftTupleSource = (LeftTupleSource) context.get( leftInput );

            LeftTupleSink mockedSink = Mockito.mock( LeftTupleSink.class,
                                                     Mockito.withSettings().extraInterfaces( DSLMock.class ) );

            Mockito.when( mockedSink.createLeftTuple( (InternalFactHandle) anyObject(), (LeftTupleSink) anyObject(), anyBoolean() ) ).thenAnswer( new Answer() {

                public Object answer(InvocationOnMock invocation) throws Throwable {
                    Object[] args = invocation.getArguments();                  
                    return new LeftTupleImpl((InternalFactHandle)args[0], (LeftTupleSink)args[1], ((Boolean)args[2]).booleanValue()  );
                }
            });
                       
           
            Mockito.when( mockedSink.createLeftTuple( (LeftTuple) anyObject(), (LeftTupleSink) anyObject()(PropagationContext) anyObject(), anyBoolean()) ).thenAnswer( new Answer() {

                public Object answer(InvocationOnMock invocation) throws Throwable {
                    Object[] args = invocation.getArguments();                  
                    return new LeftTupleImpl((LeftTuple)args[0], (LeftTupleSink)args[1], (PropagationContext) args[2] , ((Boolean)args[3]).booleanValue()  );
                }
            });     
           
            Mockito.when( mockedSink.createLeftTuple( (LeftTuple) anyObject(), (RightTuple) anyObject(), (LeftTupleSink) anyObject()) ).thenAnswer( new Answer() {
                public Object answer(InvocationOnMock invocation) throws Throwable {
                    Object[] args = invocation.getArguments();                  
                    return new LeftTupleImpl((LeftTuple)args[0], (RightTuple)args[1], (LeftTupleSink) args[2] );
                }
            });             
           
            Mockito.when( mockedSink.createLeftTuple( (LeftTuple) anyObject(), (RightTuple) anyObject()(LeftTuple) anyObject(), (LeftTuple) anyObject(), (LeftTupleSink) anyObject(), anyBoolean()) ).thenAnswer( new Answer() {
                public Object answer(InvocationOnMock invocation) throws Throwable {
                    Object[] args = invocation.getArguments();                  
                    return new LeftTupleImpl((LeftTuple)args[0], (RightTuple)args[1], (LeftTuple)args[2], (LeftTuple)args[3], (LeftTupleSink)args[4], ((Boolean)args[5]).booleanValue() );
                }
            });            
View Full Code Here

Examples of org.opendope.answers.Answer

  }
 
  private void addPartEntries(String key) {
   
    // answer
    Answer a = new Answer();
    a.setId(key);
    a.setValue("${" + key + "}");
    standardisedAnswersPart.getJaxbElement().getAnswerOrRepeat().add(a);
   
    // XPath
    Xpaths.Xpath xp = new org.opendope.xpaths.ObjectFactory().createXpathsXpath();
    xp.setId(key);
View Full Code Here

Examples of org.osforce.connect.entity.knowledge.Answer

      model.put("photo", photo);
    } else if(StringUtils.equals(Question.NAME, activity.getEntity())) {
      Question question = questionService.getQuestion(activity.getLinkedId());
      model.put("question", question);
    } else if(StringUtils.equals(Answer.NAME, activity.getEntity())) {
      Answer answer = answerService.getAnswer(activity.getLinkedId());
      model.put("answer", answer);
    } else if(StringUtils.equals(File.NAME, activity.getEntity())) {
      File file = fileService.getFile(activity.getLinkedId());
      model.put("file", file);
    } else if(StringUtils.equals(Folder.NAME, activity.getEntity())) {
View Full Code Here

Examples of org.rat.free.security.makifx.core.base.Answer

    Answer getAnswerFromPlugin() {

        Collection<PluginProvider> plugins = MAP_PLUGIN.values();
        if (plugins != null && !plugins.isEmpty()) {
            for (PluginProvider plugin : plugins) {
                Answer answare = plugin.onClosing();
                if (Answer.NEGATIVE.equals(answare)) {
                    return answare;
                }
            }
            return Answer.POSITIVE;
View Full Code Here

Examples of org.webcamp.questionary.dto.Answer

    List<Question> questions = new ArrayList<>();
    for (int j = 0; j < 5; j++) {
      Question q = new Question();
      q.setText("Test question " + j);
      List<Answer> answers = new ArrayList<>();
      Answer a1 = new Answer();
      a1.setCorrect(true);
      a1.setText("Correct answer");
      Answer a2 = new Answer();
      a2.setCorrect(false);
      a2.setText("Incorrect answer");
      answers.add(a1);
      answers.add(a2);
      q.setAnswers(answers);
      questions.add(q);
    }
View Full Code Here

Examples of pl.edu.oop.java.company.employee.Answer

    public void employeeWithAvarageStrategyShouldBeSatisfiedIfSalaryOverAvarage() throws Exception {
        //given
        final IEmployee employee = new Employee(EMPLOYEE_NAME, BigDecimal.valueOf(3001), avarageStrategy);

        //when
        final Answer satisfied = employee.isSatisfied();

        //then
        assertThat(satisfied).isEqualTo(Answer.FINE);
    }
View Full Code Here

Examples of scratch.Answer

    public ScratchNameValidator(Scratch scratch) {
      this.scratch = scratch;
    }

    @Override public boolean checkInput(String inputString) {
      Answer answer = mrScratchManager().checkIfUserCanRename(scratch, inputString);
      return answer.isYes;
    }
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.