Package org.mojavemvc.core

Examples of org.mojavemvc.core.MappedControllerDatabase


    public void testInvalidActionController2() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidActionController2.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here


    public void testInvalidActionController3() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidActionController3.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testInvalidActionController4() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidActionController4.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testValidActionController1() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestValidActionController1.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
        } catch (Exception e) {
            fail("should not have thrown exception");
        }
    }
View Full Code Here

    public void testValidActionController2() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestValidActionController2.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
        } catch (Exception e) {
            fail("should not have thrown exception");
        }
    }
View Full Code Here

    public void testInvalidController1() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidController1.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testInvalidController2() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidController2.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testInvalidController3() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidController3.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testInvalidController4() {

        try {
            Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
            controllerClasses.add(TestInvalidController4.class);
            new MappedControllerDatabase(controllerClasses, new FakeRouteMap(),
                    new HashMap<String, EntityMarshaller>());
            fail("should have thrown exception");
        } catch (Exception e) {
            if (!(e instanceof ConfigurationException)) {
                fail("wrong exception type");
View Full Code Here

    public void testHttpMethodController() {

        Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
        controllerClasses.add(TestHttpMethodController.class);
        FakeRouteMap rm = new FakeRouteMap();
        ControllerDatabase db = new MappedControllerDatabase(controllerClasses, rm,
                new HashMap<String, EntityMarshaller>());

        assertEquals(TestHttpMethodController.class, db.getControllerClass("TestHttpMethodController"));

        ActionSignature sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.GET);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("getAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.POST);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("postAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.PUT);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("putAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.DELETE);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("deleteAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.OPTIONS);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("optionsAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.HEAD);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("headAction", sig.methodName());

        sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.TRACE);
        assertNotNull(sig);
        assertTrue(sig instanceof HttpMethodActionSignature);
        assertEquals("traceAction", sig.methodName());
       
        assertEquals(1, rm.size());
View Full Code Here

TOP

Related Classes of org.mojavemvc.core.MappedControllerDatabase

Copyright © 2018 www.massapicom. 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.