Skip to content

Instantly share code, notes, and snippets.

public class RegexText {
public static void main(String[] args) {
final String[] testStrings = {
"v2/rt.do.reg1/t", // Match
"v2/a1.b2.c2/t", // Match
"v2/a1;b2;c2/t", // Match
"v2/a1-b2-c2/t", // Match
"v3/rt.do.reg1/t", // Not Match
import sys
import os
OUTPUTS_FOLDER_NAME = 'outputs'
OUTPUT_FILE_FORMATS = ['.html']
ASK_BEFORE_DELETE = True
DEBUG = False
Process finished with exit code 130 (interrupted by signal 2: SIGINT)
2020-04-01 12:23:47,802 [main] WARN o.s.c.s.GenericApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [ts_kv]
2020-04-01 12:23:48,938 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@7676b2b9] to prepare test instance [org.thingsboard.server.dao.service.attributes.s
@agtokty
agtokty / Extensions.cs
Last active April 17, 2019 10:44
make async call sync and get result.
public static class Extensions
{
public static T MakeSync<T>(this Task<T> task)
{
task.Wait();
return task.Result;
}
}
example :
// <copyright file="LeastRecentlyUsedCache.cs" company="http://www.sinbadsoft.com">
// Copyright (c) Chaker Nakhli 2013
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
// License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
// applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
// governing permissions and limitations under the License.
// </copyright>
// <author>Chaker Nakhli</author>
// <email>Chaker.Nakhli@sinbadsoft.com</email>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr4.Runtime" version="4.5.3" targetFramework="net452" />
<package id="Castle.Core" version="4.0.0" targetFramework="net452" />
<package id="Common.Logging" version="3.3.1" targetFramework="net452" />
<package id="Common.Logging.Core" version="3.3.1" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
var cVal = getParam(process.argv,"--c");//kek
var tVal = getParam(process.argv,"--t");//lol
function getParam(argv, paramName){
if (argv.indexOf(paramName) != -1)
return argv[argv.indexOf(paramName) + 1];
else
return null;
}
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Log for test s0001/d804e2503_1/d804e39809_1
Test sos:GRTRequestNulloffering_resultRetrieval type Mandatory default result Passed (s0001/d804e2503_1/d804e39809_1)
Assertion: Send a request with null parameter &quot;offering&quot;,and the response must be a valid exception with code &quot;MissingParameterValue&quot; and locator &quot;offering&quot;.
Request d804e41268_1:
Method: post
URL: http://91.93.170.242:49685/Swe.svc/
Body: