vraptor-scaffold 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/CHANGELOG.rdoc +164 -0
- data/Gemfile.lock +5 -8
- data/README.textile +20 -7
- data/bin/vraptor +1 -1
- data/index.sample.html +169 -0
- data/lib/vraptor-scaffold.rb +10 -29
- data/lib/vraptor-scaffold/configuration.rb +27 -4
- data/lib/vraptor-scaffold/execution.rb +24 -0
- data/lib/vraptor-scaffold/generators/app/app_generator.rb +196 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/dependency.rb +0 -0
- data/lib/vraptor-scaffold/generators/app/dependency_manager.rb +53 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/freemarker_template_engine.rb +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/jsp_template_engine.rb +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.gradle.erb +19 -1
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.properties.erb +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.xml +6 -2
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/decorators.erb +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/classpath.erb +0 -5
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/project.erb +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.jdt.core.prefs +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.common.component.tt +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.common.project.facet.core.xml +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.container +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.name +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/freemarker-web.xml +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/infrastructure/FreemarkerPathResolver.java.tt +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/macros/html.ftl +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/main.ftl +0 -0
- data/lib/vraptor-scaffold/generators/app/templates/heroku/Main.java +21 -0
- data/lib/vraptor-scaffold/generators/app/templates/heroku/Procfile +1 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/ivy-2.2.0.jar +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/ivy.erb +1 -1
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/jsp-web.xml +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/main.jsp +2 -2
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/prelude.jspf +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator/templates/src/models/Entity.java.tt → app/templates/models/Entity.erb} +1 -1
- data/lib/vraptor-scaffold/generators/app/templates/orm/Repository-hibernate.java.tt +50 -0
- data/lib/vraptor-scaffold/generators/{app_generator/templates/src/repositories/Repository.java.tt → app/templates/orm/Repository-jpa.java.tt} +3 -3
- data/lib/vraptor-scaffold/generators/app/templates/orm/hibernate.cfg.xml +7 -0
- data/lib/vraptor-scaffold/generators/app/templates/orm/persistence.xml +10 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/pom.erb +29 -13
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/resources-test/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/app/templates/resources/hibernate.properties +16 -0
- data/lib/vraptor-scaffold/generators/app/templates/resources/log4j.properties +4 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/resources/messages.properties +0 -0
- data/lib/vraptor-scaffold/generators/app/templates/vraptor-scaffold.erb +7 -0
- data/lib/vraptor-scaffold/generators/{app_generator/templates/webapp/WEB-INF/web.xml → app/templates/webapp/WEB-INF/web.xml.tt} +2 -2
- data/lib/vraptor-scaffold/generators/{app_generator/templates/src-test/controllers → app/templates/webapp/images}/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/index.jsp +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/common.css +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/scaffold.css +0 -0
- data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/stylesheets.css +0 -0
- data/lib/vraptor-scaffold/generators/plugin/plugin_generator.rb +42 -0
- data/lib/vraptor-scaffold/generators/plugin/vraptor_gem.rb +36 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/attribute.rb +1 -1
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/base_scaffold.rb +6 -2
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/controller_generator.rb +3 -3
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/controller.erb +3 -3
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/controller_test.erb +1 -1
- data/lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb +20 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/model.erb +3 -3
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/model_test.erb +1 -1
- data/lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb +27 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/repository.erb +3 -3
- data/lib/vraptor-scaffold/generators/scaffold/repository_generator/templates/repository_impl.erb +16 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/repository_test.erb +1 -1
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/scaffold_generator.rb +0 -0
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/freemarker_generator.rb +18 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/edit.erb +0 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/form.erb +4 -4
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/templates/index.erb +36 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/new.erb +0 -0
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/templates/show.erb +14 -0
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/jsp_generator/jsp_generator.rb +18 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/edit.erb +0 -0
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/form.erb +4 -4
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/index.erb +6 -6
- data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/new.erb +0 -0
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/jsp_generator/templates/show.erb +14 -0
- data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb +21 -0
- data/lib/vraptor-scaffold/load_paths.rb +13 -21
- data/lib/vraptor-scaffold/runner.rb +11 -0
- data/lib/vraptor-scaffold/runner/commands_help.rb +13 -0
- data/lib/vraptor-scaffold/runner/configure.rb +21 -0
- data/lib/vraptor-scaffold/runner/generator.rb +15 -0
- data/lib/vraptor-scaffold/runner/help.rb +12 -0
- data/lib/vraptor-scaffold/runner/plugin.rb +19 -0
- data/lib/vraptor-scaffold/runner/scaffold.rb +16 -0
- data/lib/vraptor-scaffold/version.rb +1 -1
- data/spec/resources/vraptor-scaffold.properties +5 -0
- data/spec/simple_custom_plugin.rb +10 -0
- data/spec/spec_helper.rb +5 -6
- data/spec/vraptor-scaffold/configuration_spec.rb +88 -4
- data/spec/vraptor-scaffold/execution_spec.rb +47 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/app_generator_spec.rb +136 -54
- data/spec/vraptor-scaffold/generators/{app_generator → app}/dependency_manager_spec.rb +1 -1
- data/spec/vraptor-scaffold/generators/{app_generator → app}/dependency_spec.rb +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/freemarker_template_engine_spec.rb +1 -1
- data/spec/vraptor-scaffold/generators/{app_generator → app}/jsp_template_engine_spec.rb +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/Entity.java +1 -1
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/FreemarkerPathResolver.java +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/Repository.java +3 -3
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/build.gradle +24 -5
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/build.properties +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/decorators-jsp.xml +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/decorators.xml +0 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker-web.xml +2 -2
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/ivy.xml +6 -5
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/jsp-web.xml +1 -1
- data/spec/vraptor-scaffold/generators/app/templates/pom-heroku.xml +168 -0
- data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/pom.xml +11 -14
- data/spec/vraptor-scaffold/generators/app/templates/vraptor-scaffold.properties +7 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/build.gradle +61 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_build.gradle +61 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_ivy.xml +40 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_pom.xml +147 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/ivy.xml +40 -0
- data/spec/vraptor-scaffold/generators/plugin/expected_configs/pom.xml +147 -0
- data/spec/vraptor-scaffold/generators/plugin/plugin_generator_spec.rb +130 -0
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/attribute_spec.rb +13 -9
- data/spec/vraptor-scaffold/generators/scaffold/base_scaffold_spec.rb +73 -0
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/controller_generator_spec.rb +18 -9
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/ProductController.java +3 -3
- data/spec/vraptor-scaffold/generators/scaffold/freemarker_generator/freemarker_generator_spec.rb +74 -0
- data/spec/vraptor-scaffold/generators/scaffold/jsp_generator/jsp_generator_spec.rb +75 -0
- data/spec/vraptor-scaffold/generators/scaffold/model_generator/model_generator_spec.rb +50 -0
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/Product.java +6 -6
- data/spec/vraptor-scaffold/generators/scaffold/model_generator/templates/hibernate.cfg.xml +8 -0
- data/spec/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator_spec.rb +60 -0
- data/spec/vraptor-scaffold/generators/scaffold/repository_generator/templates/ClientRepository.java +22 -0
- data/spec/vraptor-scaffold/generators/scaffold/repository_generator/templates/ClientRepositoryImpl.java +16 -0
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/ProductRepository.java +3 -3
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/ProductRepositoryImpl.java +3 -3
- data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/scaffold_generator_spec.rb +0 -0
- data/spec/vraptor-scaffold/runner/commands_help_spec.rb +12 -0
- data/spec/vraptor-scaffold/runner/configure_spec.rb +12 -0
- data/spec/vraptor-scaffold/runner/generator_spec.rb +31 -0
- data/spec/vraptor-scaffold/runner/help_spec.rb +29 -0
- data/spec/vraptor-scaffold/runner/plugin_spec.rb +45 -0
- data/spec/vraptor-scaffold/runner/scaffold_spec.rb +35 -0
- data/spec/vraptor-scaffold_spec.rb +1 -94
- data/vraptor-scaffold.gemspec +3 -3
- metadata +137 -140
- data/History.txt +0 -128
- data/lib/vraptor-scaffold/generators/app_generator/app_generator.rb +0 -102
- data/lib/vraptor-scaffold/generators/app_generator/dependency_manager.rb +0 -37
- data/lib/vraptor-scaffold/generators/app_generator/templates/ivysettings.xml +0 -9
- data/lib/vraptor-scaffold/generators/app_generator/templates/resources/META-INF/persistence.xml +0 -20
- data/lib/vraptor-scaffold/generators/app_generator/templates/resources/log4j.properties +0 -4
- data/lib/vraptor-scaffold/generators/app_generator/templates/src-test/models/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/app_generator/templates/src-test/repositories/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/app_generator/templates/src/controllers/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/app_generator/templates/vraptor-scaffold.erb +0 -2
- data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/images/.empty_directory +0 -0
- data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/javascripts/application.js +0 -0
- data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/javascripts/jquery.min.js +0 -16
- data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb +0 -22
- data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/templates/index.erb +0 -36
- data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/templates/show.erb +0 -14
- data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/jsp_generator.rb +0 -22
- data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/show.erb +0 -14
- data/lib/vraptor-scaffold/generators/scaffold_generator/model_generator/model_generator.rb +0 -11
- data/lib/vraptor-scaffold/generators/scaffold_generator/repository_generator/repository_generator.rb +0 -12
- data/lib/vraptor-scaffold/generators/scaffold_generator/repository_generator/templates/repository_impl.erb +0 -16
- data/spec/vraptor-scaffold/generators/scaffold_generator/base_scaffold_spec.rb +0 -41
- data/spec/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator_spec.rb +0 -36
- data/spec/vraptor-scaffold/generators/scaffold_generator/jsp_generator/jsp_generator_spec.rb +0 -34
- data/spec/vraptor-scaffold/generators/scaffold_generator/model_generator/model_generator_spec.rb +0 -25
- data/spec/vraptor-scaffold/generators/scaffold_generator/repository_generator/repository_generator_spec.rb +0 -31
@@ -1,11 +0,0 @@
|
|
1
|
-
class ModelGenerator < BaseScaffold
|
2
|
-
|
3
|
-
def self.source_root
|
4
|
-
File.join File.dirname(__FILE__), "templates"
|
5
|
-
end
|
6
|
-
|
7
|
-
def build
|
8
|
-
template("model.erb", Configuration.main_class_path("models", "#{class_name}.java"))
|
9
|
-
template("model_test.erb", Configuration.test_class_path("models", "#{test_class_name}.java"))
|
10
|
-
end
|
11
|
-
end
|
data/lib/vraptor-scaffold/generators/scaffold_generator/repository_generator/repository_generator.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
class RepositoryGenerator < BaseScaffold
|
2
|
-
|
3
|
-
def self.source_root
|
4
|
-
File.join File.dirname(__FILE__), "templates"
|
5
|
-
end
|
6
|
-
|
7
|
-
def build
|
8
|
-
template("repository.erb", Configuration.main_class_path("repositories", "#{repository_interface_name}.java"))
|
9
|
-
template("repository_impl.erb", Configuration.main_class_path("repositories", "#{repository_impl_name}.java"))
|
10
|
-
template("repository_test.erb", Configuration.test_class_path("repositories", "#{repository_test_class_name}.java"))
|
11
|
-
end
|
12
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
package <%= Configuration.package %>.repositories;
|
2
|
-
|
3
|
-
import javax.persistence.EntityManager;
|
4
|
-
|
5
|
-
import br.com.caelum.vraptor.ioc.Component;
|
6
|
-
import <%= Configuration.package %>.models.<%= class_name %>;
|
7
|
-
|
8
|
-
@Component
|
9
|
-
public class <%= repository_impl_name %>
|
10
|
-
extends Repository<<%= class_name %>, Long>
|
11
|
-
implements <%= repository_interface_name %> {
|
12
|
-
|
13
|
-
<%= repository_impl_name %>(EntityManager entityManager) {
|
14
|
-
super(entityManager);
|
15
|
-
}
|
16
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
|
2
|
-
|
3
|
-
describe BaseScaffold do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
@base = BaseScaffold.new("client")
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should know model class name" do
|
10
|
-
@base.class_name.should eql("Client")
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should know model test class name" do
|
14
|
-
@base.test_class_name.should eql("ClientTest")
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should know repository class name impl" do
|
18
|
-
@base.repository_impl_name.should eql("ClientRepositoryImpl")
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should know repository interface name" do
|
22
|
-
@base.repository_interface_name.should eql("ClientRepository")
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should know repository test class name" do
|
26
|
-
@base.repository_test_class_name.should eql("ClientRepositoryImplTest")
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should know controller class name" do
|
30
|
-
@base.controller_class_name.should eql("ClientController")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should know controller test class name" do
|
34
|
-
@base.controller_test_class_name.should eql("ClientControllerTest")
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should know model parameter name with scaffold given with first letter uppercased" do
|
38
|
-
base = BaseScaffold.new("Client")
|
39
|
-
base.model_parameter_name.should eql("client")
|
40
|
-
end
|
41
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../../../spec_helper")
|
2
|
-
|
3
|
-
describe FreemarkerGenerator do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
model = "product"
|
7
|
-
@views_path = File.join Configuration::WEB_INF, "views", model
|
8
|
-
@generator = FreemarkerGenerator.new(model, build_attributes)
|
9
|
-
@generator.build
|
10
|
-
end
|
11
|
-
|
12
|
-
after(:each) do
|
13
|
-
FileUtils.remove_dir("src")
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should create index view" do
|
17
|
-
File.exist?("#{@views_path}/index.ftl").should be_true
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should create show view" do
|
21
|
-
File.exist?("#{@views_path}/show.ftl").should be_true
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should create form view" do
|
25
|
-
File.exist?("#{@views_path}/form.ftl").should be_true
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should create new view" do
|
29
|
-
File.exist?("#{@views_path}/newProduct.ftl").should be_true
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should create edit view" do
|
33
|
-
File.exist?("#{@views_path}/edit.ftl").should be_true
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
data/spec/vraptor-scaffold/generators/scaffold_generator/jsp_generator/jsp_generator_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../../../spec_helper")
|
2
|
-
|
3
|
-
describe JspGenerator do
|
4
|
-
before(:each) do
|
5
|
-
model = "product"
|
6
|
-
@views_path = File.join Configuration::WEB_INF, "jsp", model
|
7
|
-
@generator = JspGenerator.new(model, build_attributes)
|
8
|
-
@generator.build
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
FileUtils.remove_dir("src")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should create index view" do
|
16
|
-
File.exist?("#{@views_path}/index.jsp").should be_true
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should create show view" do
|
20
|
-
File.exist?("#{@views_path}/show.jsp").should be_true
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should create form view" do
|
24
|
-
File.exist?("#{@views_path}/form.jsp").should be_true
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should create new view" do
|
28
|
-
File.exist?("#{@views_path}/newProduct.jsp").should be_true
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should create edit view" do
|
32
|
-
File.exist?("#{@views_path}/edit.jsp").should be_true
|
33
|
-
end
|
34
|
-
end
|
data/spec/vraptor-scaffold/generators/scaffold_generator/model_generator/model_generator_spec.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../../../spec_helper")
|
2
|
-
|
3
|
-
describe ModelGenerator do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
mock_config_file
|
7
|
-
@generator = ModelGenerator.new("product", build_attributes)
|
8
|
-
@generator.build
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
FileUtils.remove_dir("src")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should create model" do
|
16
|
-
source = File.join File.dirname(__FILE__), "templates", "Product.java"
|
17
|
-
destination = Configuration.main_class_path "models", "Product.java"
|
18
|
-
exists_and_identical?(source, destination)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should create model test" do
|
22
|
-
test_class = Configuration.test_class_path "models", "ProductTest.java"
|
23
|
-
File.exist?(test_class).should be_true
|
24
|
-
end
|
25
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../../../spec_helper")
|
2
|
-
|
3
|
-
describe RepositoryGenerator do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
mock_config_file
|
7
|
-
@generator = RepositoryGenerator.new("product", build_attributes)
|
8
|
-
@generator.build
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
FileUtils.remove_dir("src")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should create repository interface" do
|
16
|
-
source = File.join File.dirname(__FILE__), "templates", "ProductRepository.java"
|
17
|
-
destination = Configuration.main_class_path "repositories", "ProductRepository.java"
|
18
|
-
exists_and_identical?(source, destination)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should create repository impl" do
|
22
|
-
source = File.join File.dirname(__FILE__), "templates", "ProductRepositoryImpl.java"
|
23
|
-
destination = Configuration.main_class_path "repositories", "ProductRepositoryImpl.java"
|
24
|
-
exists_and_identical?(source, destination)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should create repository test" do
|
28
|
-
test_class = Configuration.test_class_path "repositories", "ProductRepositoryImplTest.java"
|
29
|
-
File.exist?(test_class).should be_true
|
30
|
-
end
|
31
|
-
end
|