target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testIsEmpty() throws IOException, ExecutorManagerException { QueuedExecutions queue = new QueuedExecutions(5); List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData(); Assert.assertTrue(queue.isEmpty()); queue.enqueueAll(dataList); Assert.assertEquals(queue.size(), 2); queue.clear(); ... | public boolean isEmpty() { return queuedFlowList.isEmpty() && queuedFlowMap.isEmpty(); } | QueuedExecutions { public boolean isEmpty() { return queuedFlowList.isEmpty() && queuedFlowMap.isEmpty(); } } | QueuedExecutions { public boolean isEmpty() { return queuedFlowList.isEmpty() && queuedFlowMap.isEmpty(); } QueuedExecutions(long capacity); } | QueuedExecutions { public boolean isEmpty() { return queuedFlowList.isEmpty() && queuedFlowMap.isEmpty(); } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Collection<P... | QueuedExecutions { public boolean isEmpty() { return queuedFlowList.isEmpty() && queuedFlowMap.isEmpty(); } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Collection<P... |
@Test public void testFetchHead() throws IOException, ExecutorManagerException, InterruptedException { QueuedExecutions queue = new QueuedExecutions(5); List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData(); Assert.assertTrue(queue.isEmpty()); queue.enqueueAll(dataList); Assert.assertEquals(queue.fet... | public Pair<ExecutionReference, ExecutableFlow> fetchHead() throws InterruptedException { Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowList.take(); if (pair != null && pair.getFirst() != null) { queuedFlowMap.remove(pair.getFirst().getExecId()); } return pair; } | QueuedExecutions { public Pair<ExecutionReference, ExecutableFlow> fetchHead() throws InterruptedException { Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowList.take(); if (pair != null && pair.getFirst() != null) { queuedFlowMap.remove(pair.getFirst().getExecId()); } return pair; } } | QueuedExecutions { public Pair<ExecutionReference, ExecutableFlow> fetchHead() throws InterruptedException { Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowList.take(); if (pair != null && pair.getFirst() != null) { queuedFlowMap.remove(pair.getFirst().getExecId()); } return pair; } QueuedExecutions(long cap... | QueuedExecutions { public Pair<ExecutionReference, ExecutableFlow> fetchHead() throws InterruptedException { Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowList.take(); if (pair != null && pair.getFirst() != null) { queuedFlowMap.remove(pair.getFirst().getExecId()); } return pair; } QueuedExecutions(long cap... | QueuedExecutions { public Pair<ExecutionReference, ExecutableFlow> fetchHead() throws InterruptedException { Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowList.take(); if (pair != null && pair.getFirst() != null) { queuedFlowMap.remove(pair.getFirst().getExecId()); } return pair; } QueuedExecutions(long cap... |
@Test(timeout = 4000) public void basicGetTest() { Props props = new Props(); String url = buildUrlForDelay(1); props.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.url", url); List<HttpRequestBase> httpRequestList = JobCallbackUtil.parseJobCallbackProperties(props, JobCallbackStatus... | public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http request: " + httpRequest.t... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... |
@Test public void testIsFull() throws IOException, ExecutorManagerException, InterruptedException { QueuedExecutions queue = new QueuedExecutions(2); List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData(); queue.enqueueAll(dataList); Assert.assertTrue(queue.isFull()); } | public boolean isFull() { return size() >= capacity; } | QueuedExecutions { public boolean isFull() { return size() >= capacity; } } | QueuedExecutions { public boolean isFull() { return size() >= capacity; } QueuedExecutions(long capacity); } | QueuedExecutions { public boolean isFull() { return size() >= capacity; } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Collection<Pair<ExecutionReference, Executable... | QueuedExecutions { public boolean isFull() { return size() >= capacity; } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Collection<Pair<ExecutionReference, Executable... |
@Test public void testHasExecution() throws IOException, ExecutorManagerException, InterruptedException { QueuedExecutions queue = new QueuedExecutions(2); List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData(); queue.enqueueAll(dataList); for (Pair<ExecutionReference, ExecutableFlow> pair : dataList)... | public boolean hasExecution(int executionId) { return queuedFlowMap.containsKey(executionId); } | QueuedExecutions { public boolean hasExecution(int executionId) { return queuedFlowMap.containsKey(executionId); } } | QueuedExecutions { public boolean hasExecution(int executionId) { return queuedFlowMap.containsKey(executionId); } QueuedExecutions(long capacity); } | QueuedExecutions { public boolean hasExecution(int executionId) { return queuedFlowMap.containsKey(executionId); } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Colle... | QueuedExecutions { public boolean hasExecution(int executionId) { return queuedFlowMap.containsKey(executionId); } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflow, ExecutionReference ref); void enqueueAll(
Colle... |
@Test public void testGetFlow() throws IOException, ExecutorManagerException, InterruptedException { QueuedExecutions queue = new QueuedExecutions(2); List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData(); queue.enqueueAll(dataList); for (Pair<ExecutionReference, ExecutableFlow> pair : dataList) { As... | public ExecutableFlow getFlow(int executionId) { if (hasExecution(executionId)) { return queuedFlowMap.get(executionId).getSecond(); } return null; } | QueuedExecutions { public ExecutableFlow getFlow(int executionId) { if (hasExecution(executionId)) { return queuedFlowMap.get(executionId).getSecond(); } return null; } } | QueuedExecutions { public ExecutableFlow getFlow(int executionId) { if (hasExecution(executionId)) { return queuedFlowMap.get(executionId).getSecond(); } return null; } QueuedExecutions(long capacity); } | QueuedExecutions { public ExecutableFlow getFlow(int executionId) { if (hasExecution(executionId)) { return queuedFlowMap.get(executionId).getSecond(); } return null; } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflo... | QueuedExecutions { public ExecutableFlow getFlow(int executionId) { if (hasExecution(executionId)) { return queuedFlowMap.get(executionId).getSecond(); } return null; } QueuedExecutions(long capacity); Pair<ExecutionReference, ExecutableFlow> fetchHead(); void dequeue(int executionId); void enqueue(ExecutableFlow exflo... |
@Test public void testUploadExecutableNode() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); ExecutableFlow flow = createExecutableFlow(10, "exec1"); flow.setExecutionId(10); File jobFile = new File(UNIT_BASE_DIR + "/exectest1", "job10.job"); Props props = new Props(null, jobF... | @Override public void uploadExecutableNode(ExecutableNode node, Props inputProps) throws ExecutorManagerException { final String INSERT_EXECUTION_NODE = "INSERT INTO execution_jobs " + "(exec_id, project_id, version, flow_id, job_id, start_time, " + "end_time, status, input_params, attempt) VALUES (?,?,?,?,?,?,?,?,?,?)... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void uploadExecutableNode(ExecutableNode node, Props inputProps) throws ExecutorManagerException { final String INSERT_EXECUTION_NODE = "INSERT INTO execution_jobs " + "(exec_id, project_id, version, flow_id, job_id, start_ti... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void uploadExecutableNode(ExecutableNode node, Props inputProps) throws ExecutorManagerException { final String INSERT_EXECUTION_NODE = "INSERT INTO execution_jobs " + "(exec_id, project_id, version, flow_id, job_id, start_ti... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void uploadExecutableNode(ExecutableNode node, Props inputProps) throws ExecutorManagerException { final String INSERT_EXECUTION_NODE = "INSERT INTO execution_jobs " + "(exec_id, project_id, version, flow_id, job_id, start_ti... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void uploadExecutableNode(ExecutableNode node, Props inputProps) throws ExecutorManagerException { final String INSERT_EXECUTION_NODE = "INSERT INTO execution_jobs " + "(exec_id, project_id, version, flow_id, job_id, start_ti... |
@Test public void testUnassignExecutorException() throws ExecutorManagerException, IOException { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); try { loader.unassignExecutor(2); Assert.fail("Expecting exception, but didn't get one"); } catch (ExecutorManagerException ex) { System.out.println("T... | @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.update(UPDATE, executionId); if (rows == 0) { throw new ExecutorManagerExceptio... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... |
@Test public void testUnassignExecutor() throws ExecutorManagerException, IOException { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); String host = "localhost"; int port = 12345; Executor executor = loader.addExecutor(host, port); ExecutableFlow flow = TestUtils.createExecutableFlow("exectest1... | @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.update(UPDATE, executionId); if (rows == 0) { throw new ExecutorManagerExceptio... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void unassignExecutor(int executionId) throws ExecutorManagerException { final String UPDATE = "UPDATE execution_flows SET executor_id=NULL where exec_id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.u... |
@Test public void testFetchMissingExecutorByExecution() throws ExecutorManagerException, IOException { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); Assert.assertEquals(loader.fetchExecutorByExecutionId(1), null); } | @Override public Executor fetchExecutorByExecutionId(int executionId) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); Executor executor = null; try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_EXECUTIO... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutorByExecutionId(int executionId) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); Executor executor = null; try... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutorByExecutionId(int executionId) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); Executor executor = null; try... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutorByExecutionId(int executionId) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); Executor executor = null; try... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutorByExecutionId(int executionId) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); Executor executor = null; try... |
@Test public void testFetchQueuedFlows() throws ExecutorManagerException, IOException { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Pair<ExecutionReference, ExecutableFlow>> queuedFlows = new LinkedList<Pair<ExecutionReference, ExecutableFlow>>(); ExecutableFlow flow = TestUtils.createE... | @Override public List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchQueuedExecutableFlows flowHandler = new FetchQueuedExecutableFlows(); try { List<Pair<ExecutionReference, ExecutableFlow>> flows = runner.query(FetchQueuedE... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchQueuedExecutableFlows flowHandler = new FetchQueuedExecutableFlows(); try { Li... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchQueuedExecutableFlows flowHandler = new FetchQueuedExecutableFlows(); try { Li... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchQueuedExecutableFlows flowHandler = new FetchQueuedExecutableFlows(); try { Li... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Pair<ExecutionReference, ExecutableFlow>> fetchQueuedFlows() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchQueuedExecutableFlows flowHandler = new FetchQueuedExecutableFlows(); try { Li... |
@Test public void testFetchEmptyExecutors() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = loader.fetchAllExecutors(); Assert.assertEquals(executors.size(), 0); } | @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_ALL_EXECUTORS, executorHandler); return executors; }... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... |
@Test public void testFetchEmptyActiveExecutors() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = loader.fetchActiveExecutors(); Assert.assertEquals(executors.size(), 0); } | @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_ACTIVE_EXECUTORS, executorHandler); return execut... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... |
@Test(timeout = 4000) public void simulateNotOKStatusCodeTest() { Props props = new Props(); String url = buildUrlForStatusCode(404); props.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.url", url); List<HttpRequestBase> httpRequestList = JobCallbackUtil.parseJobCallbackProperties(pr... | public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http request: " + httpRequest.t... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... |
@Test public void testFetchMissingExecutorId() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); Executor executor = loader.fetchExecutor(0); Assert.assertEquals(executor, null); } | @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_EXECUTOR_BY_HOST_PORT, executorHandler, h... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... |
@Test public void testFetchMissingExecutorHostPort() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); Executor executor = loader.fetchExecutor("localhost", 12345); Assert.assertEquals(executor, null); } | @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_EXECUTOR_BY_HOST_PORT, executorHandler, h... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... |
@Test public void testFetchEmptyExecutorEvents() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); Executor executor = new Executor(1, "localhost", 12345, true); List<ExecutorLogEvent> executorEvents = loader.getExecutorEvents(executor, 5, 0); Assert.assertEquals(executorEvents.... | @Override public List<ExecutorLogEvent> getExecutorEvents(Executor executor, int num, int offset) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); ExecutorLogsResultHandler logHandler = new ExecutorLogsResultHandler(); List<ExecutorLogEvent> events = null; try { events = runner.query(Executor... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<ExecutorLogEvent> getExecutorEvents(Executor executor, int num, int offset) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); ExecutorLogsResultHandler logHandler = new ExecutorLogsResultHandler... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<ExecutorLogEvent> getExecutorEvents(Executor executor, int num, int offset) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); ExecutorLogsResultHandler logHandler = new ExecutorLogsResultHandler... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<ExecutorLogEvent> getExecutorEvents(Executor executor, int num, int offset) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); ExecutorLogsResultHandler logHandler = new ExecutorLogsResultHandler... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<ExecutorLogEvent> getExecutorEvents(Executor executor, int num, int offset) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); ExecutorLogsResultHandler logHandler = new ExecutorLogsResultHandler... |
@Test public void testDuplicateAddExecutor() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); try { String host = "localhost"; int port = 12345; loader.addExecutor(host, port); loader.addExecutor(host, port); Assert.fail("Expecting exception, but didn't get one"); } catch (Exec... | @Override public Executor addExecutor(String host, int port) throws ExecutorManagerException { Executor executor = fetchExecutor(host, port); if (executor != null) { throw new ExecutorManagerException(String.format( "Executor %s:%d already exist", host, port)); } addExecutorHelper(host, port); executor = fetchExecutor(... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor addExecutor(String host, int port) throws ExecutorManagerException { Executor executor = fetchExecutor(host, port); if (executor != null) { throw new ExecutorManagerException(String.format( "Executor %s:%d already ex... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor addExecutor(String host, int port) throws ExecutorManagerException { Executor executor = fetchExecutor(host, port); if (executor != null) { throw new ExecutorManagerException(String.format( "Executor %s:%d already ex... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor addExecutor(String host, int port) throws ExecutorManagerException { Executor executor = fetchExecutor(host, port); if (executor != null) { throw new ExecutorManagerException(String.format( "Executor %s:%d already ex... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor addExecutor(String host, int port) throws ExecutorManagerException { Executor executor = fetchExecutor(host, port); if (executor != null) { throw new ExecutorManagerException(String.format( "Executor %s:%d already ex... |
@Test public void testMissingExecutorUpdate() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); try { Executor executor = new Executor(1, "localhost", 1234, true); loader.updateExecutor(executor); Assert.fail("Expecting exception, but didn't get one"); } catch (ExecutorManagerEx... | @Override public void updateExecutor(Executor executor) throws ExecutorManagerException { final String UPDATE = "UPDATE executors SET host=?, port=?, active=? where id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.update(UPDATE, executor.getHost(), executor.getPort(), executor.isActive(), execut... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void updateExecutor(Executor executor) throws ExecutorManagerException { final String UPDATE = "UPDATE executors SET host=?, port=?, active=? where id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.upda... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void updateExecutor(Executor executor) throws ExecutorManagerException { final String UPDATE = "UPDATE executors SET host=?, port=?, active=? where id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.upda... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void updateExecutor(Executor executor) throws ExecutorManagerException { final String UPDATE = "UPDATE executors SET host=?, port=?, active=? where id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.upda... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public void updateExecutor(Executor executor) throws ExecutorManagerException { final String UPDATE = "UPDATE executors SET host=?, port=?, active=? where id=?"; QueryRunner runner = createQueryRunner(); try { int rows = runner.upda... |
@Test public void testSingleExecutorFetchById() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = addTestExecutors(loader); for (Executor executor : executors) { Executor fetchedExecutor = loader.fetchExecutor(executor.getId()); Assert.assertEquals(exe... | @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_EXECUTOR_BY_HOST_PORT, executorHandler, h... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... |
@Test public void testFetchAllExecutors() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = addTestExecutors(loader); executors.get(0).setActive(false); loader.updateExecutor(executors.get(0)); List<Executor> fetchedExecutors = loader.fetchAllExecutors... | @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_ALL_EXECUTORS, executorHandler); return executors; }... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchAllExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(F... |
@Test public void testFetchActiveExecutors() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = addTestExecutors(loader); executors.get(0).setActive(false); loader.updateExecutor(executors.get(0)); List<Executor> fetchedExecutors = loader.fetchActiveExe... | @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_ACTIVE_EXECUTORS, executorHandler); return execut... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public List<Executor> fetchActiveExecutors() throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.quer... |
@Test public void testSingleExecutorFetchHostPort() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); List<Executor> executors = addTestExecutors(loader); for (Executor executor : executors) { Executor fetchedExecutor = loader.fetchExecutor(executor.getHost(), executor.getPort()... | @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = runner.query(FetchExecutorHandler.FETCH_EXECUTOR_BY_HOST_PORT, executorHandler, h... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public Executor fetchExecutor(String host, int port) throws ExecutorManagerException { QueryRunner runner = createQueryRunner(); FetchExecutorHandler executorHandler = new FetchExecutorHandler(); try { List<Executor> executors = run... |
@SuppressWarnings("static-access") @Ignore @Test public void testRemoveExecutionLogsByTime() throws ExecutorManagerException, IOException, InterruptedException { ExecutorLoader loader = createLoader(); File logDir = new File(UNIT_BASE_DIR + "logtest"); File[] largelog = { new File(logDir, "largeLog1.log"), new File(log... | @Override public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException { final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?"; QueryRunner runner = createQueryRunner(); int updateNum = 0; try { updateNum = runner.update(DELETE_BY_TIME, millis); } catch (SQLException e) {... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException { final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?"; QueryRunner runner = createQueryRunner(); int updateNum = 0; try {... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException { final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?"; QueryRunner runner = createQueryRunner(); int updateNum = 0; try {... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException { final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?"; QueryRunner runner = createQueryRunner(); int updateNum = 0; try {... | JdbcExecutorLoader extends AbstractJdbcLoader implements
ExecutorLoader { @Override public int removeExecutionLogsByTime(long millis) throws ExecutorManagerException { final String DELETE_BY_TIME = "DELETE FROM execution_logs WHERE upload_time < ?"; QueryRunner runner = createQueryRunner(); int updateNum = 0; try {... |
@Test(timeout = 4000) public void unResponsiveGetTest() { Props props = new Props(); String url = buildUrlForDelay(10); props.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.url", url); List<HttpRequestBase> httpRequestList = JobCallbackUtil.parseJobCallbackProperties(props, JobCallba... | public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http request: " + httpRequest.t... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... |
@Test public void createErrorEmail() throws Exception { setJobStatus(Status.FAILED); executableFlow.setEndTime(END_TIME_MILLIS); executableFlow.setStatus(Status.FAILED); assertTrue(mailCreator.createErrorEmail( executableFlow, message, azkabanName, scheme, clientHostname, clientPortNumber)); assertEquals("Flow 'mail-cr... | @Override public boolean createErrorEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getFailureEmails(); int execId = flow.getExecuti... | DefaultMailCreator implements MailCreator { @Override public boolean createErrorEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getF... | DefaultMailCreator implements MailCreator { @Override public boolean createErrorEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getF... | DefaultMailCreator implements MailCreator { @Override public boolean createErrorEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getF... | DefaultMailCreator implements MailCreator { @Override public boolean createErrorEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getF... |
@Test public void createFirstErrorMessage() throws Exception { setJobStatus(Status.FAILED); executableFlow.setStatus(Status.FAILED_FINISHING); assertTrue(mailCreator.createFirstErrorMessage( executableFlow, message, azkabanName, scheme, clientHostname, clientPortNumber)); assertEquals("Flow 'mail-creator-test' has enco... | @Override public boolean createFirstErrorMessage(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getFailureEmails(); int execId = flow.get... | DefaultMailCreator implements MailCreator { @Override public boolean createFirstErrorMessage(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = opti... | DefaultMailCreator implements MailCreator { @Override public boolean createFirstErrorMessage(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = opti... | DefaultMailCreator implements MailCreator { @Override public boolean createFirstErrorMessage(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = opti... | DefaultMailCreator implements MailCreator { @Override public boolean createFirstErrorMessage(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = opti... |
@Test public void createSuccessEmail() throws Exception { setJobStatus(Status.SUCCEEDED); executableFlow.setEndTime(END_TIME_MILLIS); executableFlow.setStatus(Status.SUCCEEDED); assertTrue(mailCreator.createSuccessEmail( executableFlow, message, azkabanName, scheme, clientHostname, clientPortNumber)); assertEquals("Flo... | @Override public boolean createSuccessEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.getSuccessEmails(); int execId = flow.getExecu... | DefaultMailCreator implements MailCreator { @Override public boolean createSuccessEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.ge... | DefaultMailCreator implements MailCreator { @Override public boolean createSuccessEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.ge... | DefaultMailCreator implements MailCreator { @Override public boolean createSuccessEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.ge... | DefaultMailCreator implements MailCreator { @Override public boolean createSuccessEmail(ExecutableFlow flow, EmailMessage message, String azkabanName, String scheme, String clientHostname, String clientPortNumber, String... vars) { ExecutionOptions option = flow.getExecutionOptions(); List<String> emailList = option.ge... |
@Ignore @Test public void testMySQLAutoCreate() throws Exception { clearMySQLTestDb(); URL resourceUrl = Resources.getResource("conf/dbtestmysql"); assertNotNull(resourceUrl); File resource = new File(resourceUrl.toURI()); String confDir = resource.getParent(); System.out.println("1.***Now testing check"); AzkabanDatab... | public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Void> updateOption = parser.... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... |
@Test public void testH2AutoCreate() throws Exception { URL resourceUrl = Resources.getResource("conf/dbtesth2"); assertNotNull(resourceUrl); File resource = new File(resourceUrl.toURI()); String confDir = resource.getParent(); System.out.println("1.***Now testing check"); AzkabanDatabaseUpdater.main(new String[] { "-c... | public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Void> updateOption = parser.... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... | AzkabanDatabaseUpdater { public static void main(String[] args) throws Exception { OptionParser parser = new OptionParser(); OptionSpec<String> scriptDirectory = parser .acceptsAll(Arrays.asList("s", "script"), "Directory of update scripts.").withRequiredArg() .describedAs("script").ofType(String.class); OptionSpec<Voi... |
@Test public void noJobCallbackProps() { Props jobProps = new Props(); Set<String> errors = new HashSet<String>(); Assert.assertEquals(0, JobCallbackValidator.validate("bogusJob", serverProps, jobProps, errors)); Assert.assertEquals(0, errors.size()); } | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void sequenceStartWithZeroProps() { Props jobProps = new Props(); Set<String> errors = new HashSet<String>(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".0.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.COMPLETED.name().toLowerCase() + ".... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void oneGetJobCallback() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: Set<String> errors = new HashSet<String>(); Assert.assertEquals(1, JobCallbackValidator.validate("bogusJob", serverProps, jobProps, errors)); Ass... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void onePostJobCallback() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.method", JobCallbackConstants.HTTP_POST); jobProps.p... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void multiplePostJobCallbacks() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.method", JobCallbackConstants.HTTP_POST); jobP... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test(timeout = 4000) public void basicPostTest() { Props props = new Props(); String url = buildUrlForDelay(1); props.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.url", url); props.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.method", JobCallb... | public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http request: " + httpRequest.t... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... | JobCallbackRequestMaker { public void makeHttpRequest(String jobId, Logger logger, List<HttpRequestBase> httpRequestList) { if (httpRequestList == null || httpRequestList.isEmpty()) { logger.info("No HTTP requests to make"); return; } for (HttpRequestBase httpRequest : httpRequestList) { logger.info("Job callback http ... |
@Test public void noPostBodyJobCallback() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.method", JobCallbackConstants.HTTP_POST); Set<Str... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void multipleGetJobCallbacks() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.STARTED.name().toLowerCase() + ".1.url", "http: Set<String> errors = new HashSet<S... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void multipleGetJobCallbackWithGap() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".2.url", "http: jobProps.put("job.notificati... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void postBodyLengthTooLargeTest() { Props jobProps = new Props(); jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.url", "http: jobProps.put("job.notification." + JobCallbackStatusEnum.FAILURE.name().toLowerCase() + ".1.method", JobCallbackConstants.HTTP_POST); St... | public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MAX_POST_BODY_LENGTH_PROP... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... | JobCallbackValidator { public static int validate(String jobName, Props serverProps, Props jobProps, Collection<String> errors) { int maxNumCallback = serverProps.getInt( JobCallbackConstants.MAX_CALLBACK_COUNT_PROPERTY_KEY, JobCallbackConstants.DEFAULT_MAX_CALLBACK_COUNT); int maxPostBodyLength = serverProps.getInt(MA... |
@Test public void conditionTest() { Map<String, ConditionChecker> checkers = new HashMap<String, ConditionChecker>(); ThresholdChecker fake1 = new ThresholdChecker("thresholdchecker1", 10); ThresholdChecker fake2 = new ThresholdChecker("thresholdchecker2", 20); ThresholdChecker.setVal(15); checkers.put(fake1.getId(), f... | public Condition(Map<String, ConditionChecker> checkers, String expr) { setCheckers(checkers); this.expression = jexl.createExpression(expr); updateNextCheckTime(); } | Condition { public Condition(Map<String, ConditionChecker> checkers, String expr) { setCheckers(checkers); this.expression = jexl.createExpression(expr); updateNextCheckTime(); } } | Condition { public Condition(Map<String, ConditionChecker> checkers, String expr) { setCheckers(checkers); this.expression = jexl.createExpression(expr); updateNextCheckTime(); } Condition(Map<String, ConditionChecker> checkers, String expr); Condition(Map<String, ConditionChecker> checkers, String expr,
long ne... | Condition { public Condition(Map<String, ConditionChecker> checkers, String expr) { setCheckers(checkers); this.expression = jexl.createExpression(expr); updateNextCheckTime(); } Condition(Map<String, ConditionChecker> checkers, String expr); Condition(Map<String, ConditionChecker> checkers, String expr,
long ne... | Condition { public Condition(Map<String, ConditionChecker> checkers, String expr) { setCheckers(checkers); this.expression = jexl.createExpression(expr); updateNextCheckTime(); } Condition(Map<String, ConditionChecker> checkers, String expr); Condition(Map<String, ConditionChecker> checkers, String expr,
long ne... |
@Ignore @Test public void addTriggerTest() throws TriggerLoaderException { Trigger t1 = createTrigger("testProj1", "testFlow1", "source1"); Trigger t2 = createTrigger("testProj2", "testFlow2", "source2"); loader.addTrigger(t1); List<Trigger> ts = loader.loadTriggers(); assertTrue(ts.size() == 1); Trigger t3 = ts.get(0)... | @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigger(connection, t, defaultEncodingType); } catch (Exception e) { throw new Tr... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigg... |
@Ignore @Test public void removeTriggerTest() throws TriggerLoaderException { Trigger t1 = createTrigger("testProj1", "testFlow1", "source1"); Trigger t2 = createTrigger("testProj2", "testFlow2", "source2"); loader.addTrigger(t1); loader.addTrigger(t2); List<Trigger> ts = loader.loadTriggers(); assertTrue(ts.size() == ... | @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTriggerId()); if (removes == 0) { throw new TriggerLoaderException("No trigger ha... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTrigg... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTrigg... |
@Ignore @Test public void updateTriggerTest() throws TriggerLoaderException { Trigger t1 = createTrigger("testProj1", "testFlow1", "source1"); t1.setResetOnExpire(true); loader.addTrigger(t1); List<Trigger> ts = loader.loadTriggers(); assertTrue(ts.get(0).isResetOnExpire() == true); t1.setResetOnExpire(false); loader.u... | @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { updateTrigger(connection, t, defaultEncoding... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection conn... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection conn... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection conn... | JdbcTriggerLoader extends AbstractJdbcLoader implements
TriggerLoader { @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection conn... |
@Test public void testCommonPluginProps() throws Exception { JobTypePluginSet pluginSet = manager.getJobTypePluginSet(); Props props = pluginSet.getCommonPluginJobProps(); System.out.println(props.toString()); assertEquals("commonprop1", props.getString("commonprop1")); assertEquals("commonprop2", props.getString("comm... | public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); void loadPlugins(); Job buildJobExecutor(String jobId, Props jobProps, Logger logger); synchronized JobTypePluginSe... | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); void loadPlugins(); Job buildJobExecutor(String jobId, Props jobProps, Logger logger); synchronized JobTypePluginSe... |
@Test public void testLoadedClasses() throws Exception { JobTypePluginSet pluginSet = manager.getJobTypePluginSet(); Props props = pluginSet.getCommonPluginJobProps(); System.out.println(props.toString()); assertEquals("commonprop1", props.getString("commonprop1")); assertEquals("commonprop2", props.getString("commonpr... | public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); } | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); void loadPlugins(); Job buildJobExecutor(String jobId, Props jobProps, Logger logger); synchronized JobTypePluginSe... | JobTypeManager { public synchronized JobTypePluginSet getJobTypePluginSet() { return this.pluginSet; } JobTypeManager(String jobtypePluginDir, Props globalProperties,
ClassLoader parentClassLoader); void loadPlugins(); Job buildJobExecutor(String jobId, Props jobProps, Logger logger); synchronized JobTypePluginSe... |
@Test public void noCallbackPropertiesTest() { Props props = new Props(); props.put("abc", "def"); Assert.assertFalse(JobCallbackUtil.isThereJobCallbackProperty(props, JobCallbackStatusEnum.STARTED)); Assert.assertFalse(JobCallbackUtil.isThereJobCallbackProperty(props, JobCallbackStatusEnum.COMPLETED)); Assert.assertFa... | public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl); } | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... |
@Test public void testBuildClass() throws Exception { Props jobProps = new Props(); jobProps.put("type", "anothertestjob"); jobProps.put("test", "test1"); jobProps.put("pluginprops3", "4"); Job job = manager.buildJobExecutor("anothertestjob", jobProps, logger); assertTrue(job instanceof FakeJavaJob); FakeJavaJob fjj = ... | public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionException(String.fo... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... |
@Test public void testBuildClass2() throws Exception { Props jobProps = new Props(); jobProps.put("type", "testjob"); jobProps.put("test", "test1"); jobProps.put("pluginprops3", "4"); Job job = manager.buildJobExecutor("testjob", jobProps, logger); assertTrue(job instanceof FakeJavaJob2); FakeJavaJob2 fjj = (FakeJavaJo... | public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionException(String.fo... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... | JobTypeManager { public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionEx... |
@Test public void testGoodResolveProps() throws IOException { Props propsGrandParent = new Props(); Props propsParent = new Props(propsGrandParent); Props props = new Props(propsParent); props.put("letter", "a"); propsParent.put("letter", "b"); propsGrandParent.put("letter", "c"); Assert.assertEquals("a", props.get("le... | public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = resolveVariable... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... |
@Test public void testInvalidSyntax() throws Exception { Props propsGrandParent = new Props(); Props propsParent = new Props(propsGrandParent); Props props = new Props(propsParent); propsParent.put("my", "name"); props.put("res1", "$(my)"); Props resolved = PropsUtils.resolveProps(props); Assert.assertEquals("$(my)", r... | public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = resolveVariable... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... |
@Test public void testExpressionResolution() throws IOException { Props props = Props.of("normkey", "normal", "num1", "1", "num2", "2", "num3", "3", "variablereplaced", "${num1}", "expression1", "$(1+10)", "expression2", "$(1+10)*2", "expression3", "$($(${num1} + ${num3})*10)", "expression4", "$(${num1} + ${expression3... | public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = resolveVariable... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... |
@Test public void testGetPropertyDiff() throws IOException { Props oldProps = new Props(); Props newProps1 = new Props(); oldProps.put("a", "a_value1"); oldProps.put("b", "b_value1"); newProps1.put("b", "b_value2"); String message1 = PropsUtils.getPropertyDiff(oldProps, newProps1); Assert.assertEquals(message1, "Delete... | public static String getPropertyDiff(Props oldProps, Props newProps) { StringBuilder builder = new StringBuilder(""); MapDifference<String, String> md = Maps.difference(toStringMap(oldProps, false), toStringMap(newProps, false)); Map<String, String> newlyCreatedProperty = md.entriesOnlyOnRight(); if (newlyCreatedProper... | PropsUtils { public static String getPropertyDiff(Props oldProps, Props newProps) { StringBuilder builder = new StringBuilder(""); MapDifference<String, String> md = Maps.difference(toStringMap(oldProps, false), toStringMap(newProps, false)); Map<String, String> newlyCreatedProperty = md.entriesOnlyOnRight(); if (newly... | PropsUtils { public static String getPropertyDiff(Props oldProps, Props newProps) { StringBuilder builder = new StringBuilder(""); MapDifference<String, String> md = Maps.difference(toStringMap(oldProps, false), toStringMap(newProps, false)); Map<String, String> newlyCreatedProperty = md.entriesOnlyOnRight(); if (newly... | PropsUtils { public static String getPropertyDiff(Props oldProps, Props newProps) { StringBuilder builder = new StringBuilder(""); MapDifference<String, String> md = Maps.difference(toStringMap(oldProps, false), toStringMap(newProps, false)); Map<String, String> newlyCreatedProperty = md.entriesOnlyOnRight(); if (newly... | PropsUtils { public static String getPropertyDiff(Props oldProps, Props newProps) { StringBuilder builder = new StringBuilder(""); MapDifference<String, String> md = Maps.difference(toStringMap(oldProps, false), toStringMap(newProps, false)); Map<String, String> newlyCreatedProperty = md.entriesOnlyOnRight(); if (newly... |
@Test public void testLookupInterpolate() { Props props = Props.of("YYYY", "${DD:(YYYY)}", "YYYY-1", "${DD:(YYYY-1)}", "MM", "${DD:(MM)}", "MM-1", "${DD:(MM-1)}", "DD", "${DD:(DD)}", "DD-1", "${DD:(DD-1)}", "HH", "${DD:(HH)}", "HH-1", "${DD:(HH-1)}", "HH+2", "${DD:(HH+2)}", "mm", "${DD:(mm)}"); Props resolved = PropsUt... | public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = resolveVariable... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... | PropsUtils { public static Props resolveProps(Props props) { if (props == null) return null; Props resolvedProps = new Props(); LinkedHashSet<String> visitedVariables = new LinkedHashSet<String>(); for (String key : props.getKeySet()) { String value = props.get(key); visitedVariables.add(key); String replacedValue = re... |
@Test public void isBrowser() throws Exception { for (String browser : browserVariants) { Assert.assertTrue(browser, StringUtils.isFromBrowser(browser)); } } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void notBrowserWithLowercase() throws Exception { for (String browser : browserVariants) { Assert.assertFalse(browser.toLowerCase(), StringUtils.isFromBrowser(browser.toLowerCase())); } } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void notBrowser() throws Exception { String testStr = "curl"; Assert.assertFalse(testStr, StringUtils.isFromBrowser(testStr)); } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void hasCallbackPropertiesTest() { Props props = new Props(); for (JobCallbackStatusEnum jobStatus : JobCallbackStatusEnum.values()) { props.put( "job.notification." + jobStatus.name().toLowerCase() + ".1.url", "def"); } System.out.println(props); Assert.assertTrue(JobCallbackUtil.isThereJobCallbackPropert... | public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl); } | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... |
@Test public void emptyBrowserString() throws Exception { Assert.assertFalse("empty string", StringUtils.isFromBrowser("")); } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void nullBrowserString() throws Exception { Assert.assertFalse("null string", StringUtils.isFromBrowser(null)); } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void startsWithBrowserName() { for (String name : BROWSER_NAMES) { Assert.assertTrue(StringUtils.isFromBrowser(name + " is awesome")); } } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void endsWithBrowserName() { for (String name : BROWSER_NAMES) { Assert.assertTrue(StringUtils.isFromBrowser("awesome is" + name)); } } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void containsBrowserName() { for (String name : BROWSER_NAMES) { Assert.assertTrue(StringUtils.isFromBrowser("awesome " + name + " is")); } } | public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } } | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... | StringUtils { public static boolean isFromBrowser(String userAgent) { if (userAgent == null) { return false; } if (BROWSWER_PATTERN.matcher(userAgent).matches()) { return true; } else { return false; } } static String shellQuote(String s, char quoteCh); @Deprecated static String join(List<String> list, String delimite... |
@Test public void testWhenNoXForwardedForHeaderUseClientIp(){ String clientIp = "127.0.0.1:10000"; Map<String, String> headers = new HashMap<>(); WebUtils utils = new WebUtils(); String ip = utils.getRealClientIpAddr(headers, clientIp); assertEquals(ip, "127.0.0.1"); } | public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); clientIp = ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... |
@Test public void testWhenClientIpNoPort(){ String clientIp = "192.168.1.1"; Map<String, String> headers = new HashMap<>(); WebUtils utils = new WebUtils(); String ip = utils.getRealClientIpAddr(headers, clientIp); assertEquals(ip, "192.168.1.1"); } | public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); clientIp = ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... |
@Test public void testWhenXForwardedForHeaderUseHeader(){ String clientIp = "127.0.0.1:10000"; String upstreamIp = "192.168.1.1:10000"; Map<String, String> headers = new HashMap<>(); headers.put("X-Forwarded-For", upstreamIp); WebUtils utils = new WebUtils(); String ip = utils.getRealClientIpAddr(headers, clientIp); as... | public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); clientIp = ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... |
@Test public void testWhenXForwardedForHeaderMultipleUpstreamsUseHeader(){ String clientIp = "127.0.0.1:10000"; String upstreamIp = "192.168.1.1:10000"; Map<String, String> headers = new HashMap<>(); headers.put("X-Forwarded-For", upstreamIp + ",127.0.0.1,55.55.55.55"); WebUtils utils = new WebUtils(); String ip = util... | public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); clientIp = ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... | WebUtils { public String getRealClientIpAddr(Map<String, String> httpHeaders, String remoteAddr){ String clientIp = httpHeaders.getOrDefault(X_FORWARDED_FOR_HEADER, null); if(clientIp == null){ clientIp = remoteAddr; } else{ String ips[] = clientIp.split(","); clientIp = ips[0]; } String parts[] = clientIp.split(":"); ... |
@Ignore @Test public void testSendEmail() throws IOException { em.addToAddress(toAddr); em.setSubject("azkaban test email"); em.setBody("azkaban test email"); try { em.sendEmail(); } catch (MessagingException e) { e.printStackTrace(); } } | public void sendEmail() throws MessagingException { checkSettings(); Properties props = new Properties(); if (_usesAuth) { props.put("mail." + protocol + ".auth", "true"); props.put("mail.user", _mailUser); props.put("mail.password", _mailPassword); } else { props.put("mail." + protocol + ".auth", "false"); } props.put... | EmailMessage { public void sendEmail() throws MessagingException { checkSettings(); Properties props = new Properties(); if (_usesAuth) { props.put("mail." + protocol + ".auth", "true"); props.put("mail.user", _mailUser); props.put("mail.password", _mailPassword); } else { props.put("mail." + protocol + ".auth", "false... | EmailMessage { public void sendEmail() throws MessagingException { checkSettings(); Properties props = new Properties(); if (_usesAuth) { props.put("mail." + protocol + ".auth", "true"); props.put("mail.user", _mailUser); props.put("mail.password", _mailPassword); } else { props.put("mail." + protocol + ".auth", "false... | EmailMessage { public void sendEmail() throws MessagingException { checkSettings(); Properties props = new Properties(); if (_usesAuth) { props.put("mail." + protocol + ".auth", "true"); props.put("mail.user", _mailUser); props.put("mail.password", _mailPassword); } else { props.put("mail." + protocol + ".auth", "false... | EmailMessage { public void sendEmail() throws MessagingException { checkSettings(); Properties props = new Properties(); if (_usesAuth) { props.put("mail." + protocol + ".auth", "true"); props.put("mail.user", _mailUser); props.put("mail.password", _mailPassword); } else { props.put("mail." + protocol + ".auth", "false... |
@Test public void multipleStatusWithNoJobCallbackTest() { Props props = new Props(); props.put("abc", "def"); Assert.assertFalse(JobCallbackUtil.isThereJobCallbackProperty(props, JobCallbackStatusEnum.STARTED, JobCallbackStatusEnum.COMPLETED, JobCallbackStatusEnum.FAILURE, JobCallbackStatusEnum.SUCCESS)); } | public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl); } | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... | JobCallbackUtil { public static boolean isThereJobCallbackProperty(Props props, JobCallbackStatusEnum status) { if (props == null || status == null) { throw new NullPointerException("One of the argument is null"); } String jobCallBackUrl = firstJobcallbackPropertyMap.get(status); return props.containsKey(jobCallBackUrl... |
@Test public void testIsRgbValue() throws Exception { System.out.println("#6688 is color " + StringUtils.isRgbValue("#6688")); System.out.println("#070A01 is color " + StringUtils.isRgbValue("#668899")); System.out.println("dd8899 is color " + StringUtils.isRgbValue("dd8899")); System.out.println("#yy8899 is color " + ... | public static boolean isRgbValue(String color){ Pattern pattern = Pattern.compile("^#(([0123456789abcdefABCDEF]{6})|([0123456789abcdefABCDEF]{8}))$"); Matcher matcher = pattern.matcher(color); return matcher.matches(); } | StringUtils { public static boolean isRgbValue(String color){ Pattern pattern = Pattern.compile("^#(([0123456789abcdefABCDEF]{6})|([0123456789abcdefABCDEF]{8}))$"); Matcher matcher = pattern.matcher(color); return matcher.matches(); } } | StringUtils { public static boolean isRgbValue(String color){ Pattern pattern = Pattern.compile("^#(([0123456789abcdefABCDEF]{6})|([0123456789abcdefABCDEF]{8}))$"); Matcher matcher = pattern.matcher(color); return matcher.matches(); } } | StringUtils { public static boolean isRgbValue(String color){ Pattern pattern = Pattern.compile("^#(([0123456789abcdefABCDEF]{6})|([0123456789abcdefABCDEF]{8}))$"); Matcher matcher = pattern.matcher(color); return matcher.matches(); } static boolean isRgbValue(String color); } | StringUtils { public static boolean isRgbValue(String color){ Pattern pattern = Pattern.compile("^#(([0123456789abcdefABCDEF]{6})|([0123456789abcdefABCDEF]{8}))$"); Matcher matcher = pattern.matcher(color); return matcher.matches(); } static boolean isRgbValue(String color); } |
@Test public void urlDecode() throws Exception { String s = "%E4%B8%8A%E6%B5%B7%E5%B8%82%E6%99%AE%E9%99%80%E5%8C%BA%E5%85%89%E5%A4%8D%E8%A5%BF%E8%B7%AF%E9%9D%A0%E8%BF%91%E6%B1%87%E9%93%B6%E9%93%AD%E5%B0%8A6%E5%8F%B7%E6%A5%BC"; s = EncodeUtils.urlDecode(s); System.out.println(s); } | public static String urlDecode(String encode){ try { return URLDecoder.decode(encode,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } | EncodeUtils { public static String urlDecode(String encode){ try { return URLDecoder.decode(encode,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } } | EncodeUtils { public static String urlDecode(String encode){ try { return URLDecoder.decode(encode,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } private EncodeUtils(); } | EncodeUtils { public static String urlDecode(String encode){ try { return URLDecoder.decode(encode,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } private EncodeUtils(); static String urlEncode(String s); static String urlDecode(String encode); } | EncodeUtils { public static String urlDecode(String encode){ try { return URLDecoder.decode(encode,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return null; } private EncodeUtils(); static String urlEncode(String s); static String urlDecode(String encode); } |
@Test public void go() { Money money = new Money(BigDecimal.valueOf(new Random().nextDouble()).multiply(BigDecimal.valueOf(10000))); System.out.println(money.toString()); money = new Money(new BigDecimal("2820.00000000000000000000")); System.out.println(money.toString()); assertThat(true) .isTrue(); } | @Override public String toString() { return format.format(amount); } | Money implements Serializable { @Override public String toString() { return format.format(amount); } } | Money implements Serializable { @Override public String toString() { return format.format(amount); } } | Money implements Serializable { @Override public String toString() { return format.format(amount); } @Override String toString(); } | Money implements Serializable { @Override public String toString() { return format.format(amount); } @Override String toString(); static final NumberFormat format; } |
@Test public void testDelete() throws Exception { int randomNum = random.nextInt(10); while (randomNum-- > 0) { toAdd(); } Tag tag = tagRepository.findAll().stream().max(new RandomComparator()).orElse(null); if (tag == null) { return; } MainGood mainGood = mainGoodService.forSale().stream().max(new RandomComparator()).... | @DeleteMapping("/manage/tagList") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@RequestParam String name) { try { tagService.delete(name); } catch (Throwable ignored) { log.info("删除时错误", ignored); } } | ManageTagController { @DeleteMapping("/manage/tagList") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@RequestParam String name) { try { tagService.delete(name); } catch (Throwable ignored) { log.info("删除时错误", ignored); } } } | ManageTagController { @DeleteMapping("/manage/tagList") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@RequestParam String name) { try { tagService.delete(name); } catch (Throwable ignored) { log.info("删除时错误", ignored); } } } | ManageTagController { @DeleteMapping("/manage/tagList") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@RequestParam String name) { try { tagService.delete(name); } catch (Throwable ignored) { log.info("删除时错误", ignored); } } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd... | ManageTagController { @DeleteMapping("/manage/tagList") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@RequestParam String name) { try { tagService.delete(name); } catch (Throwable ignored) { log.info("删除时错误", ignored); } } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd... |
@Test public void disable() throws Exception { changeDisable("/disable", true); } | @PutMapping("/manage/tagList/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(true); } | ManageTagController { @PutMapping("/manage/tagList/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(true); } } | ManageTagController { @PutMapping("/manage/tagList/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(true); } } | ManageTagController { @PutMapping("/manage/tagList/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(true); } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage... | ManageTagController { @PutMapping("/manage/tagList/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(true); } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage... |
@Test public void enable() throws Exception { changeDisable("/enable", false); } | @PutMapping("/manage/tagList/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(false); } | ManageTagController { @PutMapping("/manage/tagList/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(false); } } | ManageTagController { @PutMapping("/manage/tagList/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(false); } } | ManageTagController { @PutMapping("/manage/tagList/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(false); } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/... | ManageTagController { @PutMapping("/manage/tagList/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@RequestParam String name) { tagRepository.getOne(name).setDisabled(false); } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/... |
@Test public void check() throws Exception{ toAdd(); Tag tag = tagRepository.findAll().stream().max(new RandomComparator()).orElse(null); if (tag == null) { return; } MvcResult result = mockMvc.perform(get(TAG_LIST_URL + "/check") .param("name",tag.getName())) .andExpect(status().is2xxSuccessful()) .andReturn(); assert... | @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } | ManageTagController { @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } } | ManageTagController { @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } } | ManageTagController { @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/tagDetail") String detail(@RequestParam String name, Model model); @GetMapping("/manage/tagEdit") String e... | ManageTagController { @GetMapping("/manageTagAdd") public String toAdd() { return "_tagOperator.html"; } @GetMapping("/manageTag") String index(); @GetMapping("/manageTagAdd") String toAdd(); @GetMapping("/manage/tagDetail") String detail(@RequestParam String name, Model model); @GetMapping("/manage/tagEdit") String e... |
@Test public void index(){ Manager manager = newRandomManager(ManageLevel.root); updateAllRunWith(manager); String title = RandomStringUtils.randomAscii(10); commonProblemService.addAndEditCommonProblem(null, title,50 , RandomStringUtils.randomAscii(20)); driver.get("http: ManageHelpCenterPage manageHelpCenterPage = in... | @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } | ManageCommonProblemController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } } | ManageCommonProblemController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } } | ManageCommonProblemController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Logi... | ManageCommonProblemController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Login.ROLE_LOOK + "')") @GetMapping("/manage/commonProblem") public String index() { return "operation-management/_helpCenter.html"; } @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_PRODUCT_CENTER + "','" + Logi... |
@Test public void pages() throws Exception { driver.get("http: System.out.println(driver.getPageSource()); addUser(); Login lastOne = loginRepository.findAll(new Sort(Sort.Direction.DESC, "id")).get(0); driver.get("http: System.out.println(driver.getPageSource()); assertThat(true) .isTrue(); } | @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirectAttributes) { Login curre... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... |
@Test public void list() throws Exception { addUser(); mockMvc.perform( get("/manage/managers") ) .andExpect(status().isOk()) .andDo(print()); assertThat(true) .isTrue(); } | @GetMapping("/manage/managers") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition list(String name, String department, String realName) { return new RowDefinition<Manager>() { @Override public Class<Manager> entityClass() { return Manager.class; } @Override public List<Field... | ManageManagerController { @GetMapping("/manage/managers") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition list(String name, String department, String realName) { return new RowDefinition<Manager>() { @Override public Class<Manager> entityClass() { return Manager.class; } @... | ManageManagerController { @GetMapping("/manage/managers") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition list(String name, String department, String realName) { return new RowDefinition<Manager>() { @Override public Class<Manager> entityClass() { return Manager.class; } @... | ManageManagerController { @GetMapping("/manage/managers") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition list(String name, String department, String realName) { return new RowDefinition<Manager>() { @Override public Class<Manager> entityClass() { return Manager.class; } @... | ManageManagerController { @GetMapping("/manage/managers") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition list(String name, String department, String realName) { return new RowDefinition<Manager>() { @Override public Class<Manager> entityClass() { return Manager.class; } @... |
@Test public void addUser() throws Exception { final String loginName = randomMobile(); Collection<ManageLevel> levelSet = randomLevel(); mockMvc.perform( paramLevel(post("/manage/managers") .param("name", loginName) .param("department", RandomStringUtils.randomAlphabetic(10)) .param("realName", RandomStringUtils.rando... | @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirectAttributes) { Login curre... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... | ManageManagerController { @PreAuthorize("hasAnyRole('ROOT','" + Login.ROLE_GRANT + "')") @PostMapping("/manage/managers") @Transactional public String addUser(String name, String department, String realName, boolean enable, String comment , String[] role, @AuthenticationPrincipal Login login, RedirectAttributes redirec... |
@Test public void index() throws Exception { driver.get("http: assertThat(driver.getTitle()) .isEqualTo("仓库管理"); driver.get("http: assertThat(driver.getTitle()) .isEqualTo("新仓库"); } | @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } } | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } } | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") String ... | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") public String index() { return "_depotManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageDepot") String ... |
@Test public void data() throws Exception { add(); mockMvc.perform( get("/manage/depotList") ) .andExpect(status().isOk()) .andDo(print()) .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) .andExpect(similarJQueryDataTable("classpath:/manage-view/mock/depotList.json")); } | @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(time, String.class)) { @Override public... | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(time, String.cl... | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(time, String.cl... | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(time, String.cl... | ManageDepotController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/depotList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new DepotRows(time -> conversionService.convert(time, String.cl... |
@Test public void init() throws Exception { Manager root = managerRepository.findByLoginName("root"); System.out.println(root); assertThat(root) .isNotNull(); } | @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publishEvent(new InitDone()); } | InitService { @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publishEvent(new In... | InitService { @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publishEvent(new In... | InitService { @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publishEvent(new In... | InitService { @PostConstruct @Transactional @Order(Ordered.HIGHEST_PRECEDENCE) public void init() throws IOException, SQLException { commons(); database(); upgrade(); managers(); productTypes(); depots(); products(); others(); mainOrderService.createExecutorToForPayOrder(); applicationEventPublisher.publishEvent(new In... |
@Test public void add() throws Exception { addNewHaierDepot(); addNewManuallyDepot(); } | @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHaierCode(haierCode); depot = haierDepot... | ManageDepotController { @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHaierCode(haierC... | ManageDepotController { @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHaierCode(haierC... | ManageDepotController { @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHaierCode(haierC... | ManageDepotController { @PostMapping("/manage/depotList") public String add(String name, Address address, String haierCode, String type, String chargePeopleName , String chargePeopleMobile) { Depot depot; if ("HaierDepot".equalsIgnoreCase(type)) { HaierDepot haierDepot = new HaierDepot(); haierDepot.setHaierCode(haierC... |
@Test public void disable() throws Exception { changeEnable("disable", false); } | @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } | ManageDepotController { @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } } | ManageDepotController { @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } } | ManageDepotController { @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapp... | ManageDepotController { @PutMapping("/manage/depotList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapp... |
@Test public void enable() throws Exception { changeEnable("enable", true); } | @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } | ManageDepotController { @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } } | ManageDepotController { @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } } | ManageDepotController { @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping... | ManageDepotController { @PutMapping("/manage/depotList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { depotRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping... |
@Test public void index() throws Exception { driver.get("http: assertThat(driver.getTitle()) .isEqualTo("工厂管理"); driver.get("http: assertThat(driver.getTitle()) .isEqualTo("新工厂"); } | @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } } | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } } | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory")... | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory") public String index() { return "_factoryManage.html"; } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manageFactory")... |
@Test public void data() throws Exception { add(); mockMvc.perform( get("/manage/factoryList") ) .andExpect(status().isOk()) .andDo(print()) .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) .andExpect(similarJQueryDataTable("classpath:/manage-view/mock/factoryList.json")); } | @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override public List<Order> defaultOrder(CriteriaBuil... | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override public List<Order>... | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override public List<Order>... | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override public List<Order>... | ManageFactoryController { @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetMapping("/manage/factoryList") @RowCustom(distinct = true, dramatizer = JQueryDataTableDramatizer.class) public RowDefinition data() { return new RowDefinition<Factory>() { @Override public List<Order>... |
@Test public void add() throws Exception { addNewFactory(); } | @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddress(address); factory.setChargePeopleName... | ManageFactoryController { @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddress(address); f... | ManageFactoryController { @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddress(address); f... | ManageFactoryController { @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddress(address); f... | ManageFactoryController { @PostMapping("/manage/factoryList") public String add(String name, Address address, String chargePeopleName , String chargePeopleMobile) { Factory factory = new Factory(); factory.setEnable(true); factory.setCreateTime(LocalDateTime.now()); factory.setName(name); factory.setAddress(address); f... |
@Test public void disable() throws Exception { changeEnable("disable", false); } | @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @G... | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/disable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void disable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(false); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @G... |
@Test public void enable() throws Exception { changeEnable("enable", true); } | @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } } | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetM... | ManageFactoryController { @PutMapping("/manage/factoryList/{id}/enable") @ResponseStatus(HttpStatus.NO_CONTENT) @Transactional public void enable(@PathVariable("id") long id) { factoryRepository.getOne(id).setEnable(true); } @PreAuthorize("hasAnyRole('ROOT','"+ Login.ROLE_SUPPLY_CHAIN+"','"+Login.ROLE_LOOK+"')") @GetM... |
@Test @Ignore public void myTeam() throws InterruptedException { Login master = newRandomAgent(); randomAgentTree(master); login = getSubAgents(master).stream() .max(new RandomComparator()).orElse(null).getLogin(); WechatMyPage myPage = getWechatMyPage(); Set<Login> agentLogin = agentLevelRepository.findAll().stream() ... | private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttribute("agentLevel", "普通用户"); return "... | WechatMyController { private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttribute("agentLeve... | WechatMyController { private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttribute("agentLeve... | WechatMyController { private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttribute("agentLeve... | WechatMyController { private String myTeam(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (loginService.isRegularLogin(login)) model.addAttribute("agentLevel", agentService.loginTitle(agentService.highestAgent(login))); else model.addAttribute("agentLeve... |
@Test public void share() throws Exception { final Login newUser = createNewUserByShare(); System.out.println(newUser); } | @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService.wechatShareMoreUri; model.addAttribut... | WechatShareController { @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService.wechatShareMo... | WechatShareController { @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService.wechatShareMo... | WechatShareController { @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService.wechatShareMo... | WechatShareController { @GetMapping(SystemService.wechatShareUri) public String share(@AuthenticationPrincipal Login loginInput, Model model) { Login login = loginService.get(loginInput.getId()); if (!loginService.isRegularLogin(login) && !loginService.allowShare(login)) return "redirect:" + SystemService.wechatShareMo... |
@Test public void sendRegisterCode() throws Exception { mockMvc.perform(post("/misc/sendRegisterCode") .contentType(MediaType.APPLICATION_FORM_URLENCODED) .param("mobile", randomMobile()) ) .andExpect(status().isOk()) .andExpect(jsonPath("$.resultCode").value(200)); final String mobile = randomMobile(); loginService.ne... | @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCodeService.sendCode(mobile, logi... | MiscController { @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCodeService.send... | MiscController { @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCodeService.send... | MiscController { @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCodeService.send... | MiscController { @RequestMapping(method = RequestMethod.POST, value = "/misc/sendRegisterCode") @ResponseBody public ApiResult sendRegisterCode(String mobile) throws IOException { if (loginService.byLoginName(mobile) != null) { return ApiResult.withCodeAndMessage(401, "该手机号码已被人使用", null); } verificationCodeService.send... |
@Test public void bindWithPassword() throws Exception { WeixinUserDetail detail = nextCurrentWechatAccount(); LoginPage loginPage = getLoginPageForBrowseIndex(); String rawPassword = UUID.randomUUID().toString(); Login login = newRandomAgent(rawPassword); loginPage.login(login.getLoginName(), rawPassword + 1); loginPag... | @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if (StringUtils.isEmp... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... |
@Test public void testMallIndex() throws IOException, InterruptedException { LoginPage loginPage = getLoginPageForBrowseIndex(); String rawPassword = UUID.randomUUID().toString(); Login login = newRandomAgent(rawPassword); for (TagType tagType : TagType.values()) { for (int i = 0; i < 3 + random.nextInt(2); i++) { newR... | @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if (StringUtils.isEmp... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... | WechatController { @GetMapping("/toLoginWechat") public String login(WeixinUserDetail detail, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace(detail); Login login = loginService.asWechat(detail.getOpenId()); if (login == null) return "redirect:/wechatLogin"; if... |
@Test public void wechatForwardTest(){ String rawPassword = UUID.randomUUID().toString(); Login login = newRandomAgent(rawPassword); MainGood mainGood = mainGoodService.forSale().stream().findAny().get(); String shareUrl = "http: LoginPage loginPage = getLoginPageForBrowseIndex(); loginPage.login(login.getLoginName(), ... | @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if(authentication == null || ... | WechatController { @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if(authent... | WechatController { @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if(authent... | WechatController { @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if(authent... | WechatController { @GetMapping("/wechatForward/{goodId}_{id}") public String wechatForward(@OpenId String openId,@PathVariable Long goodId,@PathVariable Long id , HttpServletRequest request, HttpServletResponse response){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if(authent... |
@Test public void index() throws Exception { String title = RandomStringUtils.randomAscii(10); commonProblemService.addAndEditCommonProblem(null, title,50 , RandomStringUtils.randomAscii(20)); driver.get("http: HelpCenterPage page = initPage(HelpCenterPage.class); page.assertHasTopic(title); HelpDetailPage helpDetailPa... | @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } | WechatCommonProblemController { @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } } | WechatCommonProblemController { @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } } | WechatCommonProblemController { @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } @GetMapping("/commonProblemDetail/{id}") String commonProblemDetail(@PathVariable Long id, Model model); @GetMapping("/commonProblem/search") @ResponseBody Map<String, Object> search... | WechatCommonProblemController { @GetMapping(SystemService.helpCenterURi) public String index(){ return "wechat@helpCenter/index.html"; } @GetMapping("/commonProblemDetail/{id}") String commonProblemDetail(@PathVariable Long id, Model model); @GetMapping("/commonProblem/search") @ResponseBody Map<String, Object> search... |
@Test public void upgrade1() throws Exception { upgrade(1, 4); } | @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throws SystemMaintainException,... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... |
@Test public void upgrade2() throws Exception { upgrade(2, 3); } | @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throws SystemMaintainException,... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... | WechatUpgradeController { @PostMapping("/wechatUpgrade") @Transactional public ModelAndView upgrade(@AuthenticationPrincipal Login login, String agentName, int newLevel, Address address , String cardFrontPath , String cardBackPath, String businessLicensePath, String upgradeMode, HttpServletRequest servletRequest) throw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.