winter 0.0.1

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.
data/spec/cli_spec.rb ADDED
@@ -0,0 +1,102 @@
1
+ # Copyright 2013 LiveOps, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
4
+ # use this file except in compliance with the License. You may obtain a copy
5
+ # of the License at:
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+ # License for the specific language governing permissions and limitations
13
+ # under the License.
14
+
15
+ require 'simplecov'
16
+ SimpleCov.start
17
+
18
+ require 'winter'
19
+ require 'winter/cli'
20
+
21
+ describe Winter do
22
+
23
+ describe "Unknown CLI command" do
24
+ it "Doesn't explode" do
25
+ #resp = `bundle exec winter badcommand`
26
+ #puts "*** #{resp}"
27
+ #resp.should == 'Could not find command "badcommand".'
28
+ end
29
+ end
30
+
31
+ describe "validate" do
32
+ it "Reads a local pom file" do
33
+ begin
34
+ lambda {
35
+ cli = Winter::CLI.new
36
+ cli.validate 'spec/sample_data/Winterfile'
37
+ }.should_not raise_error
38
+ end
39
+ end
40
+ end
41
+
42
+ describe 'status' do
43
+ it "Shows the status of any running services" do
44
+ begin
45
+ lambda {
46
+ cli = Winter::CLI.new
47
+ cli.status
48
+ }.should_not raise_error
49
+ end
50
+ end
51
+ end
52
+
53
+ describe 'build [manifest]' do
54
+ it "Build a service from a manifest" do
55
+ begin
56
+ lambda {
57
+ args = ["build", "spec/sample_data/Winterfile"]
58
+ cli = Winter::CLI.start( args )
59
+ }.should_not raise_error
60
+ Dir["run/default/libs"].include? "maven-dependency-plugin-2.5.jar"
61
+ # TODO check that files were downloaded to 'run'
62
+ end
63
+ end
64
+ end
65
+
66
+ describe 'start and stop a service : ' do
67
+ context "start, status and stop " do
68
+ it "Start, status and stop a service" do
69
+ begin
70
+ Dir.chdir (File.split("spec/sample_data/Winterfile")[0]) do
71
+ lambda {
72
+ Winter::CLI.start ["start" , "--debug"]
73
+ Winter::CLI.start ["status"]
74
+ }.should_not raise_error
75
+ #lambda {
76
+ # puts "TRYING STOP"
77
+ # Winter::CLI.start ["stop"]
78
+ #}.should_not raise_error
79
+ end
80
+ end
81
+ end
82
+
83
+ it "View that the service is not running" do
84
+ begin
85
+ lambda {
86
+ cli = Winter::CLI.new
87
+ cli.status
88
+ }.should_not raise_error
89
+ end
90
+ end
91
+
92
+ end
93
+
94
+ after do
95
+ Dir.chdir (File.split("spec/sample_data/Winterfile")[0]) do
96
+ Winter::CLI.start ["stop"]
97
+ end
98
+ end
99
+ end
100
+
101
+
102
+ end
@@ -0,0 +1,30 @@
1
+
2
+ name "default"
3
+
4
+ repo "http://artifactory:8081/artifactory/libs-releases"
5
+ repo "http://artifactory:8081/artifactory/libs-snapshots-local/"
6
+
7
+ read 'conf/default/wf_config.json'
8
+
9
+ #pom 'http://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.bundlerepository/1.6.4/org.apache.felix.bundlerepository-1.6.4.pom'
10
+ pom 'felix.pom'
11
+
12
+ conf 'conf/default'
13
+
14
+ group :dev do
15
+ conf 'conf/dev'
16
+ repo "~/.m2/repository"
17
+ group :cluster1 do
18
+ info "Using --group=dev,dev::cluster1"
19
+ end
20
+ end
21
+
22
+ plugin_version = "2.5"
23
+ lib 'org.apache.maven.plugins', 'maven-dependency-plugin', plugin_version
24
+
25
+ # core deps
26
+ felix 'org.apache.felix', 'org.apache.felix.main', '4.0.2'
27
+ bundle 'org.apache.felix', 'org.apache.felix.fileinstall', '3.2.6'
28
+
29
+ directive 'add.test.directive', 60
30
+
@@ -0,0 +1,51 @@
1
+ # The following property determines which actions are performed when
2
+ # processing the auto-deploy directory. It is a comma-delimited list of
3
+ # the following values: 'install', 'start', 'update', and 'uninstall'.
4
+ # An undefined or blank value is equivalent to disabling auto-deploy
5
+ # processing.
6
+ felix.auto.deploy.action=install,start
7
+
8
+ # The following property specifies the directory to use as the bundle
9
+ # auto-deploy directory; the default is 'bundle' in the working directory.
10
+ #felix.auto.deploy.dir=bundle
11
+
12
+ # The following property is a space-delimited list of bundle URLs
13
+ # to install when the framework starts. The ending numerical component
14
+ # is the target start level. Any number of these properties may be
15
+ # specified for different start levels.
16
+ #felix.auto.install.1=
17
+
18
+ # The following property is a space-delimited list of bundle URLs
19
+ # to install and start when the framework starts. The ending numerical
20
+ # component is the target start level. Any number of these properties
21
+ # may be specified for different start levels.
22
+ #felix.auto.start.1=
23
+
24
+ #log.level : 1-ERROR, 2-WARN, 3-INFO, 4-DEBUG
25
+ felix.log.level=1
26
+ org.osgi.framework.startlevel.beginning=100
27
+
28
+ # Sets the initial start level of the framework upon startup.
29
+ #org.osgi.framework.startlevel.beginning=1
30
+
31
+ # Sets the start level of newly installed bundles.
32
+ #felix.startlevel.bundle=1
33
+
34
+ # Felix installs a stream and content handler factories by default,
35
+ # uncomment the following line to not install them.
36
+ #felix.service.urlhandlers=false
37
+
38
+ # The launcher registers a shutdown hook to cleanly stop the framework
39
+ # by default, uncomment the following line to disable it.
40
+ #felix.shutdown.hook=false
41
+
42
+ #
43
+ # Bundle config properties.
44
+ #
45
+
46
+ org.osgi.service.http.port=${web.port}
47
+ org.osgi.framework.storage.clean=onFirstInit
48
+ osgi.shell.telnet.port=${osgi.port}
49
+ osgi.shell.telnet.maxconn=2
50
+ org.apache.felix.http.jettyEnabled=true
51
+ obr.repository.url=http://felix.apache.org/obr/releases.xml
@@ -0,0 +1,31 @@
1
+
2
+
3
+ ## Log4j Properties ##
4
+
5
+
6
+ # Set root logger level to DEBUG and its only appender to A1.
7
+ log4j.rootLogger=DEBUG, console, file
8
+
9
+
10
+ log4j.appender.console=org.apache.log4j.ConsoleAppender
11
+ log4j.appender.console.threshold=debug
12
+ log4j.appender.console.layout=org.apache.log4j.PatternLayout
13
+ log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
14
+
15
+ log4j.appender.file=org.apache.log4j.RollingFileAppender
16
+ log4j.appender.file.maxFileSize=200MB
17
+ log4j.appender.file.maxBackupIndex=10
18
+ log4j.appender.file.File=${log.dir}/winterfell.log
19
+ log4j.appender.file.threshold=debug
20
+ log4j.appender.file.layout=org.apache.log4j.PatternLayout
21
+ log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
22
+
23
+ log4j.appender.errorfile=org.apache.log4j.RollingFileAppender
24
+ log4j.appender.errorfile.maxFileSize=10MB
25
+ log4j.appender.errorfile.maxBackupIndex=5
26
+ log4j.appender.errorfile.File=${log.dir}/winterfell_error.log
27
+ log4j.appender.errorfile.threshold=error
28
+ log4j.appender.errorfile.layout=org.apache.log4j.PatternLayout
29
+ log4j.appender.errorfile.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
30
+
31
+
@@ -0,0 +1,8 @@
1
+ {
2
+ "64bit" : false,
3
+ "jvm.mx" : "1g",
4
+ "web.port" : 8070,
5
+ "osgi.port" : 6070,
6
+ "jdb.port" : 6071,
7
+ "jmx.port" : 6072
8
+ }
@@ -0,0 +1,398 @@
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
+
4
+ <organization>
5
+ <name>LiveOps</name>
6
+ <url>http://www.liveops.com</url>
7
+ </organization>
8
+
9
+ <scm>
10
+ <url>https://github.liveops.com/${user}/osgi_sample</url>
11
+ <connection>scm:git:git://git@github.liveops.com:${user}/osgi_sample.git</connection>
12
+ <developerConnection>scm:git:git://git@github.liveops.com:${user}/osig_sample.git</developerConnection>
13
+ </scm>
14
+
15
+ <modelVersion>1.0.0</modelVersion>
16
+ <groupId>com.liveops.sample</groupId>
17
+ <artifactId>sample</artifactId>
18
+ <version>1.0.0-SNAPSHOT</version>
19
+
20
+ <name>com.liveops.integration.platform</name>
21
+
22
+ <description>LiveOps Integrations Platform</description>
23
+
24
+ <packaging>pom</packaging>
25
+
26
+ <modules>
27
+ <module>metadata</module>
28
+ <module>sample_bundle</module>
29
+ </modules>
30
+
31
+ <build>
32
+ <plugins>
33
+
34
+ <plugin>
35
+ <artifactId>maven-compiler-plugin</artifactId>
36
+ <version>3.0</version>
37
+ <configuration>
38
+ <source>1.6</source>
39
+ <target>1.6</target>
40
+ </configuration>
41
+ </plugin>
42
+
43
+ <plugin>
44
+ <groupId>org.apache.maven.plugins</groupId>
45
+ <artifactId>maven-source-plugin</artifactId>
46
+ <version>2.2.1</version>
47
+ <executions>
48
+ <execution>
49
+ <goals>
50
+ <goal>jar</goal>
51
+ </goals>
52
+ </execution>
53
+ </executions>
54
+ </plugin>
55
+
56
+ <plugin>
57
+ <groupId>org.apache.felix</groupId>
58
+ <artifactId>maven-scr-plugin</artifactId>
59
+ <version>1.4.4</version>
60
+ <executions>
61
+ <execution>
62
+ <id>generate-scr-scrdescriptor</id>
63
+ <goals>
64
+ <goal>scr</goal>
65
+ </goals>
66
+ </execution>
67
+ </executions>
68
+ </plugin>
69
+
70
+ <plugin>
71
+ <groupId>org.codehaus.mojo</groupId>
72
+ <artifactId>cobertura-maven-plugin</artifactId>
73
+ <version>2.5.1</version>
74
+ <configuration>
75
+ <formats>
76
+ <format>html</format>
77
+ <format>xml</format>
78
+ </formats>
79
+ <check />
80
+ </configuration>
81
+ </plugin>
82
+
83
+ <plugin>
84
+ <groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
85
+ <artifactId>svn-revision-number-maven-plugin</artifactId>
86
+ <version>1.13</version> <!-- please use the latest version -->
87
+ <executions>
88
+ <execution>
89
+ <phase>validate</phase>
90
+ <goals>
91
+ <goal>revision</goal>
92
+ </goals>
93
+ </execution>
94
+ </executions>
95
+ <configuration>
96
+ <entries>
97
+ <entry>
98
+ <prefix>lo.build</prefix>
99
+ </entry>
100
+ </entries>
101
+ </configuration>
102
+ </plugin>
103
+ </plugins>
104
+
105
+ <resources>
106
+ <resource>
107
+ <directory>src/main/resources</directory>
108
+ <filtering>true</filtering>
109
+ <includes>
110
+ <include>**/build_info.properties</include>
111
+ </includes>
112
+ </resource>
113
+ <resource>
114
+ <directory>src/main/resources</directory>
115
+ <filtering>false</filtering>
116
+ <excludes>
117
+ <exclude>**/build_info.properties</exclude>
118
+ </excludes>
119
+ </resource>
120
+ </resources>
121
+
122
+ </build>
123
+
124
+ <reporting>
125
+ <plugins>
126
+ <plugin>
127
+ <groupId>org.codehaus.mojo</groupId>
128
+ <artifactId>surefire-report-maven-plugin</artifactId>
129
+ <version>2.0-beta-1</version>
130
+ <inherited>true</inherited>
131
+ </plugin>
132
+ <plugin>
133
+ <groupId>org.apache.maven.plugins</groupId>
134
+ <artifactId>maven-javadoc-plugin</artifactId>
135
+ <version>2.6.1</version>
136
+ </plugin>
137
+ </plugins>
138
+ </reporting>
139
+
140
+ <dependencies>
141
+ <dependency>
142
+ <groupId>org.osgi</groupId>
143
+ <artifactId>org.osgi.core</artifactId>
144
+ <version>4.3.0</version>
145
+ <scope>provided</scope>
146
+ </dependency>
147
+ <dependency>
148
+ <groupId>org.osgi</groupId>
149
+ <artifactId>org.osgi.compendium</artifactId>
150
+ <version>4.3.0</version>
151
+ <scope>provided</scope>
152
+ </dependency>
153
+ <dependency>
154
+ <groupId>junit</groupId>
155
+ <artifactId>junit</artifactId>
156
+ <version>4.10</version>
157
+ <scope>test</scope>
158
+ </dependency>
159
+ <dependency>
160
+ <groupId>org.powermock</groupId>
161
+ <artifactId>powermock-module-junit4</artifactId>
162
+ <version>1.4.12</version>
163
+ <scope>test</scope>
164
+ </dependency>
165
+ <dependency>
166
+ <groupId>org.powermock</groupId>
167
+ <artifactId>powermock-api-easymock</artifactId>
168
+ <version>1.4.12</version>
169
+ <scope>test</scope>
170
+ </dependency>
171
+ <dependency>
172
+ <groupId>org.easymock</groupId>
173
+ <artifactId>easymock</artifactId>
174
+ <version>3.1</version>
175
+ <scope>test</scope>
176
+ </dependency>
177
+ <dependency>
178
+ <groupId>cglib</groupId>
179
+ <artifactId>cglib-nodep</artifactId>
180
+ <version>2.2</version>
181
+ <scope>test</scope>
182
+ </dependency>
183
+ <dependency>
184
+ <groupId>org.objenesis</groupId>
185
+ <artifactId>objenesis</artifactId>
186
+ <version>1.2</version>
187
+ <scope>test</scope>
188
+ </dependency>
189
+ <dependency>
190
+ <groupId>javassist</groupId>
191
+ <artifactId>javassist</artifactId>
192
+ <version>3.8.0.GA</version>
193
+ <scope>test</scope>
194
+ </dependency>
195
+ </dependencies>
196
+
197
+ <dependencyManagement>
198
+ <dependencies>
199
+ <dependency>
200
+ <groupId>com.liveops.integration</groupId>
201
+ <artifactId>apiservicemanager</artifactId>
202
+ <version>${project.version}</version>
203
+ <scope>provided</scope>
204
+ </dependency>
205
+ <dependency>
206
+ <groupId>com.liveops.integration</groupId>
207
+ <artifactId>bundleconfig</artifactId>
208
+ <version>${project.version}</version>
209
+ <scope>provided</scope>
210
+ </dependency>
211
+ <dependency>
212
+ <groupId>com.liveops.integration</groupId>
213
+ <artifactId>callback</artifactId>
214
+ <version>${project.version}</version>
215
+ <scope>provided</scope>
216
+ </dependency>
217
+ <dependency>
218
+ <groupId>com.liveops.integration</groupId>
219
+ <artifactId>callcenterpipe</artifactId>
220
+ <version>${project.version}</version>
221
+ <scope>provided</scope>
222
+ </dependency>
223
+ <dependency>
224
+ <groupId>com.liveops.integration</groupId>
225
+ <artifactId>config</artifactId>
226
+ <version>${project.version}</version>
227
+ <scope>provided</scope>
228
+ </dependency>
229
+ <dependency>
230
+ <groupId>com.liveops.integration</groupId>
231
+ <artifactId>data</artifactId>
232
+ <version>${project.version}</version>
233
+ <scope>provided</scope>
234
+ </dependency>
235
+ <dependency>
236
+ <groupId>com.liveops.integration</groupId>
237
+ <artifactId>dsm</artifactId>
238
+ <version>${project.version}</version>
239
+ <scope>provided</scope>
240
+ </dependency>
241
+ <dependency>
242
+ <groupId>com.liveops.integration</groupId>
243
+ <artifactId>gnostic</artifactId>
244
+ <version>${project.version}</version>
245
+ <scope>provided</scope>
246
+ </dependency>
247
+ <dependency>
248
+ <groupId>com.liveops.integration</groupId>
249
+ <artifactId>jobscheduler</artifactId>
250
+ <version>${project.version}</version>
251
+ <scope>provided</scope>
252
+ </dependency>
253
+ <dependency>
254
+ <groupId>com.liveops.integration</groupId>
255
+ <artifactId>logger</artifactId>
256
+ <version>${project.version}</version>
257
+ <scope>provided</scope>
258
+ </dependency>
259
+ <dependency>
260
+ <groupId>com.liveops.integration</groupId>
261
+ <artifactId>measureperf</artifactId>
262
+ <version>${project.version}</version>
263
+ <scope>provided</scope>
264
+ </dependency>
265
+ <dependency>
266
+ <groupId>com.liveops.integration</groupId>
267
+ <artifactId>mrlogger</artifactId>
268
+ <version>${project.version}</version>
269
+ <scope>provided</scope>
270
+ </dependency>
271
+ <dependency>
272
+ <groupId>com.liveops.integration</groupId>
273
+ <artifactId>platform_api</artifactId>
274
+ <version>${project.version}</version>
275
+ <scope>provided</scope>
276
+ </dependency>
277
+ <dependency>
278
+ <groupId>com.liveops.integration</groupId>
279
+ <artifactId>presence</artifactId>
280
+ <version>${project.version}</version>
281
+ <scope>provided</scope>
282
+ </dependency>
283
+ <dependency>
284
+ <groupId>com.liveops.integration.platform</groupId>
285
+ <artifactId>resourceid</artifactId>
286
+ <version>${project.version}</version>
287
+ <scope>provided</scope>
288
+ </dependency>
289
+ <dependency>
290
+ <groupId>com.liveops.integration</groupId>
291
+ <artifactId>security</artifactId>
292
+ <version>${project.version}</version>
293
+ <scope>provided</scope>
294
+ </dependency>
295
+ <dependency>
296
+ <groupId>com.liveops.integration</groupId>
297
+ <artifactId>statswatcher</artifactId>
298
+ <version>${project.version}</version>
299
+ <scope>provided</scope>
300
+ </dependency>
301
+ <dependency>
302
+ <groupId>com.liveops.integration</groupId>
303
+ <artifactId>telephony</artifactId>
304
+ <version>${project.version}</version>
305
+ <scope>provided</scope>
306
+ </dependency>
307
+ <dependency>
308
+ <groupId>com.liveops.integration</groupId>
309
+ <artifactId>eventtypes</artifactId>
310
+ <version>${project.version}</version>
311
+ </dependency>
312
+ <dependency>
313
+ <groupId>com.liveops.integration</groupId>
314
+ <artifactId>util</artifactId>
315
+ <version>${project.version}</version>
316
+ </dependency>
317
+
318
+ <dependency>
319
+ <groupId>org.codehaus.jackson</groupId>
320
+ <artifactId>jackson-core-asl</artifactId>
321
+ <version>1.6.1</version>
322
+ <type>jar</type>
323
+ <scope>compile</scope>
324
+ </dependency>
325
+ <dependency>
326
+ <groupId>org.codehaus.jackson</groupId>
327
+ <artifactId>jackson-mapper-asl</artifactId>
328
+ <version>1.6.1</version>
329
+ <type>jar</type>
330
+ <scope>compile</scope>
331
+ </dependency>
332
+ </dependencies>
333
+ </dependencyManagement>
334
+
335
+ <repositories>
336
+ <repository>
337
+ <id>remote-repos</id>
338
+ <name>Remote Repositories</name>
339
+ <url>http://maven:8081/artifactory/remote-repos</url>
340
+ </repository>
341
+ <repository>
342
+ <snapshots>
343
+ <enabled>false</enabled>
344
+ </snapshots>
345
+ <id>libs-releases</id>
346
+ <name>maven-releases</name>
347
+ <url>http://maven:8081/artifactory/libs-releases</url>
348
+ </repository>
349
+ <repository>
350
+ <releases>
351
+ <enabled>false</enabled>
352
+ </releases>
353
+ <snapshots>
354
+ <enabled>true</enabled>
355
+ </snapshots>
356
+ <id>libs-snapshots</id>
357
+ <name>maven-snapshots</name>
358
+ <url>http://maven:8081/artifactory/libs-snapshots</url>
359
+ </repository>
360
+ </repositories>
361
+
362
+ <pluginRepositories>
363
+ <pluginRepository>
364
+ <id>plugins-releases</id>
365
+ <url>http://maven:8081/artifactory/plugins-releases</url>
366
+ <releases>
367
+ <enabled>true</enabled>
368
+ </releases>
369
+ <snapshots>
370
+ <enabled>false</enabled>
371
+ </snapshots>
372
+ </pluginRepository>
373
+ <pluginRepository>
374
+ <id>plugins-snapshots</id>
375
+ <url>http://maven:8081/artifactory/plugins-snapshots</url>
376
+ <releases>
377
+ <enabled>false</enabled>
378
+ </releases>
379
+ <snapshots>
380
+ <enabled>true</enabled>
381
+ </snapshots>
382
+ </pluginRepository>
383
+ </pluginRepositories>
384
+
385
+ <distributionManagement>
386
+ <repository>
387
+ <id>maven</id>
388
+ <name>maven-releases</name>
389
+ <url>http://maven:8081/artifactory/libs-releases-local</url>
390
+ </repository>
391
+ <snapshotRepository>
392
+ <id>maven</id>
393
+ <name>maven-snapshots</name>
394
+ <url>http://maven:8081/artifactory/libs-snapshots-local</url>
395
+ </snapshotRepository>
396
+ </distributionManagement>
397
+
398
+ </project>