Exemplo n.º 1
0
import java.lang.System
import vertx_tests
from core.event_bus import EventBus

import vertx

# The test methods must begin with "test"

def test_ping() :
    def handler(msg):
        VertxAssert.assertEquals('pong!', msg.body)
        VertxAssert.testComplete()
    EventBus.send('ping-address', 'ping!', handler)

def test_something_else() :
    VertxAssert.testComplete()

script = locals()

# The script is execute for each test, so this will deploy the module for each one
def handler(err, depID):
    # Deployment is asynchronous and this this handler will be called when it's complete (or failed)
    VertxAssert.assertNull(err)
    # If deployed correctly then start the tests!
    vertx_tests.start_tests(script)

# Deploy the module - the System property `vertx.modulename` will contain the name of the module so you
# don't have to hardecode it in your tests
vertx.deploy_module(java.lang.System.getProperty("vertx.modulename"), None, 1, handler)

Exemplo n.º 2
0
            'address': 'vertx.mongopersistor',
            'requires_auth':
            True,  # User must be logged in to send let these through
            'match': {
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [{}]
}


# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(id):
    execfile('static_data.py')


# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('vertx.mongo-persistor-v1.0', handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('vertx.auth-mgr-v1.0')

# Start the web server, with the config we defined above
vertx.deploy_module('vertx.web-server-v1.0', web_server_conf)
Exemplo n.º 3
0
            "address": "vertx.mongopersistor",
            "requires_auth": False,
            "match": {
                "action": "update",
                "collection": "requests"
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    "outbound_permitted": [{}]
}


# And when it"s deployed run a script to load it with some reference
# data for the demov
def deploy_handler(err, id):
    if err is None:
        print("Done deploying")
    else:
        print("Failed to deploy %s" % err)


# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module("io.vertx~mod-mongo-persistor~2.0.0-final",
                    handler=deploy_handler)

# Start the web server, with the config we defined above
vertx.deploy_module("io.vertx~mod-web-server~2.0.0-final", web_server_conf)
Exemplo n.º 4
0
Arquivo: app.py Projeto: aav/vert.x
        {
            'address': 'vertx.mongopersistor',
            'requires_auth': True,  # User must be logged in to send let these through
            'match': {
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [
        {}
    ]
}

# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(id):    
    execfile('static_data.py')

# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('vertx.mongo-persistor-v1.0', handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('vertx.auth-mgr-v1.0')

# Start the web server, with the config we defined above
vertx.deploy_module('vertx.web-server-v1.0', web_server_conf)
Exemplo n.º 5
0
    else:
        logger.info("MOD-AUTH-MGR uid: %s" %dep_id)
def deploy_mailer(err, dep_id):
    if err is not None:
        err.printStackTrace()
    else:
        logger.info("MOD-MAILER uid: %s" %dep_id)


#vertx.deploy_module('io.vertx~mod-unzip~1.0.0-final', {"address":"unzip.module"}, 1,handler=deploy_handler)

#main server / route matcher / eventbus
logger.info("WEB-SERVER-START-DEPLOY")
logger.info("MOD-MONGO-START-DEPLOY")
logger.info("MOD-AUTH-MGR-START-DEPLOY")
logger.info("MOD-MAILER-START-DEPLOY")

vertx.deploy_module('io.vertx~mod-mongo-persistor~2.0.0-final', global_config.get("mongodb"), 1,handler=deploy_mongo)
vertx.deploy_module('io.vertx~mod-auth-mgr~2.0.0-final', None, 1,handler=deploy_auth)
vertx.deploy_module('io.vertx~mod-mailer~2.0.0-final', global_config.get("mailer"), 1,handler=deploy_mailer)
vertx.deploy_verticle('server/web_server.py', global_config, 1, handler=web_server_deploy)
vertx.deploy_verticle('server/sock_js_server.py', global_config, 1, handler=sock_js_server_deploy)
vertx.deploy_verticle('server/presenation_server.py', global_config, 1, handler=sock_js_server_deploy)

#logger.info("load config : %s"% config)
#logger.info("webserver config : %s"% config.main)
#logger.info("mongopersistor config: %s"% config.mongo)
#logger.info("webserver config: %s"% auth_config)
#cleaner.periodic_cleaner(5000,"files/temp/",".*\.uploaded")
#cleaner.periodic_cleaner(15000,"files/symlink/")
Exemplo n.º 6
0
            'match': {
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [
        {}
    ]
}

# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(err, id):
    if err is None:
        execfile('static_data.py')
    else:
        print 'Failed to deploy %s' % err

# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('io.vertx~mod-mongo-persistor~2.0.0-SNAPSHOT', handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('io.vertx~mod-auth-mgr~2.0.0-SNAPSHOT')

# Start the web server, with the config we defined above
vertx.deploy_module('io.vertx~mod-web-server~2.0.0-SNAPSHOT', web_server_conf)
Exemplo n.º 7
0
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [{}]
}


# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(err, id):
    if err is None:
        execfile('static_data.py')
    else:
        print 'Failed to deploy %s' % err


# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('io.vertx~mod-mongo-persistor~2.0.0-beta1',
                    handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('io.vertx~mod-auth-mgr~2.0.0-beta1')

# Start the web server, with the config we defined above
vertx.deploy_module('io.vertx~mod-web-server~2.0.0-beta1', web_server_conf)
Exemplo n.º 8
0
      },
        "age": {
          "description": "Age in years",
          "type": "integer",
          "minimum": 0
        }
      },
      "required": ["firstName", "lastName"]
    }
    }, 1000, bla)
            EventBus.send("campudus.jsonvalidator", {"action":"getSchemaKeys"}, bla)
        else:
            print 'Failed to deploy %s' % err
            err.printStackTrace()

    vertx.deploy_module('com.campudus~json-schema-validator~1.0.0', handler=deploy_handler)

    vertx.deploy_module(
      "io.vertx~mod-mongo-persistor~2.1.0",
      conf['mongo-persistor'], handler=deploy_handler)

    vertx.deploy_module(
      'com.campudus~session-manager~2.0.1-final',
      conf['session-manager'], handler=deploy_handler)
    #vertx.deploy_module('io.vertx~mod-web-server~2.0.0-final', conf['web-server'])
    #  conf['thymeleaf'], handler=deploy_handler)

    #vertx.deploy_module('io.vertx~mod-auth-mgr~2.0.0-final')

    server = vertx.create_http_server()
    server.request_handler(rm)
Exemplo n.º 9
0
import vertx

def handler(msg):

    print("deploy done: "+msg)

cfg=vertx.config()


vertx.deploy_module('vertx.auth-mgr-v1.0', cfg["auth"],handler=handler)
vertx.deploy_module('eban.alchemy-persistor-v0.1', cfg["persistor"],handler=handler)
vertx.deploy_verticle('mvc_x/controller_verticle.py',  cfg["web"],handler=handler)

Exemplo n.º 10
0
def start_server(cfg):
    m = {}
    m.update(web_server_conf)
    m.update(cfg)
    # Start the web server, with the config we defined above
    vertx.deploy_module('io.vertx~mod-web-server~2.0.0-final', m)
Exemplo n.º 11
0
def start_server(cfg):
    m = {}
    m.update(web_server_conf)
    m.update(cfg)
    # Start the web server, with the config we defined above
    vertx.deploy_module('io.vertx~mod-web-server~2.0.0-final', m)
Exemplo n.º 12
0
        {
            "address": "vertx.mongopersistor",
            "requires_auth": False,
            "match": {"action": "delete", "collection": "requests"},
        },
        {
            "address": "vertx.mongopersistor",
            "requires_auth": False,
            "match": {"action": "update", "collection": "requests"},
        },
    ],
    # This defines which messages from the server we will let through to the client
    "outbound_permitted": [{}],
}

# And when it"s deployed run a script to load it with some reference
# data for the demov
def deploy_handler(err, id):
    if err is None:
        print("Done deploying")
    else:
        print("Failed to deploy %s" % err)


# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module("io.vertx~mod-mongo-persistor~2.0.0-final", handler=deploy_handler)

# Start the web server, with the config we defined above
vertx.deploy_module("io.vertx~mod-web-server~2.0.0-final", web_server_conf)
Exemplo n.º 13
0
        {
            'address': 'vertx.mongopersistor',
            'requires_auth': True,  # User must be logged in to send let these through
            'match': {
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [
        {}
    ]
}

# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(id):    
    execfile('static_data.py')

# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('vertx~mongo-persistor~1.2', handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('vertx~auth-mgr~1.1')

# Start the web server, with the config we defined above
vertx.deploy_module('vertx~web-server~1.0', web_server_conf)
Exemplo n.º 14
0
Arquivo: app.py Projeto: winash/vert.x
            'address': 'vertx.mongopersistor',
            'requires_auth':
            True,  # User must be logged in to send let these through
            'match': {
                'action': 'save',
                'collection': 'orders'
            }
        }
    ],

    # This defines which messages from the server we will let through to the client
    'outbound_permitted': [{}]
}


# And when it's deployed run a script to load it with some reference
# data for the demov
def deploy_handler(id):
    execfile('static_data.py')


# Now we deploy the modules that we need
# Deploy a MongoDB persistor module
vertx.deploy_module('vertx~mongo-persistor~1.2', handler=deploy_handler)

# Deploy an auth manager to handle the authentication
vertx.deploy_module('vertx~auth-mgr~1.1')

# Start the web server, with the config we defined above
vertx.deploy_module('vertx~web-server~1.0', web_server_conf)