[OLINGO-266] initial cargo ref integration test
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/0d62d15d Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/0d62d15d Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/0d62d15d Branch: refs/heads/master Commit: 0d62d15d2fa49488355eac4fa3722a25f111be27 Parents: 8e28a7d Author: Stephan Klevenz <[email protected]> Authored: Mon May 12 13:01:08 2014 +0200 Committer: Stephan Klevenz <[email protected]> Committed: Mon May 12 13:01:08 2014 +0200 ---------------------------------------------------------------------- fit/pom.xml | 53 +++++++++++++------- .../org/apache/olingo/fit/ref/PingITCase.java | 44 ++++++++++++++++ 2 files changed, 78 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d62d15d/fit/pom.xml ---------------------------------------------------------------------- diff --git a/fit/pom.xml b/fit/pom.xml index 905f1cf..9947dd1 100644 --- a/fit/pom.xml +++ b/fit/pom.xml @@ -1,26 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. --> <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/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>olingo-fit</artifactId> @@ -45,7 +45,7 @@ <artifactId>olingo-commons-core</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.apache.olingo</groupId> <artifactId>client-proxy</artifactId> @@ -105,6 +105,13 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.apache.olingo</groupId> + <artifactId>olingo-server-ref</artifactId> + <version>${project.version}</version> + <type>war</type> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> @@ -139,7 +146,7 @@ </execution> </executions> </plugin> - + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> @@ -204,6 +211,14 @@ </configuration> <deployables> <deployable> + <groupId>org.apache.olingo</groupId> + <artifactId>olingo-server-ref</artifactId> + <type>war</type> + <properties> + <context>ref</context> + </properties> + </deployable> + <deployable> <properties> <context>stub</context> </properties> http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0d62d15d/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java b/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java new file mode 100644 index 0000000..bdc033c --- /dev/null +++ b/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.fit.ref; + +import static org.junit.Assert.assertEquals; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.junit.Test; + +public class PingITCase { + + private static final String REF_SERVICE = "http://localhost:9080/ref/odata.svc/"; + + @Test + public void ping() throws Exception { + URL url = new URL(REF_SERVICE); + + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.connect(); + + int code = connection.getResponseCode(); + assertEquals(200, code); + } + +}
