-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFix-for-problem-of-application-picking-up-wrong-post.patch
executable file
·233 lines (224 loc) · 10.4 KB
/
Fix-for-problem-of-application-picking-up-wrong-post.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
From b9d5c93a44bd9b7b86ecd69e29504bf6f76d9b84 Mon Sep 17 00:00:00 2001
From: Ashok <[email protected]>
Date: Wed, 8 May 2013 17:50:44 +0530
Subject: [PATCH] Fix for problem of application picking up wrong postgres
properties and trying to access localhost.
---
ananya-reports-config/pom.xml | 13 ++++++++
.../src/main/resources/ananya_reports.properties | 5 ---
.../src/main/resources/log4j.properties | 32 --------------------
.../src/main/resources/postgres.properties | 5 ---
.../src/test/resources/ananya_reports.properties | 5 +++
.../src/test/resources/log4j.properties | 32 ++++++++++++++++++++
.../src/test/resources/postgres.properties | 5 +++
ananya-reports-domain/pom.xml | 1 +
.../resources/applicationKilkariReportsContext.xml | 4 +--
ananya-reports-purge/pom.xml | 2 ++
ananya-reports-web/pom.xml | 2 +-
11 files changed, 61 insertions(+), 45 deletions(-)
delete mode 100644 ananya-reports-config/src/main/resources/ananya_reports.properties
delete mode 100644 ananya-reports-config/src/main/resources/log4j.properties
delete mode 100644 ananya-reports-config/src/main/resources/postgres.properties
create mode 100644 ananya-reports-config/src/test/resources/ananya_reports.properties
create mode 100644 ananya-reports-config/src/test/resources/log4j.properties
create mode 100644 ananya-reports-config/src/test/resources/postgres.properties
diff --git a/ananya-reports-config/pom.xml b/ananya-reports-config/pom.xml
index 6b1b2f0..b9f2e5e 100644
--- a/ananya-reports-config/pom.xml
+++ b/ananya-reports-config/pom.xml
@@ -14,6 +14,19 @@
<build>
<finalName>ananya-reports-config</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
<dependencies>
diff --git a/ananya-reports-config/src/main/resources/ananya_reports.properties b/ananya-reports-config/src/main/resources/ananya_reports.properties
deleted file mode 100644
index 8d38f4d..0000000
--- a/ananya-reports-config/src/main/resources/ananya_reports.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#ananya-report:hibernate-settings
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
-hibernate.show_sql=false
-hibernate.format_sql=false
-hibernate.default_schema=report
\ No newline at end of file
diff --git a/ananya-reports-config/src/main/resources/log4j.properties b/ananya-reports-config/src/main/resources/log4j.properties
deleted file mode 100644
index ae96ad3..0000000
--- a/ananya-reports-config/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.RollingFileAppender
-log4j.appender.file.File=ananya-reports.log
-log4j.appender.file.MaxFileSize=4MB
-log4j.appender.file.MaxBackupIndex=10
-log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout
-log4j.appender.file.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
-
-log4j.appender.email=org.motechproject.web.logger.EmailAppender
-log4j.appender.email.SMTPHost=gmail-smtp-in.l.google.com
-log4j.appender.email.Subject=Ananya Kilkari Report Error
-log4j.appender.email.BufferSize=5
-log4j.appender.email.layout=org.apache.log4j.EnhancedPatternLayout
-log4j.appender.email.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
-log4j.appender.email.Threshold=ERROR
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.EnhancedPatternLayout
-log4j.appender.console.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
-
-log4j.logger.org.springframework=ERROR, file, console
-log4j.logger.org.apache=ERROR, file, console
-log4j.logger.org.hibernate=ERROR,file,console
-
-#Switch the following logger to Debug to log requests and responses
-log4j.logger.RequestResponseLogger=INFO
-
-#Swithch the following logger to DEBUG for report logs
-log4j.logger.org.motechproject.ananya.reports=INFO
\ No newline at end of file
diff --git a/ananya-reports-config/src/main/resources/postgres.properties b/ananya-reports-config/src/main/resources/postgres.properties
deleted file mode 100644
index 3760c77..0000000
--- a/ananya-reports-config/src/main/resources/postgres.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#ananya-report:jdbc Settings
-jdbc.driverClassName=org.postgresql.Driver
-jdbc.username=postgres
-jdbc.password=password
-jdbc.url=jdbc:postgresql://localhost/ananya_kilkari/
\ No newline at end of file
diff --git a/ananya-reports-config/src/test/resources/ananya_reports.properties b/ananya-reports-config/src/test/resources/ananya_reports.properties
new file mode 100644
index 0000000..8d38f4d
--- /dev/null
+++ b/ananya-reports-config/src/test/resources/ananya_reports.properties
@@ -0,0 +1,5 @@
+#ananya-report:hibernate-settings
+hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+hibernate.show_sql=false
+hibernate.format_sql=false
+hibernate.default_schema=report
\ No newline at end of file
diff --git a/ananya-reports-config/src/test/resources/log4j.properties b/ananya-reports-config/src/test/resources/log4j.properties
new file mode 100644
index 0000000..ae96ad3
--- /dev/null
+++ b/ananya-reports-config/src/test/resources/log4j.properties
@@ -0,0 +1,32 @@
+log4j.rootLogger=DEBUG, file, console
+
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=ananya-reports.log
+log4j.appender.file.MaxFileSize=4MB
+log4j.appender.file.MaxBackupIndex=10
+log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout
+log4j.appender.file.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
+
+log4j.appender.email=org.motechproject.web.logger.EmailAppender
+log4j.appender.email.SMTPHost=gmail-smtp-in.l.google.com
+log4j.appender.email.Subject=Ananya Kilkari Report Error
+log4j.appender.email.BufferSize=5
+log4j.appender.email.layout=org.apache.log4j.EnhancedPatternLayout
+log4j.appender.email.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
+log4j.appender.email.Threshold=ERROR
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.EnhancedPatternLayout
+log4j.appender.console.layout.ConversionPattern=[%t] - %d %p [%c] - %m%n
+
+log4j.logger.org.springframework=ERROR, file, console
+log4j.logger.org.apache=ERROR, file, console
+log4j.logger.org.hibernate=ERROR,file,console
+
+#Switch the following logger to Debug to log requests and responses
+log4j.logger.RequestResponseLogger=INFO
+
+#Swithch the following logger to DEBUG for report logs
+log4j.logger.org.motechproject.ananya.reports=INFO
\ No newline at end of file
diff --git a/ananya-reports-config/src/test/resources/postgres.properties b/ananya-reports-config/src/test/resources/postgres.properties
new file mode 100644
index 0000000..3760c77
--- /dev/null
+++ b/ananya-reports-config/src/test/resources/postgres.properties
@@ -0,0 +1,5 @@
+#ananya-report:jdbc Settings
+jdbc.driverClassName=org.postgresql.Driver
+jdbc.username=postgres
+jdbc.password=password
+jdbc.url=jdbc:postgresql://localhost/ananya_kilkari/
\ No newline at end of file
diff --git a/ananya-reports-domain/pom.xml b/ananya-reports-domain/pom.xml
index 111c60e..9580ca4 100644
--- a/ananya-reports-domain/pom.xml
+++ b/ananya-reports-domain/pom.xml
@@ -28,6 +28,7 @@
<artifactId>ananya-reports-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
+ <classifier>tests</classifier>
</dependency>
<dependency>
diff --git a/ananya-reports-domain/src/main/resources/applicationKilkariReportsContext.xml b/ananya-reports-domain/src/main/resources/applicationKilkariReportsContext.xml
index 631df48..3d90163 100644
--- a/ananya-reports-domain/src/main/resources/applicationKilkariReportsContext.xml
+++ b/ananya-reports-domain/src/main/resources/applicationKilkariReportsContext.xml
@@ -5,8 +5,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
- <context:property-placeholder location="classpath*:ananya_reports.properties" ignore-unresolvable="true"/>
- <context:property-placeholder location="classpath*:postgres.properties" ignore-unresolvable="true"/>
+ <context:property-placeholder location="classpath:ananya_reports.properties" ignore-unresolvable="true"/>
+ <context:property-placeholder location="classpath:postgres.properties" ignore-unresolvable="true"/>
<context:component-scan base-package="org.motechproject.ananya.reports"/>
diff --git a/ananya-reports-purge/pom.xml b/ananya-reports-purge/pom.xml
index 45b0ffe..292dccb 100644
--- a/ananya-reports-purge/pom.xml
+++ b/ananya-reports-purge/pom.xml
@@ -21,6 +21,8 @@
<groupId>org.motechproject.ananya.reports</groupId>
<artifactId>ananya-reports-config</artifactId>
<version>${project.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
</dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/ananya-reports-web/pom.xml b/ananya-reports-web/pom.xml
index 45d5951..0657b17 100644
--- a/ananya-reports-web/pom.xml
+++ b/ananya-reports-web/pom.xml
@@ -116,7 +116,7 @@
<configuration>
<target>
<copy todir="${project.build.outputDirectory}">
- <fileset dir="${project.basedir}/../ananya-reports-config/src/main/resources">
+ <fileset dir="${project.basedir}/../ananya-reports-config/src/test/resources">
<include name="*.properties"/>
</fileset>
</copy>
--
1.7.10