text
stringlengths
30
1.67M
<s> package cuke4duke . internal . jvmclass ; public class CantTransform extends RuntimeException { public CantTransform ( Object arg , Class < ? > parameterType ) { super ( "<STR_LIT>" + arg + "<STR_LIT:U+0020(>" + arg . getClass ( ) + "<STR_LIT>" + parameterType + "<STR_LIT>" ) ; } } </s>
<s> package cuke4duke . internal . jvmclass ; import cuke4duke . internal . language . LanguageMixin ; public interface ClassLanguageMixin extends LanguageMixin { void activate ( ClassAnalyzer analyzer ) ; } </s>
<s> package cuke4duke . internal . jvmclass ; import cuke4duke . StepMother ; import org . picocontainer . MutablePicoContainer ; import org . picocontainer . PicoBuilder ; import java . util . ArrayList ; import java . util . List ; import java . lang . reflect . Modifier ; public class PicoFactory implements ObjectFa...
<s> package cuke4duke . internal . jvmclass ; import com . google . inject . * ; import cuke4duke . StepMother ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . lang . reflect . Modifier ; public class GuiceFactory implements ObjectFac...
<s> package cuke4duke . internal . jvmclass ; import cuke4duke . Scenario ; import cuke4duke . StepMother ; import cuke4duke . internal . language . AbstractProgrammingLanguage ; import cuke4duke . internal . language . Transformable ; import cuke4duke . spi . ExceptionFactory ; import cuke4duke . spi . jruby . JRuby ;...
<s> package cuke4duke . internal . jvmclass ; import cuke4duke . StepMother ; import org . springframework . beans . factory . FactoryBean ; import org . springframework . beans . factory . InitializingBean ; import org . springframework . context . support . AbstractApplicationContext ; import org . springframework . ...
<s> package cuke4duke . internal . jvmclass ; public interface ClassAnalyzer { void populateStepDefinitionsAndHooks ( ObjectFactory objectFactory , ClassLanguage classLanguage ) throws Throwable ; Class < ? > [ ] alwaysLoad ( ) ; } </s>
<s> package cuke4duke . internal . jvmclass ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . text . NumberFormat ; import java . text . ParseException ; import java . util . Locale ; public class DefaultJvmTransforms { public static Object transformStringToObject ( String argument , L...
<s> package cuke4duke . internal . jvmclass ; import cuke4duke . StepMother ; import java . util . List ; public interface ObjectFactory { void createObjects ( ) ; void disposeObjects ( ) ; boolean canHandle ( Class < ? > clazz ) ; void addClass ( Class < ? > clazz ) ; void addStepMother ( StepMother mother ) ; < T > T...
<s> package cuke4duke . internal . java ; import cuke4duke . annotation . After ; import cuke4duke . annotation . Before ; import cuke4duke . annotation . Order ; import cuke4duke . annotation . Transform ; import cuke4duke . internal . Utils ; import cuke4duke . internal . java . annotation . StepDef ; import cuke4duk...
<s> package cuke4duke . internal . java ; import cuke4duke . Scenario ; import cuke4duke . internal . jvmclass . ClassLanguage ; import cuke4duke . internal . language . AbstractHook ; import java . lang . reflect . Method ; import java . util . List ; public class JavaHook extends AbstractHook { private final ClassLan...
<s> package cuke4duke . internal . java ; import java . lang . reflect . Method ; import java . text . MessageFormat ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class MethodFormat { private static final Pattern METHOD_PATTERN = Pattern . compile ( "<STR_LIT>" ) ; private stati...
<s> package cuke4duke . internal . java ; import cuke4duke . internal . jvmclass . ClassLanguage ; import cuke4duke . internal . language . Transformable ; import java . lang . reflect . Method ; import java . util . Locale ; public class JavaTransform implements Transformable { private final ClassLanguage classLanguag...
<s> package cuke4duke . internal . java ; import cuke4duke . annotation . Pending ; import cuke4duke . spi . ExceptionFactory ; import java . lang . reflect . InvocationTargetException ; import java . lang . reflect . Method ; public class MethodInvoker { private final ExceptionFactory exceptionFactory ; public MethodI...
<s> package cuke4duke . internal . java ; import cuke4duke . internal . jvmclass . ClassLanguage ; import cuke4duke . internal . language . AbstractStepDefinition ; import cuke4duke . internal . language . JdkPatternArgumentMatcher ; import cuke4duke . internal . language . StepArgument ; import java . io . Unsupported...
<s> package cuke4duke . internal . java . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . ANNOTATIO...
<s> package cuke4duke . internal . language ; import cuke4duke . spi . jruby . StepMatch ; import java . util . List ; public interface LanguageMixin { void add_hook ( String phase , Hook hook ) ; void clear_hooks ( ) ; StepMatch create_step_match ( StepDefinition step_definition , String step_name , String formatted_s...
<s> package cuke4duke . internal . language ; import cuke4duke . Scenario ; import java . util . List ; public interface Hook { public List < String > getTagExpressions ( ) ; void invoke ( String location , Scenario scenario ) throws Throwable ; } </s>
<s> package cuke4duke . internal . language ; import java . util . List ; public abstract class AbstractStepDefinition implements StepDefinition { private final AbstractProgrammingLanguage programmingLanguage ; public AbstractStepDefinition ( AbstractProgrammingLanguage programmingLanguage ) { this . programmingLanguag...
<s> package cuke4duke . internal . language ; import cuke4duke . PyString ; import cuke4duke . Scenario ; import cuke4duke . internal . java . MethodInvoker ; import cuke4duke . internal . jvmclass . CantTransform ; import cuke4duke . internal . jvmclass . DefaultJvmTransforms ; import cuke4duke . spi . ExceptionFactor...
<s> package cuke4duke . internal . language ; import java . util . Locale ; public interface Transformable { public < T > T transform ( Object argument , Locale locale ) throws Throwable ; } </s>
<s> package cuke4duke . internal . language ; import java . io . UnsupportedEncodingException ; import java . util . ArrayList ; import java . util . List ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class JdkPatternArgumentMatcher { public static List < StepArgument > argument...
<s> package cuke4duke . internal . language ; import java . util . List ; public abstract class AbstractHook implements Hook { private final List < String > tagExpressions ; public AbstractHook ( List < String > tagExpressions ) { this . tagExpressions = tagExpressions ; } public final List < String > getTagExpressions...
<s> package cuke4duke . internal . language ; import java . util . List ; public interface StepDefinition { String regexp_source ( ) throws Throwable ; String file_colon_line ( ) throws Throwable ; List < StepArgument > arguments_from ( String stepName ) throws Throwable ; void invoke ( List < Object > arguments ) thro...
<s> package cuke4duke . internal . language ; import java . io . UnsupportedEncodingException ; public class StepArgument { private final String val ; private final int byteOffset ; public StepArgument ( String val , int charOffset , String stepName ) throws UnsupportedEncodingException { this . byteOffset = stepName ....
<s> package cuke4duke . internal . language ; import cuke4duke . spi . jruby . StepMatch ; import java . util . List ; public interface ProgrammingLanguage { void load_code_file ( String file ) throws Throwable ; List < StepMatch > step_matches ( String step_name , String formatted_step_name ) throws Throwable ; Except...
<s> package cuke4duke . internal . groovy ; import cuke4duke . internal . language . AbstractStepDefinition ; import cuke4duke . internal . language . JdkPatternArgumentMatcher ; import cuke4duke . internal . language . StepArgument ; import groovy . lang . Closure ; import java . io . UnsupportedEncodingException ; im...
<s> package cuke4duke . internal . groovy ; import cuke4duke . Scenario ; import cuke4duke . internal . language . AbstractHook ; import groovy . lang . Closure ; import java . util . List ; import java . util . Locale ; public class GroovyHook extends AbstractHook { private final GroovyLanguage groovyLanguage ; privat...
<s> package cuke4duke . internal . groovy ; import cuke4duke . GroovyDsl ; import cuke4duke . Scenario ; import cuke4duke . internal . language . AbstractProgrammingLanguage ; import cuke4duke . internal . language . LanguageMixin ; import cuke4duke . spi . ExceptionFactory ; import groovy . lang . Binding ; import gro...
<s> package cuke4duke ; public interface PyString { public String to_s ( ) ; } </s>
<s> package cuke4duke . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface...
<s> package cuke4duke . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface...
<s> package cuke4duke . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface...
<s> package cuke4duke . annotation ; import cuke4duke . internal . java . annotation . StepDef ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; public interface I18n { public cla...
<s> package cuke4duke . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface...
<s> package cuke4duke . annotation ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . METHOD ) public @ interface...
<s> package cuke4duke ; public interface StepMother { void invoke ( String step ) ; void invoke ( String step , Table table ) ; void invoke ( String step , String multilineString ) ; String ask ( String question , int timeoutSecs ) ; void announce ( String message ) ; void embed ( String file , String mimeType ) ; } </...
<s> package cuke4duke ; public interface CellConverter { public String convertCell ( String cellValue ) ; } </s>
<s> package cuke4duke ; import java . util . List ; import java . util . Map ; public interface Table { public List < Map < String , String > > hashes ( ) ; public Map < String , String > rowsHash ( ) ; public List < List < String > > raw ( ) ; public List < List < String > > rows ( ) ; public void diffLists ( List < L...
<s> package cuke4duke . spi . jruby ; import cuke4duke . spi . ExceptionFactory ; import org . jruby . RubyClass ; import org . jruby . RubyModule ; import org . jruby . exceptions . RaiseException ; public class JRubyExceptionFactory implements ExceptionFactory { public Exception error ( String errorClass , String mes...
<s> package cuke4duke . spi . jruby ; import org . jruby . Ruby ; import org . jruby . RubyArray ; import java . util . Collection ; public class JRuby { private static Ruby runtime ; public static void setRuntime ( Ruby runtime ) { JRuby . runtime = runtime ; } public static Ruby getRuntime ( ) { if ( runtime == null ...
<s> package cuke4duke . spi . jruby ; import cuke4duke . internal . language . StepDefinition ; public interface StepMatch { String file_colon_line ( ) ; String backtrace_line ( ) ; int text_length ( ) ; StepDefinition step_definition ( ) ; String name ( ) ; String inspect ( ) ; String format_args ( Object format , Obj...
<s> package cuke4duke . spi ; public interface ExceptionFactory { Exception error ( String errorClass , String message ) ; Exception cucumberPending ( String message ) ; Exception cucumberArityMismatchError ( String message ) ; } </s>
<s> package cuke4duke ; public class Steps { private final StepMother stepMother ; public Steps ( StepMother stepMother ) { this . stepMother = stepMother ; } protected String ask ( String question , int timeoutSecs ) { return stepMother . ask ( question , timeoutSecs ) ; } protected void announce ( String message ) { ...
<s> package cuke4duke ; public interface Scenario { } </s>
<s> package cuke4duke . spring ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Retention ( RetentionPolicy . RUNTIME ) @ Target ( ElementType . TYPE ) public @ interface StepD...
<s> package simple ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import static org . junit . Assert . assertTrue ; public class CalledSteps { private boolean magic ; @ Given ( "<STR_LIT>" ) public void itIs ( String what ) { if ( what . equals ( "<STR_LIT>" ) )...
<s> package simple ; import cuke4duke . annotation . I18n . ZH_CN . - UNK - ; import cuke4duke . annotation . I18n . ZH_CN . - UNK - ; import cuke4duke . annotation . I18n . ZH_CN . - UNK - ; public class ChineseCalculatorSteps { @ - UNK - ( "<STR_LIT>" ) public void - UNK - ( int n ) { } @ - UNK - ( "<STR_LIT>" ) publ...
<s> package simple ; import cuke4duke . annotation . After ; import cuke4duke . annotation . Before ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import static org . junit . Assert . assertEquals ; import static org . junit . Assert . assertTrue ; public class H...
<s> package simple ; import cuke4duke . CellConverter ; import cuke4duke . Table ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import cuke4duke . annotation . Pending ; import java . util . * ; import static or...
<s> package simple ; import cuke4duke . StepMother ; import cuke4duke . Steps ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import static org . junit . Assert . fail ; public class HalfManualSteps extends Steps { public HalfManualSteps ( StepMother stepMother ) ...
<s> package simple ; import cuke4duke . StepMother ; import cuke4duke . Steps ; import cuke4duke . annotation . I18n . EN . When ; public class CallingSteps extends Steps { public CallingSteps ( StepMother stepMother ) { super ( stepMother ) ; } @ When ( "<STR_LIT>" ) public void iCallAnotherStep ( ) { Given ( "<STR_LI...
<s> package simple ; import cuke4duke . annotation . Before ; public abstract class SuperSteps { protected String b4AndForever = "<STR_LIT>" ; protected String b4 = "<STR_LIT>" ; @ Before ( { "<STR_LIT>" , "<STR_LIT>" } ) public void setB4AndForever ( Object scenario ) { b4AndForever = "<STR_LIT>" ; } @ Before ( "<STR_...
<s> package simple ; import cuke4duke . StepMother ; import cuke4duke . Steps ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import cuke4duke . annotation . Transform ; import static junit . framework . Assert ....
<s> package simple ; import cuke4duke . annotation . I18n . EN . When ; import cuke4duke . annotation . I18n . NO . S - UNK - ; import static org . junit . Assert . assertEquals ; public class NorwegianSteps { @ When ( "<STR_LIT>" ) public void j - UNK - ViElsker ( String hva , String hae ) { } @ S - UNK - ( "<STR_LIT>...
<s> package org . books . domain ; public class BookQuery { private String author = "<STR_LIT>" ; private String title = "<STR_LIT>" ; private String publisher = "<STR_LIT>" ; public void setAuthor ( String author ) { this . author = author ; } public String getAuthor ( ) { return author ; } public void setTitle ( Stri...
<s> package org . books . domain ; import javax . persistence . * ; @ Entity public class LineItem { @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) private long id ; @ ManyToOne private Book book ; private int quantity ; public void setBook ( Book book ) { this . book = book ; } public Book getBook ( ) { re...
<s> package org . books . domain ; import javax . persistence . Entity ; import javax . persistence . GeneratedValue ; import javax . persistence . Id ; @ Entity public class Address { @ Id @ GeneratedValue private long id ; } </s>
<s> package org . books . domain ; import javax . persistence . * ; import java . util . ArrayList ; import java . util . List ; @ Entity @ Table ( name = "<STR_LIT>" ) public class Order { public enum Status { Submitted , InProgress , Closed , Canceled } @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) priva...
<s> package org . books . domain ; import javax . persistence . Entity ; import javax . persistence . GeneratedValue ; import javax . persistence . Id ; @ Entity public class PaymentInfo { @ Id @ GeneratedValue private long id ; } </s>
<s> package org . books . domain ; import javax . persistence . * ; @ Entity @ NamedQuery ( name = "<STR_LIT>" , query = "<STR_LIT>" ) public class Book { @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) private long id ; private String authors ; private String publisher ; private String title ; private int y...
<s> package org . books . business ; import org . books . domain . Book ; import org . books . domain . BookQuery ; import javax . ejb . Stateless ; import javax . persistence . EntityManager ; import javax . persistence . PersistenceContext ; import javax . persistence . Query ; import java . util . ArrayList ; import...
<s> package org . books . business ; import org . books . dao . OrderDao ; import org . books . domain . Address ; import org . books . domain . LineItem ; import org . books . domain . Order ; import org . books . domain . PaymentInfo ; import javax . annotation . Resource ; import javax . ejb . EJB ; import javax . e...
<s> package org . books . business ; import org . books . domain . Address ; import org . books . domain . LineItem ; import org . books . domain . PaymentInfo ; import java . util . List ; public interface OrderManager { public void createOrder ( List < LineItem > lineItems , Address address , PaymentInfo paymentInfo ...
<s> package org . books . business ; import org . books . domain . Book ; import org . books . domain . LineItem ; import java . util . List ; public interface CartManager { void AddBook ( Book book , int quantity ) ; public List < LineItem > getLineItems ( ) ; double getTotalPrice ( ) ; void checkout ( ) throws Except...
<s> package org . books . business ; import org . books . domain . Order ; import javax . annotation . Resource ; import javax . ejb . * ; import javax . jms . JMSException ; import javax . jms . Message ; import javax . jms . MessageListener ; import javax . jms . TextMessage ; import javax . persistence . EntityManag...
<s> package org . books . business ; import org . books . domain . Book ; import org . books . domain . BookQuery ; import java . util . List ; public interface CatalogManager { public List < Book > searchBooks ( BookQuery bookQuery ) ; public void setMessage ( String message ) ; public String getMessage ( ) ; } </s>
<s> package org . books . business ; import org . books . domain . Book ; import org . books . domain . LineItem ; import javax . ejb . EJB ; import javax . ejb . Stateful ; import java . util . ArrayList ; import java . util . List ; @ Stateful public class CartManagerImpl implements CartManager { @ EJB private PriceC...
<s> package org . books . business ; import org . books . domain . Address ; import org . books . domain . LineItem ; import org . books . domain . PaymentInfo ; import javax . ejb . Stateless ; import java . util . List ; @ Stateless public class PriceCalculatorImpl implements PriceCalculator { public double getTotalP...
<s> package org . books . business ; import org . books . domain . Address ; import org . books . domain . LineItem ; import org . books . domain . PaymentInfo ; import java . util . List ; public interface PriceCalculator { public double getTotalPrice ( List < LineItem > lineItems , Address address , PaymentInfo payme...
<s> package org . books . dao ; import org . books . domain . Book ; import javax . ejb . Stateless ; import javax . persistence . EntityManager ; import javax . persistence . PersistenceContext ; import javax . persistence . Query ; import java . util . List ; @ Stateless public class BookDaoImpl implements BookDao { ...
<s> package org . books . dao ; import org . books . domain . Order ; import javax . ejb . Stateless ; import javax . persistence . EntityManager ; import javax . persistence . PersistenceContext ; import javax . persistence . Query ; import java . util . List ; @ Stateless public class OrderDaoImpl implements OrderDao...
<s> package org . books . dao ; import org . books . domain . Order ; import java . util . List ; public interface OrderDao { public abstract void addOrder ( Order order ) throws Exception ; public abstract void deleteOrder ( Order order ) throws Exception ; public abstract List < Order > getOrders ( ) ; } </s>
<s> package org . books . dao ; import org . books . domain . Book ; import javax . ejb . Local ; import java . util . List ; @ Local public interface BookDao { void addBook ( Book book ) throws Exception ; void deleteBook ( Book book ) throws Exception ; List < Book > getBooks ( ) ; } </s>
<s> package org . books . test . acceptance ; import cuke4duke . annotation . After ; import javax . naming . Context ; import javax . naming . InitialContext ; import javax . naming . NamingException ; import java . util . Properties ; public class ContainerInitializer { private final Context context ; public Containe...
<s> package org . books . test . acceptance ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import org . apache . openejb . api . LocalClient ; import org . books . business . CartManager ; import org . books . domain . Book ; import javax . ejb . EJB ; import jav...
<s> package org . books . test . acceptance ; import cuke4duke . annotation . After ; import cuke4duke . annotation . Before ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import org . apache . openejb . api . L...
<s> package org . books . test . acceptance ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . When ; import org . apache . openejb . api . LocalClient ; import org . books . business . OrderManager ; import org . books . domain . LineItem ; import javax . ejb . EJB ; impo...
<s> package org . books . test . acceptance ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import org . apache . openejb . api . LocalClient ; import org . books . business . CartManager ; import org . books . d...
<s> package org . books . test . acceptance ; import javax . naming . Context ; import javax . naming . NamingException ; public abstract class ContainerSteps { protected static Context context ; public ContainerSteps ( ContainerInitializer initializer ) throws NamingException { context = initializer . getContext ( ) ;...
<s> package billing ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import static org . junit . Assert . assertTrue ; public class CalledSteps { private boolean magic ; @ Given ( "<STR_LIT>" ) public void itIs ( String what ) { if ( what . equals ( "<STR_LIT>" ) ...
<s> package billing ; import com . google . inject . Inject ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import java . math . BigDecimal ; import static org . junit . Assert . assertTrue ; public class Billing...
<s> package billing ; import com . google . inject . Inject ; import cuke4duke . StepMother ; import cuke4duke . Steps ; import cuke4duke . annotation . I18n . EN . When ; public class CallingSteps extends Steps { @ Inject public CallingSteps ( StepMother stepMother ) { super ( stepMother ) ; } @ When ( "<STR_LIT>" ) p...
<s> package billing ; import billing . CreateTransactionResponse . Status ; public class SimpleBillingDatabase implements BillingDatabase { public Status createTransaction ( Transaction transaction ) { return Status . OK ; } } </s>
<s> package billing ; import billing . CreateTransactionResponse . Status ; import com . google . inject . Inject ; public class BillingService { private BillingDatabase database ; @ Inject public BillingService ( BillingDatabase database ) { this . database = database ; } public CreateTransactionResponse sendTransacti...
<s> package billing ; import com . google . inject . AbstractModule ; public class DependenciesModule extends AbstractModule { SimpleBillingDatabase simpleBillingDatabase = new SimpleBillingDatabase ( ) ; @ Override protected void configure ( ) { bind ( BillingDatabase . class ) . toInstance ( simpleBillingDatabase ) ;...
<s> package billing ; import billing . CreateTransactionResponse . Status ; public interface BillingDatabase { public Status createTransaction ( Transaction transaction ) ; } </s>
<s> package billing ; import java . math . BigDecimal ; public class Transaction { private String customerId ; private BigDecimal amount ; public Transaction ( String customerId , BigDecimal amount ) { this . customerId = customerId ; this . amount = amount ; } @ Override public String toString ( ) { return "<STR_LIT>"...
<s> package billing ; public class CreateTransactionResponse { public enum Status { OK , ERROR ; } private final Status status ; private final String description ; public CreateTransactionResponse ( Status status , String description ) { this . status = status ; this . description = description ; } public boolean isOK ...
<s> package cuke4duke . webdriver ; import cuke4duke . annotation . I18n . EN . Then ; import org . openqa . selenium . WebDriver ; import java . lang . reflect . InvocationTargetException ; import static org . junit . Assert . assertThat ; import static org . junit . matchers . JUnitMatchers . containsString ; public ...
<s> package cuke4duke . webdriver ; import org . junit . Test ; import java . lang . reflect . InvocationTargetException ; public class Debugging { @ Test public void letsDebug ( ) throws InvocationTargetException , InstantiationException , IllegalAccessException { WebDriverFacade wdf = new WebDriverFacade ( ) ; Result...
<s> package cuke4duke . webdriver ; import cuke4duke . annotation . After ; import org . openqa . selenium . WebDriver ; import java . lang . reflect . Constructor ; import java . lang . reflect . InvocationTargetException ; public class WebDriverFacade { private static Constructor < WebDriver > driverConstructor = get...
<s> package cuke4duke . webdriver ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . When ; import org . openqa . selenium . By ; import org . openqa . selenium . WebDriver ; import org . openqa . selenium . WebElement ; import java . lang . reflect . InvocationTargetExcep...
<s> package calc ; import java . util . ArrayList ; import java . util . List ; public class Calculator { List < Double > stack = new ArrayList < Double > ( ) ; public void push ( double arg ) { stack . add ( arg ) ; } public double divide ( ) { return stack . get ( <NUM_LIT:0> ) / stack . get ( <NUM_LIT:1> ) ; } } </s...
<s> package simple ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . spring . StepDefinitions ; import static org . junit . Assert . assertTrue ; @ StepDefinitions public class CalledSteps { private boolean magic = false ; @ Given ( "<STR_LIT>" )...
<s> package simple ; import cuke4duke . annotation . I18n . EN . Given ; import cuke4duke . annotation . I18n . EN . Then ; import cuke4duke . annotation . I18n . EN . When ; import cuke4duke . spring . StepDefinitions ; import org . springframework . beans . factory . annotation . Autowired ; import static org . junit...
<s> package simple ; import cuke4duke . StepMother ; import cuke4duke . Steps ; import cuke4duke . annotation . I18n . EN . When ; import cuke4duke . spring . StepDefinitions ; import org . springframework . beans . factory . annotation . Autowired ; @ StepDefinitions public class CallingSteps extends Steps { @ Autowir...
<s> package simple ; import org . springframework . stereotype . Component ; @ Component public class MyGreeter implements Greeter { public String hello ( ) { return "<STR_LIT>" ; } } </s>
<s> package simple ; public interface Greeter { String hello ( ) ; } </s>
<s> package erjang ; import java . io . File ; import erjang . m . erlang . ErlConvert ; import junit . framework . TestCase ; public abstract class AbstractErjangTestCase extends TestCase { protected File file ; public AbstractErjangTestCase ( File file ) { super ( file . getName ( ) ) ; this . file = file ; } public ...