beta_tools 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. data/.gitignore +11 -0
  2. data/Capfile +2 -0
  3. data/Gemfile +4 -0
  4. data/README +7 -0
  5. data/Rakefile +7 -0
  6. data/beta_tools.gemspec +31 -0
  7. data/bin/deploy +9 -0
  8. data/bin/documentation_daemon +12 -0
  9. data/bin/loginToUrl +6 -0
  10. data/bin/onVpn +6 -0
  11. data/bin/pub +91 -0
  12. data/bin/query_solr +11 -0
  13. data/bin/solrWebApp +6 -0
  14. data/conf/schema.xml +220 -0
  15. data/config/deploy.rb +44 -0
  16. data/config.ru +2 -0
  17. data/docs/#next_design.mmd# +0 -0
  18. data/features/deploy.feature +9 -0
  19. data/features/git.feature +15 -0
  20. data/features/maven.feature +21 -0
  21. data/features/step_definitions/deploy_steps.rb +11 -0
  22. data/features/step_definitions/git_steps.rb +20 -0
  23. data/features/step_definitions/maven_steps.rb +35 -0
  24. data/features/support/env.rb +8 -0
  25. data/int/it_tools/suite_it_tools.rb +2 -0
  26. data/int/it_tools/test_integ1.rb +17 -0
  27. data/lib/beta_tools/version.rb +3 -0
  28. data/lib/beta_tools.rb +5 -0
  29. data/lib/it_tools/calc.rb +14 -0
  30. data/lib/it_tools/config.ru +2 -0
  31. data/lib/it_tools/environment.rb +86 -0
  32. data/lib/it_tools/git.rb +3 -0
  33. data/lib/it_tools/html_publish.rb +287 -0
  34. data/lib/it_tools/mail.rb +21 -0
  35. data/lib/it_tools/maven.rb +101 -0
  36. data/lib/it_tools/md5.rb +4 -0
  37. data/lib/it_tools/multipart.rb +78 -0
  38. data/lib/it_tools/network_tools.rb +72 -0
  39. data/lib/it_tools/options.rb +46 -0
  40. data/lib/it_tools/pub_driver.rb +188 -0
  41. data/lib/it_tools/publisher2.rb +232 -0
  42. data/lib/it_tools/sample.rb +9 -0
  43. data/lib/it_tools/shared.rb +22 -0
  44. data/lib/it_tools/solr.rb +157 -0
  45. data/lib/it_tools/views/search_results.erb +16 -0
  46. data/log/thin.log +177 -0
  47. data/spec/it_tools/deploy_spec.rb +20 -0
  48. data/spec/spec_helper.rb +0 -0
  49. data/test/bin/test_pub.rb +30 -0
  50. data/test/cleaner.rb +6 -0
  51. data/test/driver.rb +24 -0
  52. data/test/integration/tp.rb +107 -0
  53. data/test/it_tools/for_debugger.rb +4 -0
  54. data/test/it_tools/publisher2.rb +13 -0
  55. data/test/it_tools/suite_it_tools.rb +6 -0
  56. data/test/it_tools/suite_it_tools.rb~ +13 -0
  57. data/test/it_tools/test_deploy.rb +83 -0
  58. data/test/it_tools/test_html_publish.rb +54 -0
  59. data/test/it_tools/test_maven.rb +31 -0
  60. data/test/it_tools/test_multipart.rb +31 -0
  61. data/test/it_tools/test_network_tools.rb +14 -0
  62. data/test/it_tools/test_publisher2.rb +42 -0
  63. data/test/it_tools/test_publisher2_support.rb +16 -0
  64. data/test/it_tools/test_sample.rb +10 -0
  65. data/test/it_tools/test_shared.rb +36 -0
  66. data/test/it_tools/test_solr.rb +22 -0
  67. data/test/it_tools/test_solr2.rb +22 -0
  68. data/testdata/assembly_pom.xml +157 -0
  69. data/testdata/desir.txt +39 -0
  70. data/testdata/ear_pom.xml +82 -0
  71. data/testdata/java.html +524 -0
  72. data/testdata/pom.xml +174 -0
  73. data/testdata/publish/src_dir/#arch.mmd# +0 -0
  74. data/testdata/publish/src_dir/ajax-loader.gif +0 -0
  75. data/testdata/publish/src_dir/file1.mmd +5 -0
  76. data/testdata/publish/src_dir/file2.mmd +3 -0
  77. data/testdata/publish/src_dir/file3.abc +0 -0
  78. data/testdata/publish/src_dir/file4.mmd +3 -0
  79. data/testdata/publish/src_dir/help.png +0 -0
  80. data/testdata/publish/src_dir/images/linux.jpeg +0 -0
  81. data/testdata/publish/src_dir/inputStyles.css +0 -0
  82. data/testdata/publish/src_dir/search.html +0 -0
  83. data/testdata/publish/src_dir/search.js +0 -0
  84. data/testdata/publish/target_dir/.@arch.html +0 -0
  85. data/testdata/publish/target_dir/file1.html +7 -0
  86. data/testdata/publish/target_dir/file2.html +5 -0
  87. data/testdata/publish/target_dir/search.js +0 -0
  88. data/testdata/publish/target_dir_static/.@arch.html +1 -0
  89. data/testdata/publish/target_dir_static/file1.html +7 -0
  90. data/testdata/publish/target_dir_static/index.html +1 -0
  91. data/testdata/publish/target_dir_static/style.css +61 -0
  92. data/testdata/ruby.mmd +404 -0
  93. data/testdata/simple.mmd +3 -0
  94. data/testdata/simple.xml +3 -0
  95. data/testdata/small.txt +2 -0
  96. data/testdata/utf8_chars.txt +1 -0
  97. metadata +338 -0
@@ -0,0 +1,42 @@
1
+ require 'fileutils'
2
+ require "test/unit"
3
+ require_relative "../../lib/it_tools/publisher2"
4
+ require_relative 'test_publisher2_support'
5
+
6
+ class TestPublisher2 < Test::Unit::TestCase
7
+ def setup
8
+ ps = PublisherSupport.new
9
+ ps.before
10
+ end
11
+ def teardown
12
+ ps = PublisherSupport.new
13
+ ps.after
14
+ end
15
+ def test_which_files_have_changed_since_last_publish
16
+ src_dir = 'testdata/src_dir'
17
+ target_dir = 'testdata/target_dir'
18
+ publisher = Publisher::Markdown.new
19
+ FileUtils.touch 'testdata/src_dir/file1.mmd'
20
+ newer_files = publisher.get_newer_src_files( src_dir, target_dir, publisher.is_markdown_file, publisher.convert_to_html_filename)
21
+ should_be = ["/home/fenton/projects/beta_tools/testdata/src_dir/file4.mmd",
22
+ "/home/fenton/projects/beta_tools/testdata/src_dir/file1.mmd"]
23
+ assert_equal should_be,newer_files
24
+ end
25
+ def test_convert_mmd_files
26
+ src_dir = 'testdata/src_dir'
27
+ target_dir = 'testdata/target_dir'
28
+ publisher = Publisher::Markdown.new
29
+ newer_files = publisher.get_newer_src_files( src_dir, target_dir, publisher.is_markdown_file, publisher.convert_to_html_filename)
30
+ should_be = ["file1.mmd"]
31
+ converted_files = publisher.convert_mmd_files(newer_files,target_dir)
32
+ end
33
+ def test_copy_images
34
+ src_dir = 'testdata/src_dir/images'
35
+ target_dir = 'testdata/target_dir/images'
36
+ publisher = Publisher::Markdown.new
37
+ newer_files = publisher.get_newer_src_files src_dir, target_dir
38
+ should_be = ["/home/fenton/projects/beta_tools/testdata/src_dir/images/linux.jpeg"]
39
+ assert_equal should_be,newer_files
40
+ end
41
+ end
42
+
@@ -0,0 +1,16 @@
1
+ class PublisherSupport
2
+ def before src_dir
3
+ FileUtils.touch (File.join src_dir, 'file1.mmd')
4
+ end
5
+ def after dirs
6
+ img_lin = File.join('images','linux.jpeg')
7
+ files_to_delete = [ img_lin ,'images', 'file4.html', 'ajax-loader.gif', 'help.png', 'search.html' ]
8
+ dirs.each do |dir|
9
+ files_to_delete.each do |file|
10
+ delf = File.join dir,file
11
+ FileUtils.rm_rf delf
12
+ end
13
+ end
14
+ end
15
+ end
16
+
@@ -0,0 +1,10 @@
1
+ require "test/unit"
2
+ require_relative "../../lib/it_tools/sample"
3
+
4
+ class TestSample < Test::Unit::TestCase
5
+
6
+ def test_lambda
7
+ sam = Sample.new
8
+ sam.func1
9
+ end
10
+ end
@@ -0,0 +1,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "test/unit"
3
+ require 'pathname'
4
+ libpath = Pathname.new(
5
+ File.join(File.dirname(__FILE__), [".."]*2, "lib")
6
+ ).cleanpath.to_s
7
+ $:.unshift(libpath) unless $:.include?(libpath)
8
+
9
+ require "it_tools/shared"
10
+
11
+ module TestSharedTool
12
+ class TestRegularExpression < Test::Unit::TestCase
13
+ $debug = 0
14
+ $re = SharedTool::RegularExpression.new "testdata/pom.xml"
15
+ def test_first_occurence
16
+ regex = /<version>(.*)-SNAPSHOT<\/version>/
17
+ version = $re.first_occurrence( regex)
18
+ assert_equal("0.9.1", version)
19
+ end
20
+ end
21
+ end
22
+
23
+ class TestString < Test::Unit::TestCase
24
+ def test_remove_non_ascii_1
25
+ file = File.open "testdata/utf8_chars.txt"
26
+ contents = file.read
27
+ assert_equal("Oracle® Data\n", contents)
28
+ contents = contents.remove_non_ascii
29
+ assert_equal("Oracle Data\n",contents)
30
+ end
31
+ def test_remove_non_ascii_2
32
+ file = File.open "testdata/ruby.mmd"
33
+ contents = file.read
34
+ contents = contents.remove_non_ascii
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ require "test/unit"
2
+ require_relative "../../lib/it_tools/solr"
3
+
4
+ module TestSolr
5
+ class TestUpload < Test::Unit::TestCase
6
+ def test_upload_file
7
+ filename = "java.html"
8
+ contents = File.open("testdata/" + filename).read
9
+ file_id = filename
10
+ solr_base_url = "http://127.0.0.1:8983/solr/"
11
+ solr_uploader = Solr::Upload.new :solr_base_url => solr_base_url
12
+ solr_uploader.upload_file(filename, contents, file_id)
13
+ end
14
+ end
15
+ class TestQuery < Test::Unit::TestCase
16
+ query = Solr::Query.new
17
+ params = { "query" => "web" }
18
+ resp = query.do_query params
19
+ p resp
20
+ end
21
+ end
22
+
@@ -0,0 +1,22 @@
1
+ require "test/unit"
2
+ require_relative "../../lib/it_tools/solr"
3
+
4
+ # args = {
5
+ # :solr_host => "searcher",
6
+ # :solr_port => "8983" }
7
+ # query = Solr::Query.new args
8
+ # params = {
9
+ # "query" => "arch",
10
+ # "category" => "public" }
11
+ # resp = query.do_query params
12
+ # p resp
13
+
14
+ handler = Handler.new
15
+ params = {
16
+ "query" => "arch",
17
+ "category" => "public",
18
+ :solr_host => "searcher",
19
+ :solr_port => "8983" }
20
+
21
+ resp = handler.get_srch params
22
+ p resp
@@ -0,0 +1,157 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
+ <modelVersion>4.0.0</modelVersion>
3
+ <groupId>com.oracle</groupId>
4
+ <artifactId>hrmsToCrmodUserDataIntegration</artifactId>
5
+ <packaging>jar</packaging>
6
+ <version>0.0.91-SNAPSHOT</version>
7
+ <name>${project.artifactId}</name>
8
+ <properties>
9
+ <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
10
+ <maven.test.skip>true</maven.test.skip>
11
+ <log.level>info</log.level>
12
+ <crmod.protocol>https</crmod.protocol>
13
+ <crmod.port>443</crmod.port>
14
+ <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
15
+ <tablename.pnlocationsall>MISSECURE.PN_ADDRESSES_ALL</tablename.pnlocationsall>
16
+ <crmod.useOsso>true</crmod.useOsso>
17
+ </properties>
18
+ <parent>
19
+ <groupId>com.oracle.git.ngsp</groupId>
20
+ <artifactId>ngspParent</artifactId>
21
+ <version>0.2.1-SNAPSHOT</version>
22
+ <relativePath>../ngspParent/pom.xml</relativePath>
23
+ </parent>
24
+ <repositories>
25
+ <repository>
26
+ <id>linux1</id>
27
+ <url>http://linux1.hk.oracle.com/maven2/</url>
28
+ </repository>
29
+ </repositories>
30
+ <scm>
31
+ <developerConnection>scm:git:ssh://git@linux1.hk.oracle.com/CRMOD_WS_Writer.git</developerConnection>
32
+ <connection>scm:git:ssh://git@linux1.hk.oracle.com/CRMOD_WS_Writer.git</connection>
33
+ </scm>
34
+ <distributionManagement>
35
+ <downloadUrl>http://linux1.hk.oracle.com/maven2/com/oracle/git/ngsp/autosr2/${project.artifactId}/${project.version}
36
+ </downloadUrl>
37
+ <site>
38
+ <name>${project.name}</name>
39
+ <id>linux1</id>
40
+ <url>scpexe://linux1.hk.oracle.com/var/www/html/${project.artifactId}</url>
41
+ </site>
42
+ </distributionManagement>
43
+ <build>
44
+ <finalName>${project.artifactId}</finalName>
45
+ <pluginManagement>
46
+ <plugins>
47
+ <plugin>
48
+ <artifactId>maven-assembly-plugin</artifactId>
49
+ <version>2.2-beta-5</version>
50
+ <configuration>
51
+ <descriptorRefs>
52
+ <descriptorRef>jar-with-dependencies</descriptorRef>
53
+ </descriptorRefs>
54
+ <archive>
55
+ <manifest>
56
+ <mainClass>com.oracle.ngsp.controller.Controller</mainClass>
57
+ </manifest>
58
+ </archive>
59
+ </configuration>
60
+ <executions>
61
+ <execution>
62
+ <id>make-my-jar-with-dependencies</id>
63
+ <phase>package</phase>
64
+ <goals>
65
+ <goal>single</goal>
66
+ </goals>
67
+ </execution>
68
+ </executions>
69
+ </plugin>
70
+ </plugins>
71
+ </pluginManagement>
72
+ <resources>
73
+ <resource>
74
+ <directory>src/main/resources</directory>
75
+ <filtering>true</filtering>
76
+ </resource>
77
+ </resources>
78
+ <testResources>
79
+ <testResource>
80
+ <directory>src/test/resources</directory>
81
+ <filtering>true</filtering>
82
+ </testResource>
83
+ </testResources>
84
+ </build>
85
+ <profiles>
86
+ <profile>
87
+ <id>locdev</id>
88
+ <properties>
89
+ <crmod.useOsso>true</crmod.useOsso>
90
+ <log.level>info</log.level>
91
+ <tablename.pnlocationsall>pn_locations_all_mv</tablename.pnlocationsall>
92
+ </properties>
93
+ </profile>
94
+ <profile>
95
+ <id>dev</id>
96
+ <properties>
97
+ <crmod.useOsso>true</crmod.useOsso>
98
+ <log.level>trace</log.level>
99
+ <tablename.pnlocationsall>pn_locations_all_mv</tablename.pnlocationsall>
100
+ </properties>
101
+ </profile>
102
+ <profile>
103
+ <id>stage</id>
104
+ <properties>
105
+ <crmod.useOsso>true</crmod.useOsso>
106
+ <log.level>debug</log.level>
107
+ <tablename.pnlocationsall>pn_locations_all_mv</tablename.pnlocationsall>
108
+ </properties>
109
+ </profile>
110
+ <profile>
111
+ <id>prod</id>
112
+ <properties>
113
+ <crmod.useOsso>true</crmod.useOsso>
114
+ <log.level>OFF</log.level>
115
+ <tablename.pnlocationsall>MISSECURE.PN_ADDRESSES_ALL</tablename.pnlocationsall>
116
+ </properties>
117
+ </profile>
118
+ </profiles>
119
+ <dependencies>
120
+ <dependency>
121
+ <groupId>com.oracle.ngsp</groupId>
122
+ <artifactId>crmod-ws-wrapper</artifactId>
123
+ <version>0.9.0-SNAPSHOT</version>
124
+ </dependency>
125
+ <dependency>
126
+ <groupId>commons-httpclient</groupId>
127
+ <artifactId>commons-httpclient</artifactId>
128
+ <version>3.1</version>
129
+ </dependency>
130
+ <dependency>
131
+ <groupId>log4j</groupId>
132
+ <artifactId>log4j</artifactId>
133
+ <version>1.2.12</version>
134
+ </dependency>
135
+ <dependency>
136
+ <groupId>com.oracle.database</groupId>
137
+ <artifactId>ojdbc</artifactId>
138
+ <version>db11gR2java16</version>
139
+ </dependency>
140
+ <dependency>
141
+ <groupId>javax.mail</groupId>
142
+ <artifactId>mail</artifactId>
143
+ <version>1.4.1</version>
144
+ </dependency>
145
+ <dependency>
146
+ <groupId>javax.servlet</groupId>
147
+ <artifactId>servlet-api</artifactId>
148
+ <version>2.4</version>
149
+ <scope>provided</scope>
150
+ </dependency>
151
+ <dependency>
152
+ <groupId>org.springframework</groupId>
153
+ <artifactId>spring-core</artifactId>
154
+ <version>${org.springframework.version}</version>
155
+ </dependency>
156
+ </dependencies>
157
+ </project>
@@ -0,0 +1,39 @@
1
+ Go placidly amid the noise and the haste, and remember what peace
2
+ there may be in silence. As far as possible without surrender be on
3
+ good terms with all persons. Speak your truth quietly and clearly; and
4
+ listen to others, even to the dull and the ignorant, they too have
5
+ their story. Avoid loud and aggressive persons, they are vexations to
6
+ the spirit.
7
+
8
+
9
+ If you compare yourself with others, you may become vain or bitter;
10
+ for always there will be greater and lesser persons than
11
+ yourself. Enjoy your achievements as well as your plans. Keep
12
+ interested in your own career, however humble; it is a real possession
13
+ in the changing fortunes of time.
14
+
15
+
16
+ Exercise caution in your business affairs, for the world is full of
17
+ trickery. But let not this blind you to what virtue there is; many
18
+ persons strive for high ideals, and everywhere life is full of
19
+ heroism. Be yourself. Especially do not feign affection. Neither be
20
+ cynical about love; for in the face of all aridity and disenchantment
21
+ it is as perennial as the grass. Take kindly the counsel of the years,
22
+ gracefully surrendering the things of youth.
23
+
24
+
25
+ Nurture strength of spirit to shield you in sudden misfortune. But do
26
+ not distress yourself with dark imaginings. Many fears are born of
27
+ fatigue and loneliness. Beyond a wholesome discipline, be gentle with
28
+ yourself. You are a child of the universe, no less than the trees and
29
+ the stars; you have a right to be here. And whether or not it is clear
30
+ to you, no doubt the universe is unfolding as it should.
31
+
32
+
33
+ Therefore, be at peace with God, whatever you conceive Him to be. And
34
+ whatever your labors and aspirations in the noisy confusion of life,
35
+ keep peace in your soul. With all its sham, drudgery and broken
36
+ dreams; it is still a beautiful world. Be cheerful.
37
+
38
+
39
+ Strive to be happy.
@@ -0,0 +1,82 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>com.oracle.git.ngsp.autosr</groupId>
5
+ <artifactId>autoSR2-EAR</artifactId>
6
+ <packaging>ear</packaging>
7
+ <name>${project.artifactId}</name>
8
+ <version>0.3.1-SNAPSHOT</version>
9
+
10
+ <properties>
11
+ <autoSR2Version>0.5.57-SNAPSHOT</autoSR2Version>
12
+ <autoSR2>autoSR2</autoSR2>
13
+ </properties>
14
+ <dependencies>
15
+ <dependency>
16
+ <groupId>com.oracle.git.ngsp.autosr2</groupId>
17
+ <artifactId>${autoSR2}</artifactId>
18
+ <version>${autoSR2Version}</version>
19
+ <type>war</type>
20
+ </dependency>
21
+ </dependencies>
22
+
23
+ <build>
24
+ <finalName>${project.artifactId}</finalName>
25
+ <extensions>
26
+ <extension>
27
+ <groupId>org.apache.maven.wagon</groupId>
28
+ <artifactId>wagon-ssh-external</artifactId>
29
+ <version>1.0-beta-6</version>
30
+ </extension>
31
+ </extensions>
32
+ <plugins>
33
+ <plugin>
34
+ <artifactId>maven-ear-plugin</artifactId>
35
+ <version>2.5</version>
36
+ <configuration>
37
+ <archive>
38
+ <manifestEntries>
39
+ <Weblogic-Application-Version>${version}</Weblogic-Application-Version>
40
+ </manifestEntries>
41
+ </archive>
42
+ <modules>
43
+ <webModule>
44
+ <groupId>com.oracle.git.ngsp.autosr2</groupId>
45
+ <artifactId>${autoSR2}</artifactId>
46
+ <bundleFileName>${autoSR2}-${autoSR2Version}.war</bundleFileName>
47
+ <contextRoot>/${autoSR2}</contextRoot>
48
+ </webModule>
49
+ </modules>
50
+ <displayName>${autoSR2}</displayName>
51
+ <generateApplicationXml>true</generateApplicationXml>
52
+ </configuration>
53
+ </plugin>
54
+ </plugins>
55
+ </build>
56
+ <parent>
57
+ <groupId>com.oracle.git.ngsp</groupId>
58
+ <artifactId>ngspParent</artifactId>
59
+ <version>0.2.1-SNAPSHOT</version>
60
+ <relativePath>../ngspParent/pom.xml</relativePath>
61
+ </parent>
62
+ <url>http://linux1.hk.oracle.com/${project.artifactId}/</url>
63
+ <repositories>
64
+ <repository>
65
+ <id>linux1</id>
66
+ <url>http://linux1.hk.oracle.com/maven2/</url>
67
+ </repository>
68
+ </repositories>
69
+ <scm>
70
+ <developerConnection>scm:git:ssh://git@linux1.hk.oracle.com/autoSR2-EAR.git</developerConnection>
71
+ <connection>scm:git:ssh://git@linux1.hk.oracle.com/autoSR2-EAR.git</connection>
72
+ </scm>
73
+ <distributionManagement>
74
+ <downloadUrl>http://linux1.hk.oracle.com/maven2/${project.groupId}/${project.artifactId}/${project.version}
75
+ </downloadUrl>
76
+ <site>
77
+ <name>${project.name}</name>
78
+ <id>linux1</id>
79
+ <url>scpexe://linux1.hk.oracle.com/var/www/html/${project.artifactId}</url>
80
+ </site>
81
+ </distributionManagement>
82
+ </project>