Examples of AbstractResource


Examples of com.adito.policyframework.AbstractResource

        assertEquals("Resource matches", resource, foundResource);
    }  
   
    private Resource getDefaultResource() {
        final Calendar date = Calendar.getInstance();
        return new AbstractResource(123, resourceType, 123, "resourceName", "resourceDescription", date, date) {};
    }
View Full Code Here

Examples of com.adito.policyframework.AbstractResource

        mocksControl.verify();
    }

    private Resource getDefaultResource() {
        final Calendar date = Calendar.getInstance();
        return new AbstractResource(123, resourceType, 123, "resourceName", "resourceDescription", date, date) {};
    }
View Full Code Here

Examples of com.google.gwt.i18n.rebind.util.AbstractResource

    // Make sure that the type being rebound is in fact an interface.
    if (targetClass.isInterface() == null) {
      throw error(logger, name + " must be an interface");
    }

    AbstractResource resource;
    try {
      resource = ResourceFactory.getBundle(targetClass, locale);
    } catch (MissingResourceException e) {
      throw error(
          logger,
          "Localization failed; there must be at least one properties file accessible through the classpath in package '"
              + packageName
              + "' whose base name is '"
              + ResourceFactory.getResourceName(targetClass) + "'");
    } catch (IllegalArgumentException e) {
      // A bad key can generate an illegal argument exception.
      throw error(logger, e.getMessage());
    }

    // generated implementations for interface X will be named X_, X_en,
    // X_en_CA, etc.
    String realLocale = "_";
    if (resource.getLocale() != null) {
      realLocale += resource.getLocale();
    }
    // Use _ rather than "." in class name, cannot use $
    String resourceName = targetClass.getName().replace('.', '_');
    String className = resourceName + realLocale;
    PrintWriter pw = context.tryCreate(logger, packageName, className);
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    ResourceMethodCustomInvokerDispatchFactory rdFactory;

    @Override
    public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {

        final AbstractResource declaringResource = abstractResourceMethod.getDeclaringResource();

        if (isSessionBean(declaringResource)) {

            final Class<?> resourceClass = declaringResource.getResourceClass();
            final Method javaMethod = abstractResourceMethod.getMethod();

            for (Class iFace: remoteAndLocalIfaces(resourceClass)) {
                    try {
                        final Method iFaceMethod = iFace.getDeclaredMethod(javaMethod.getName(), javaMethod.getParameterTypes());
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    @Test
    public void testRootResourceNonAmbigConstructors() throws Exception {
        System.out.println(
                "---\nNo issue should be reported if more public ctors exists with the same number of params, " +
                "but another just one is presented with more params at a root resource:");
        AbstractResource ar = IntrospectionModeller.createResource(TestRootResourceNonAmbigCtors.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(validator.getIssueList().isEmpty());
    }
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    }

    // this should be sorted out at runtime rather than during validation
    public void suspendedTestSingletonFieldsInjection() throws Exception {
        System.out.println("---\nAn issue should be reported if injection is required for a singleton life-cycle:");
        AbstractResource ar = IntrospectionModeller.createResource(TestCantInjectFieldsForSingleton.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
        assertEquals(5, validator.getIssueList().size());
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    }

    @Test
    public void testNonPublicRM() throws Exception {
        System.out.println("---\nAn issue should be reported if a resource method is not public:");
        AbstractResource ar = IntrospectionModeller.createResource(TestNonPublicRM.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
    // TODO: there might still be an implicit viewable associated with it
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    }

    @Test
    public void testNonPublicRM1() throws Exception {
        System.out.println("---\nAn issue should be reported if a resource method is not public:");
        AbstractResource ar = IntrospectionModeller.createResource(TestNonPublicRM1.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
    }
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    }

    // should be probably validated at runtime rather then at the validation phase
    public void suspendedTestMoreThanOneEntity() throws Exception {
        System.out.println("---\nAn issue should be reported if a resource method takes more than one entity params:");
        AbstractResource ar = IntrospectionModeller.createResource(TestMoreThanOneEntity.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
    }
View Full Code Here

Examples of com.sun.jersey.api.model.AbstractResource

    }

    @Test
    public void testGetRMReturningVoid() throws Exception {
        System.out.println("---\nAn issue should be reported if a get method returns void:");
        AbstractResource ar = IntrospectionModeller.createResource(TestGetRMReturningVoid.class);
        BasicValidator validator = new BasicValidator();
        validator.validate(ar);
        printIssueList(validator);
        assertTrue(!validator.getIssueList().isEmpty());
        assertTrue(!validator.getIssueList().get(0).isFatal());
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.