Examples of Calculator


Examples of org.apache.geronimo.calculator.Calculator

        W3CEndpointReferenceBuilder builder = createERPBuilder();
        Document refParam = TestUtils.createDocument(REF_PARAM);
        builder.referenceParameter(refParam.getDocumentElement());
        EndpointReference epr = builder.build();
       
        Calculator calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(36, calc.multiply(6, 6));
    }
View Full Code Here

Examples of org.apache.geronimo.calculator.Calculator

        response = dispatch.invoke(request);
        testAddResponse(response, 40, true);
    }
  
    public void testPort() throws Exception {
        Calculator calc = null;
       
        // make a call without AddressingFeature
        calc = service.getPort(Calculator.class);
        try {
            calc.add(1, 1);
            throw new ServletException("Did not throw exception");
        } catch (SOAPFaultException e) {
            // that's what we expect
        }

        // make a call with AddressingFeature disabled
        calc = service.getPort(Calculator.class, new AddressingFeature(false, false));
        try {
            calc.add(1, 1);
            throw new ServletException("Did not throw exception");
        } catch (SOAPFaultException e) {
            // that's what we expect
        }
               
        // make a call with AddressingFeature enabled
        calc = service.getPort(Calculator.class, new AddressingFeature());
        Assert.assertEquals(4, calc.add(2, 2));
      
        // make a call with AddressingFeature enabled and port       
        calc = service.getPort(PORT, Calculator.class, new AddressingFeature());
        Assert.assertEquals(6, calc.add(3, 3));
               
        EndpointReference epr = null;
       
        // make a call using EPR from Binding
        epr = ((BindingProvider)calc).getEndpointReference();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(8, calc.add(4, 4));
       
        // make a call using EPR from Service
        epr = calc.getEPR();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(10, calc.add(5, 5));
       
        // make a call using created EPR
        epr = createEPR();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(12, calc.add(6, 6));
    }
View Full Code Here

Examples of org.apache.geronimo.calculator.Calculator

    private EndpointReference createEPR() {      
        return createERPBuilder().build();
    }
   
    protected void updateAddress() {
        Calculator calc = service.getPort(Calculator.class);
        BindingProvider binding = (BindingProvider)calc;
        this.address = (String)binding.getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
        System.out.println("Set address: " + this.address);
    }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

    public String getLabelResource() {
        return "summary_report"//$NON-NLS-1$
    }

    public void add(SampleResult res) {
        Calculator row = null;
        final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
        synchronized (tableRows) {
            row = tableRows.get(sampleLabel);
            if (row == null) {
                row = new Calculator(sampleLabel);
                tableRows.put(row.getLabel(), row);
                model.insertRow(row, model.getRowCount() - 1);
            }
        }
        /*
         * Synch is needed because multiple threads can update the counts.
         */
        synchronized(row) {
            row.addSample(res);
        }
        Calculator tot = tableRows.get(TOTAL_ROW_LABEL);
        synchronized(tot) {
            tot.addSample(res);
        }
        model.fireTableDataChanged();
    }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

     */
    public void clearData() {
        synchronized (tableRows) {
            model.clearData();
            tableRows.clear();
            tableRows.put(TOTAL_ROW_LABEL, new Calculator(TOTAL_ROW_LABEL));
            model.addRow(tableRows.get(TOTAL_ROW_LABEL));
        }
    }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

                fail("TestElapsed: " + overallTime + " - " + " ParentElapsed: " + parentElapsedTotal
                        + " = " + diff + " not in [0," + maxDiff + "]; nanotime="+nanoTime);
            }
           
            // Check that calculator gets the correct statistics from the sample
            Calculator calculator = new Calculator();
            calculator.addSample(parent);
            assertEquals(600, calculator.getTotalBytes());
            assertEquals(1, calculator.getCount());
            assertEquals(1d / (parentElapsedTotal / 1000d), calculator.getRate(),0.0001d); // Allow for some margin of error
            // Check that the throughput uses the time elapsed for the sub results
            assertFalse(1d / (parentElapsed / 1000d) <= calculator.getRate());
        }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

        private String name;

        public AbstractRunningSampleWrapper(String name)
        {
            this.name = name;
            this.delta = new Calculator(name);
            logHeader();
        }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

        }

        public void moveDelta()
        {
            previous = delta;
            delta = new Calculator(name);
        }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

  public String getLabelResource() {
    return "summary_report"//$NON-NLS-1$
  }

  public void add(SampleResult res) {
    Calculator row = null;
        final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
    synchronized (tableRows) {
            row = (Calculator) tableRows.get(sampleLabel);
      if (row == null) {
        row = new Calculator(sampleLabel);
        tableRows.put(row.getLabel(), row);
        model.insertRow(row, model.getRowCount() - 1);
      }
    }
    /*
     * Synch is needed because multiple threads can update the counts.
     */
    synchronized(row) {
        row.addSample(res);
    }
    Calculator tot = ((Calculator) tableRows.get(TOTAL_ROW_LABEL));
    synchronized(tot) {
        tot.addSample(res);
    }
    model.fireTableDataChanged();
  }
View Full Code Here

Examples of org.apache.jmeter.util.Calculator

   */
  public void clearData() {
        synchronized (tableRows) {
        model.clearData();
        tableRows.clear();
        tableRows.put(TOTAL_ROW_LABEL, new Calculator(TOTAL_ROW_LABEL));
        model.addRow(tableRows.get(TOTAL_ROW_LABEL));
        }
  }
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.