Skip to content

Commit

Permalink
Fixes swagger-api#1203: scala and junit dependencies have been deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
lugaru1234 committed Aug 31, 2015
1 parent 27fcd0d commit a01ab65
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 186 deletions.
41 changes: 2 additions & 39 deletions modules/swagger-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down Expand Up @@ -121,27 +111,6 @@
<artifactId>swagger-models</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.10</artifactId>
<version>${jackson-scala-version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down Expand Up @@ -187,12 +156,6 @@
<version>${logback-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
Expand All @@ -211,8 +174,8 @@
<properties>
<!-- TODO increase coverage -->
<validation-api-version>1.1.0.Final</validation-api-version>
<coverage.complexity.minimum>0.50</coverage.complexity.minimum>
<coverage.complexity.minimum>0.80</coverage.complexity.minimum>
<coverage.line.minimum>0.0</coverage.line.minimum>
<coverage.missed.classes>3</coverage.missed.classes>
<coverage.missed.classes>2</coverage.missed.classes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,34 @@

import static org.testng.Assert.assertTrue;

import io.swagger.converter.ModelConverters;
import io.swagger.matchers.SerializationMatchers;
import io.swagger.models.*;
import io.swagger.models.properties.*;
import io.swagger.models.ModelImpl;
import io.swagger.models.properties.ObjectProperty;
import io.swagger.models.properties.Property;
import io.swagger.models.properties.StringProperty;
import io.swagger.util.Json;

import org.apache.commons.io.IOUtils;
import org.testng.annotations.Test;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Map;

public class ObjectPropertyTest {
@org.junit.Test //(description = "convert a model with object properties")
@Test (description = "convert a model with object properties")
public void readModelWithObjectProperty() throws IOException {
String json = "{\n\"properties\": {\n\"id\": {\n\"type\": \"string\"\n},\n\"someObject\": {\n\"type\": \"object\",\n\"properties\": {\n\"innerId\": {\n\"type\": \"string\"\n}\n}\n}\n}\n}";
String json = "{" +
" \"properties\":{" +
" \"id\":{" +
" \"type\":\"string\"" +
" }," +
" \"someObject\":{" +
" \"type\":\"object\"," +
" \"properties\":{" +
" \"innerId\":{" +
" \"type\":\"string\"" +
" }" +
" }" +
" }" +
" }" +
"}";

ModelImpl model = Json.mapper().readValue(json, ModelImpl.class);

Expand Down
6 changes: 3 additions & 3 deletions modules/swagger-hibernate-validations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
<properties>
<hibernate-validator-version>5.1.3.Final</hibernate-validator-version>
<!-- TODO increase coverage and remove these overrides-->
<coverage.complexity.minimum>0.35</coverage.complexity.minimum>
<coverage.line.minimum>0.00</coverage.line.minimum>
<coverage.missed.classes>2</coverage.missed.classes>
<coverage.complexity.minimum>0.50</coverage.complexity.minimum>
<coverage.line.minimum>0.90</coverage.line.minimum>
<coverage.missed.classes>0</coverage.missed.classes>
</properties>
</project>
9 changes: 2 additions & 7 deletions modules/swagger-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
Expand Down Expand Up @@ -148,8 +143,8 @@
</dependency>
</dependencies>
<properties>
<coverage.complexity.minimum>0.29</coverage.complexity.minimum>
<coverage.complexity.minimum>0.60</coverage.complexity.minimum>
<coverage.line.minimum>0.00</coverage.line.minimum>
<coverage.missed.classes>5</coverage.missed.classes>
<coverage.missed.classes>3</coverage.missed.classes>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import io.swagger.resources.PostParamResource;
import org.testng.annotations.Test;

import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;

public class PostParamTest {
private static final String BODY = "body";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void scanConsumesProducesValuesWithoutClassLevelAnnotations() {
assertEquals(getPut(swagger, "/{id}/value").getProduces().get(0), TEXT_PLAIN);
}

@org.junit.Test//(description = "scan class level and field level annotations")
@Test(description = "scan class level and field level annotations")
public void scanClassAndFieldLevelAnnotations() {
Swagger swagger = getSwagger(ResourceWithKnownInjections.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ private Swagger getSwagger(Class<?> resource) {
return reader.read(resource);
}

@org.junit.Test///(description = "scan resource 1343")
@Test(description = "scan resource 1343")
public void scanResource1343() {
Swagger swagger = getSwagger(Resource1343.class);
Json.prettyPrint(swagger);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@
import javax.xml.bind.annotation.XmlRootElement;

@Path("/v1")
@Api(value="root")
@Api(value = "root")
@XmlRootElement
public class Resource1343 {
RestApplication _application = null;
RestApplication _application = null;

@GET
@Path("/{dbkey}")
@ApiOperation(value="Retrieve a database resource")
public DatabaseResource getDatabase(@ApiParam(name="dbkey",value="Database key") @PathParam("dbkey") String dbKey) throws Exception {
return new DatabaseResource(this, dbKey);
}
@GET
@Path("/{dbkey}")
@ApiOperation(value = "Retrieve a database resource")
public DatabaseResource getDatabase(@ApiParam(name = "dbkey", value = "Database key") @PathParam("dbkey") String dbKey) throws Exception {
return new DatabaseResource(this, dbKey);
}

public ComplicatedObject nothing() {
return null;
}
public ComplicatedObject nothing() {
return null;
}

public RestApplication getApplication() {
return _application;
}

static class RestApplication {
public Integer id;
public String name;
}
public RestApplication getApplication() {
return _application;
}

static class DatabaseResource {
public String databaseName;
static class RestApplication {
public Integer id;
public String name;
}

public DatabaseResource(Object parent, String key) {
static class DatabaseResource {
public String databaseName;

public DatabaseResource(Object parent, String key) {

}
}

static class ComplicatedObject {
public Integer id;
}
}

static class ComplicatedObject {
public Integer id;
}
}
}
10 changes: 0 additions & 10 deletions modules/swagger-jersey-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
Expand Down
7 changes: 1 addition & 6 deletions modules/swagger-jersey2-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
Expand Down Expand Up @@ -100,7 +95,7 @@
</dependencies>
<properties>
<!-- TODO increase coverage and remove these overrides-->
<coverage.complexity.minimum>0.35</coverage.complexity.minimum>
<coverage.complexity.minimum>0.50</coverage.complexity.minimum>
<coverage.line.minimum>0.00</coverage.line.minimum>
<coverage.missed.classes>2</coverage.missed.classes>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions modules/swagger-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
<properties>
<!-- TODO increase coverage -->
<validation-api-version>1.1.0.Final</validation-api-version>
<coverage.complexity.minimum>0.00</coverage.complexity.minimum>
<coverage.complexity.minimum>0.07</coverage.complexity.minimum>
<coverage.line.minimum>0.0</coverage.line.minimum>
<!-- Setting this to a really high number since this module has almost no coverage -->
<coverage.missed.classes>100</coverage.missed.classes>
<coverage.missed.classes>40</coverage.missed.classes>
</properties>
</project>
11 changes: 0 additions & 11 deletions modules/swagger-mule/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
<version>${scala-test-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
Expand Down
Loading

0 comments on commit a01ab65

Please sign in to comment.