Examples of ResourceListing


Examples of com.carma.swagger.doclet.model.ResourceListing

        recorder.record(apiFile, api);
      }
    }

    // write out json for api
    ResourceListing listing = new ResourceListing(SWAGGER_VERSION, this.options.getApiVersion(), this.options.getDocBasePath(), resources,
        this.options.getApiAuthorizations(), this.options.getApiInfo());
    File docFile = new File(outputDirectory, "service.json");
    recorder.record(docFile, listing);

  }
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ResourceListing

        final RootDoc rootDoc = RootDocLoader.fromPath("src/test/resources", "fixtures.sample");

        boolean parsingResult = new JaxRsAnnotationParser(options, rootDoc).run();
        assertThat("JavaDoc generation failed", parsingResult, equalTo(true));

        final ResourceListing expectedListing = loadFixture("/fixtures/sample/service.json", ResourceListing.class);
        verify(recorderMock).record(any(File.class), eq(expectedListing));

        final ApiDeclaration expectedDeclaration = loadFixture("/fixtures/sample/foo.json", ApiDeclaration.class);
        verify(recorderMock).record(any(File.class), eq(expectedDeclaration));
    }
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

            public ApiListingReference apply(@Nullable ApiListing apiListing) {
                return new ApiListingReference(apiListing.resourcePath(), apiListing.description(), apiListing.position());
            }
        });

        ResourceListing resourceListing = new ResourceListing(swaggerConfig.apiVersion(),
                swaggerConfig.swaggerVersion(),
                scalaList(listings),
                swaggerConfig.authorizations(),
                swaggerConfig.info());
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

    return responseEntity;
  }

  private ResponseEntity<ResourceListing> getSwaggerResourceListing(String swaggerGroup) {
    ResponseEntity<ResourceListing> responseEntity = new ResponseEntity<ResourceListing>(HttpStatus.NOT_FOUND);
    ResourceListing resourceListing = null;

    if (null == swaggerGroup) {
      resourceListing = swaggerCache.getSwaggerApiResourceListingMap().values().iterator().next();
    } else {
      if (swaggerCache.getSwaggerApiResourceListingMap().containsKey(swaggerGroup)) {
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

      log.error("ApiListingReferenceScanner not configured");
    }

    Collections.sort(apiListingReferences, apiListingReferenceOrdering);

    ResourceListing resourceListing = new ResourceListing(
            this.apiVersion,
            SwaggerSpec.version(),
            toScalaList(apiListingReferences),
            toScalaList(authorizationTypes),
            toOption(apiInfo)
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

        ApiDocumentationController apiDocumentationController = new ApiDocumentationController();
        apiDocumentationController.setApiVersion("v1");
        apiDocumentationController.setBaseControllerPackage(BASE_CONTROLLER_PACKAGE);
        apiDocumentationController.setBasePath("http://localhost/swagger4spring-web-example");

        ResourceListing documentation = apiDocumentationController.getResources(servletRequest);

        assertNotNull(documentation);
        assertEquals("v1", documentation.apiVersion());
        assertEquals(3, documentation.apis().size());

        for (ApiListingReference endPoint : ScalaToJavaUtil.toJavaList(documentation.apis())) {
            assertTrue(END_POINT_PATHS.contains(endPoint.path()));
        }
    }
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

    @Test
    public void testResourceListing() {
        ApiParser apiParser = createApiParser();
        Map<String, ApiListing> documentList = apiParser.createApiListings();
        ResourceListing resourceList = apiParser.getResourceListing(documentList);

//        assertEquals("http://localhost:8080/api", resourceList.basePath());
//        assertEquals("v1", resourceList.apiVersion());
//        assertEquals(END_POINT_PATHS.size(), resourceList.getApis().size());
//
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

    @Test
    public void testNoClassRequestMapping() {
        ApiParser apiParser = createApiParser();
        Map<String, ApiListing> documentList = apiParser.createApiListings();
        ResourceListing resourceList = apiParser.getResourceListing(documentList);
        for (ApiListingReference api: ScalaToJavaUtil.toJavaList(resourceList.apis())) {
            assertNotNull("could not get api listing for path: " + api.path(), documentList.get(api.path().substring(4))); // each api should be accessible using the ApiListingReference minus /doc
        }
    }
View Full Code Here

Examples of com.wordnik.swagger.model.ResourceListing

          apiListingReference.description(), apiListingReference
              .position()));
    }
    // there's no setter of path for ApiListingReference, we need to create
    // a new ResourceListing for new path
    serviceDocument = new ResourceListing(serviceDocument.apiVersion(),
        serviceDocument.swaggerVersion(),
        scala.collection.immutable.List.fromIterator(JavaConversions
            .asScalaIterator(apiListingReferences.iterator())),
        serviceDocument.authorizations(), serviceDocument.info());
  }
View Full Code Here

Examples of net.sourceforge.processdash.tool.bridge.ResourceListing

    public static ResourceCollectionInfo parseListing(InputStream in)
            throws IOException {
        try {
            Element data = XMLUtils.parse(in).getDocumentElement();
            ResourceListing result = new ResourceListing();
            NodeList resourceElems = data.getElementsByTagName(RESOURCE_TAG);
            if (resourceElems != null) {
                for (int i = 0; i < resourceElems.getLength(); i++) {
                    Element res = (Element) resourceElems.item(i);
                    String name = res.getAttribute(NAME_ATTR);
                    long mod = Long.parseLong(res.getAttribute(MOD_TIME_ATTR));
                    long sum = Long.parseLong(res.getAttribute(CHECKSUM_ATTR));
                    result.addResource(name, mod, sum);
                }
            }
            return result;
        } catch (Exception e) {
            IOException ioe = new IOException(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.