Dashboard > GreenPepper Server > ... > HowTo's > HowTo - Use the GreenPepper Eclipse Plugin for a new project
 GreenPepperThis Space is not registered in GreenPepper Server.

Prerequisites

Download

Installation

  • Copy the greenpepper-core-2.2.jar to a directory (ex: C:\GreenPepper)

Project Configuration

  • Create a new empty Java project.

  • Click on GreenPepper / Project GreenPepperised menu. Make sure the menu is checked.
  • Right-click on the project name, select Properties and select the GreenPepper item.
  • Modify the credential for the GreenPepper Demo repository : replace the username value Anonymous by admin and the password value Anonymous by admin. See HowTo - Installing Confluence for the credential. Put the directory where you downloaded the greenpepper-core-2.2.jar into the Runner directory field.
  • Click the Ok button and click on the GreenPepper / Repository View menu.
  • The Repository View can be docked anywhere. We just like to have it beside the Package Explorer.
  • The Repository View present the specifications available from Confluence. To show the specification, double-click on a node

Create the Calculator class

  • Create a new class Calculator with package com.greenpepper.confluence.demo.calculator. This package name is the one use by the Calculator specification on the Demo Space.

  • Based on the specification, we need to add methods that will be called upon the specification execution. Note that the Calculator class is fixture-less and requires no use of any of the GreenPepper classes.
    package com.greenpepper.confluence.demo.calculator;
    
    public class Calculator {
    
        private int x;
        private int y;
    
        public int getX() {
            return x;
        }
    
        public void setX(int x) {
            this.x = x;
        }
    
        public int getY() {
            return y;
        }
    
        public void setY(int y) {
            this.y = y;
        }
    
        public int sum()
        {
            return x + y;
        }
    
        public int difference()
        {
            return x - y;
        }
    
        public int product()
        {
            return x * y;
        }
    
        public int quotient()
        {
            return x / y;
        }
    }
  • Returning to the Repository View, we can execute the Calculator specification by right-clicking on the Calculator node and selecting Execute Document
© Pyxis Technologies Inc.. All rights reserved. GreenPepper® is registered to Pyxis Technologies inc.