Skip to content

Commit 20add5b

Browse files
committed
updated tests, jetty
1 parent b7c2c34 commit 20add5b

File tree

2 files changed

+14
-41
lines changed

2 files changed

+14
-41
lines changed

samples/client/petstore/objc/PetstoreClient/PetstoreClientTests/PetApiTest.m

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ - (void) testUpdatePet {
9090
[photos addObject:url];
9191
}
9292
[petToAdd setPhotoUrls:photos];
93-
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
9493

95-
static bool hasResponse = false;
9694
[api addPetWithCompletionBlock:petToAdd completionHandler:^(NSError *error) {
9795
if(error) {
9896
XCTFail(@"got error %@", error);
@@ -143,20 +141,15 @@ - (void) testUpdatePet {
143141

144142
- (void)testGetPetByStatus {
145143
XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"];
146-
static NSMutableArray* pets = nil;
147-
static NSError * gError = nil;
148144
[api findPetsByStatusWithCompletionBlock:@"available" completionHandler:^(NSArray *output, NSError *error) {
149145
if(error) {
150-
gError = error;
146+
XCTFail(@"got error %@", error);
151147
}
152148
if(output == nil){
153-
NSLog(@"failed to fetch pets");
149+
XCTFail(@"failed to fetch pets");
154150
}
155151
else {
156-
pets = [[NSMutableArray alloc]init];
157-
for(SWGPet* pet in output) {
158-
[pets addObject:[[SWGPet alloc] initWithValues:[pet asDictionary]]];
159-
}
152+
[expectation fulfill];
160153
}
161154
}];
162155
[self waitForExpectationsWithTimeout:2.0 handler:nil];

samples/client/petstore/objc/pom.xml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,27 @@
2222
</executions>
2323
</plugin>
2424
<plugin>
25-
<groupId>org.mortbay.jetty</groupId>
25+
<groupId>org.eclipse.jetty</groupId>
2626
<artifactId>jetty-maven-plugin</artifactId>
2727
<version>${jetty-version}</version>
2828
<configuration>
29-
<useTestScope>true</useTestScope>
30-
<stopWait>15</stopWait>
3129
<war>${project.build.directory}/swagger-java-jersey-sample-app-${webapp-version}.war</war>
32-
<webAppConfig>
33-
<contextPath>/</contextPath>
34-
</webAppConfig>
35-
<stopPort>8079</stopPort>
36-
<stopKey>stopit</stopKey>
37-
<connectors>
38-
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
39-
<port>8002</port>
40-
<maxIdleTime>60000</maxIdleTime>
41-
<confidentialPort>8443</confidentialPort>
42-
</connector>
43-
</connectors>
30+
<stopKey>alpha</stopKey>
31+
<stopPort>9099</stopPort>
32+
<httpConnector>
33+
<port>8002</port>
34+
</httpConnector>
4435
</configuration>
4536
<executions>
4637
<execution>
4738
<id>start-jetty</id>
4839
<phase>pre-integration-test</phase>
4940
<goals>
50-
<goal>run-war</goal>
51-
</goals>
52-
<configuration>
53-
<scanIntervalSeconds>0</scanIntervalSeconds>
54-
<daemon>true</daemon>
55-
</configuration>
56-
</execution>
57-
<execution>
58-
<id>stop-jetty</id>
59-
<phase>post-integration-test</phase>
60-
<goals>
61-
<goal>stop</goal>
41+
<goal>deploy-war</goal>
6242
</goals>
6343
</execution>
64-
</executions>
65-
</plugin>
44+
</executions>
45+
</plugin>
6646
<plugin>
6747
<groupId>org.codehaus.mojo</groupId>
6848
<artifactId>exec-maven-plugin</artifactId>
@@ -110,8 +90,8 @@
11090
<artifactId>swagger-java-jersey-sample-app</artifactId>
11191
<version>${webapp-version}</version>
11292
<type>war</type>
113-
<scope>test</scope>
11493
</dependency>
94+
</dependencies>
11595
<repositories>
11696
<repository>
11797
<id>sonatype-snapshots</id>
@@ -123,6 +103,6 @@
123103
</repositories>
124104
<properties>
125105
<webapp-version>1.5.4-M1-SNAPSHOT</webapp-version>
126-
<jetty-version>8.1.11.v20130520</jetty-version>
106+
<jetty-version>9.2.9.v20150224</jetty-version>
127107
</properties>
128108
</project>

0 commit comments

Comments
 (0)