use of com.google.api.server.spi.TypeLoader in project endpoints-java by cloudendpoints.
the class ApiConfigTest method setUp.
@Before
public void setUp() throws Exception {
serviceContext = ServiceContext.create();
typeLoader = new TypeLoader();
apiConfig = new ApiConfig.Factory().create(serviceContext, typeLoader, TestEndpoint.class);
apiConfig.getSerializationConfig().addSerializationConfig(IntegerToStringSerializer.class);
apiConfig.getSerializationConfig().addSerializationConfig(LongToStringSerializer.class);
apiConfig.getSerializationConfig().addSerializationConfig(FloatToStringSerializer.class);
apiConfig2 = new ApiConfig.Factory().create(serviceContext, typeLoader, TestEndpoint.class);
apiConfig2.getSerializationConfig().addSerializationConfig(IntegerToStringSerializer.class);
apiConfig2.getSerializationConfig().addSerializationConfig(LongToStringSerializer.class);
apiConfig2.getSerializationConfig().addSerializationConfig(FloatToStringSerializer.class);
}
use of com.google.api.server.spi.TypeLoader in project endpoints-java by cloudendpoints.
the class SwaggerGeneratorTest method setUp.
@Before
public void setUp() throws Exception {
TypeLoader typeLoader = new TypeLoader(getClass().getClassLoader());
ApiConfigAnnotationReader annotationReader = new ApiConfigAnnotationReader(typeLoader.getAnnotationTypes());
this.configLoader = new ApiConfigLoader(new ApiConfig.Factory(), typeLoader, annotationReader);
}
use of com.google.api.server.spi.TypeLoader in project endpoints-java by cloudendpoints.
the class SwaggerGenerator method writeSwagger.
public Swagger writeSwagger(Iterable<ApiConfig> configs, boolean writeInternal, SwaggerContext context) throws ApiConfigException {
try {
TypeLoader typeLoader = new TypeLoader(SwaggerGenerator.class.getClassLoader());
SchemaRepository repo = new SchemaRepository(typeLoader);
GenerationContext genCtx = new GenerationContext();
genCtx.validator = new ApiConfigValidator(typeLoader, repo);
genCtx.writeInternal = writeInternal;
genCtx.schemata = new SchemaRepository(typeLoader);
return writeSwagger(configs, context, genCtx);
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
}
use of com.google.api.server.spi.TypeLoader in project endpoints-java by cloudendpoints.
the class ApiConfigValidatorTest method setUp.
@Before
public void setUp() throws Exception {
TypeLoader typeLoader = new TypeLoader(ApiConfigValidator.class.getClassLoader());
SchemaRepository schemaRepository = new SchemaRepository(typeLoader);
validator = new ApiConfigValidator(typeLoader, schemaRepository);
configFactory = new ApiConfig.Factory();
configLoader = new ApiConfigLoader();
config = configLoader.loadConfiguration(ServiceContext.create(), TestEndpoint.class);
}
use of com.google.api.server.spi.TypeLoader in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method setUp.
@Before
public void setUp() throws Exception {
TypeLoader typeLoader = new TypeLoader(getClass().getClassLoader());
ApiConfigAnnotationReader annotationReader = new ApiConfigAnnotationReader(typeLoader.getAnnotationTypes());
this.configLoader = new ApiConfigLoader(new ApiConfig.Factory(), typeLoader, annotationReader);
this.generator = new DiscoveryGenerator(typeLoader);
this.schemaRepository = new SchemaRepository(typeLoader);
}
Aggregations