Sha256: a1e9cbd680a4a52dbfbeef54d0ba8a553874eea58ca769b14e26a433390f8b49

Contents?: true

Size: 1.65 KB

Versions: 15

Compression:

Stored size: 1.65 KB

Contents

class TestFacetExtension
  module MyHelperModule
  end

  class << self
    include Reality::Generators::ArtifactDSL

    def template_set_container
      Reality::TestCase::TestTemplateSetContainer
    end

    def target_key
      :entity
    end

    def facet_key
      :jpa
    end

    def define_artifacts1
      file_artifact(:models, :mytemplate, 'main/java/#{entity.qualified_name}.java')
    end

    def define_artifacts2
      file_artifact(:models, :rubytemplate, 'main/java/#{entity.qualified_name}.java')
    end

    def define_artifacts3
      file_artifact(:models,
                    :mytemplate,
                    'main/java/#{entity.qualified_name}.java',
                    :facets => [:ee],
                    :helpers => [MyHelperModule],
                    :guard => 'entity.jpa.good?')
    end

    def define_artifacts4
      file_artifact(:models, :mytemplate, 'main/java/#{entity.qualified_name}.java')
    end

    def define_artifacts5
      file_artifact(:models, :mytemplate, 'main/java/#{entity.qualified_name}.java')
      file_artifact(:qa_models, :mytemplate, 'test/java/#{entity.qualified_name}.java')
      file_artifact(:qa_models, :rubytemplate, 'main/java/#{entity.qualified_name}.java')
    end

    def define_artifacts6
      file_artifact(:models, :mytemplate, 'main/java/#{entity.qualified_name}.java', :bad_option => true)
    end

    def define_artifacts7
      java_artifact(:models, :mytemplate)
    end

    def define_artifacts8
      java_artifact(:models, :mytemplate, :artifact_category => :test)
    end

    def define_artifacts9
      java_artifact(:models, :mytemplate, :artifact_category => :main)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
reality-generators-1.23.0 test/generators/jpa/model.rb
reality-generators-1.22.0 test/generators/jpa/model.rb
reality-generators-1.21.0 test/generators/jpa/model.rb
reality-generators-1.20.0 test/generators/jpa/model.rb
reality-generators-1.19.0 test/generators/jpa/model.rb
reality-generators-1.18.0 test/generators/jpa/model.rb
reality-generators-1.17.0 test/generators/jpa/model.rb
reality-generators-1.16.0 test/generators/jpa/model.rb
reality-generators-1.15.0 test/generators/jpa/model.rb
reality-generators-1.14.0 test/generators/jpa/model.rb
reality-generators-1.13.0 test/generators/jpa/model.rb
reality-generators-1.12.0 test/generators/jpa/model.rb
reality-generators-1.11.0 test/generators/jpa/model.rb
reality-generators-1.10.0 test/generators/jpa/model.rb
reality-generators-1.9.0 test/generators/jpa/model.rb