Matt Wynne wrote:Hi Dan,
Cucumber and RSpec are complimentary tools. You use Cucumber to write high-level end-to-end tests that you can share with project stakeholders, and RSpec to write microtests for individual classes and modules. The RSpec Book explains the process of moving between these two levels of tests very well:
http://pragprog.com/book/achbd/the-rspec-book
ntumba lobo wrote:can you show the error message stating that the context initialization failed ?
2011-09-21 15:52:05 org.springframework.beans.factory.support.DisposableBeanAdapter
[DEBUG] Invoking destroy() on bean with name 'entityManagerFactory'
2011-09-21 15:52:05 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
[INFO] Closing JPA EntityManagerFactory for persistence unit 'regulation'
2011-09-21 15:52:05 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Retrieved dependent beans for bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#b80f1c': [entityManagerFactory]
2011-09-21 15:52:05 org.springframework.web.context.ContextLoader
[ERROR] Context initialization failed
[DEBUG] Eagerly caching bean 'uploadService' to allow for resolving potential circular references
2011-09-21 15:19:08 org.springframework.beans.factory.annotation.InjectionMetadata
[DEBUG] Processing injected method of bean 'uploadService': AutowiredFieldElement for private org.apache.commons.fileupload.disk.DiskFileItemFactory com.mass.ws.services.UploadService.diskFileFactory
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Creating shared instance of singleton bean 'diskFileItemFactory'
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Creating instance of bean 'diskFileItemFactory'
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[INFO] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b0ede6: defining beans [org.springframework.beans.
Sean Corfield wrote:No, because they do completely different things. :methods is purely about the generated method signatures (and if you specify argument types other than Object I don't expect you'll get reflection warnings from operations on the arguments within the function itself). Type hints are used anywhere that you need to eliminate a reflection warning - which is not always arguments. In fact, more often I've seen it in let forms on on actual arguments in a specific Java method call, e.g., (.someCall ^SomeType obj ^String s)
Sean Corfield wrote:The type hints were meant more as an illustration of where types would go if they were needed, just to show syntax. You'd only need them if you were trying to get rid of reflection warnings. Sorry, probably more confusing than helpful.
To control the actual generated signatures of methods, you might need :methods on the :gen-class directive, if you don't want default types.
Sean Corfield wrote:Simple answer: start here http://clojure.org/compilation
Longer answer:
You need to remember that Java "functions" all have this passed as a first argument so typically when you have String foo(String greeting) { ... } in Java, you're going to have something like (defn -foo ^String [this ^String greeting] ...) in Clojure. -foo tells the Clojure compiler to preserve the function name when generating bytecode.
In your namespace declaration, you'll specify :gen-class to indicate you want the namespace compiled to a Java class.
Sean Corfield wrote:Hope that helps?
Sean Corfield wrote:
2. You don't need doall in strip-data - doall is needed inside with-open to realize the sequence but not after that
Employee Id Name Time In Time Out Dept.
pdm1705 Jane 01/01/2011 06:00 AM 01/01/2011 02:00 PM ER
pdm1705 Jane 01/02/2011 06:00 AM 01/02/2011 02:00 PM ER
pdm1705 Jane 01/04/2011 06:00 AM 01/04/2011 01:00 PM ER
pdm1705 Jane 01/05/2011 05:00 AM 01/05/2011 11:00 PM ER
Employee Id Name Time In Time Out Dept.
mce0518 Jon 01/01/2011 06:00 AM 01/01/2011 02:00 PM ER
mce0518 Jon 01/02/2011 06:00 AM 01/02/2011 02:00 PM ER
mce0518 Jon 01/04/2011 06:00 AM 01/04/2011 01:00 PM ICU
mce0518 Jon 01/05/2011 06:00 AM 01/05/2011 01:00 PM ICU
mce0518 Jon 01/05/2011 05:00 PM 01/05/2011 11:00 PM ER