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 getFreeURLsPostRequest() { assertArrayEquals(autowiredSc.getFreeURLsPostRequest(), freeURLsPostRequestBind.split(SEPARATOR)); } | public String[] getFreeURLsPostRequest() { return freeURLsPostRequest.split(";"); } | SecurityConst { public String[] getFreeURLsPostRequest() { return freeURLsPostRequest.split(";"); } } | SecurityConst { public String[] getFreeURLsPostRequest() { return freeURLsPostRequest.split(";"); } } | SecurityConst { public String[] getFreeURLsPostRequest() { return freeURLsPostRequest.split(";"); } String[] getFreeURLsAnyRequest(); String[] getFreeURLsGetRequest(); String[] getFreeURLsPostRequest(); } | SecurityConst { public String[] getFreeURLsPostRequest() { return freeURLsPostRequest.split(";"); } String[] getFreeURLsAnyRequest(); String[] getFreeURLsGetRequest(); String[] getFreeURLsPostRequest(); static final String AUTHORITIES_SEPARATOR; static final String ACCESS_TOKEN_URL; static final String USERNAME_HOLDER... |
@Test public void getBAuthorizationDAOOK() { daoProvider = new DAOProvider(queryService); ReflectionTestUtils.setField(daoProvider, URL, URL_VALUE); Assert.assertNotNull(daoProvider.getBAuthorizationDAO()); } | public BAuthorizationDAO getBAuthorizationDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBAuthorizationDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } | DAOProvider { public BAuthorizationDAO getBAuthorizationDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBAuthorizationDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } } | DAOProvider { public BAuthorizationDAO getBAuthorizationDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBAuthorizationDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); } | DAOProvider { public BAuthorizationDAO getBAuthorizationDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBAuthorizationDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); BAuthorizationDAO g... | DAOProvider { public BAuthorizationDAO getBAuthorizationDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBAuthorizationDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); BAuthorizationDAO g... |
@Test public void getBPermissionDAOOK() { daoProvider = new DAOProvider(queryService); ReflectionTestUtils.setField(daoProvider, URL, URL_VALUE); Assert.assertNotNull(daoProvider.getBPermissionDAO()); } | public BPermissionDAO getBPermissionDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBPermissionDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } | DAOProvider { public BPermissionDAO getBPermissionDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBPermissionDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } } | DAOProvider { public BPermissionDAO getBPermissionDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBPermissionDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); } | DAOProvider { public BPermissionDAO getBPermissionDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBPermissionDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); BAuthorizationDAO getBAuthor... | DAOProvider { public BPermissionDAO getBPermissionDAO() { if (DatabaseDriver.fromJdbcUrl(url) == DatabaseDriver.POSTGRESQL) { return new PostgreSQLBPermissionDAO(queryService); } throw new NullPointerException(NOT_IMPLEMENTED_YET); } @Autowired DAOProvider(final QueryService queryService); BAuthorizationDAO getBAuthor... |
@Test public void shouldReturnExpectedRandomsFor5And9() { assertThat(rand.nextInt(5), equalTo(2)); assertThat(rand.nextInt(9), equalTo(3)); assertThat(rand.nextInt(5), equalTo(3)); assertThat(rand.nextInt(9), equalTo(3)); assertThat(rand.nextInt(5), equalTo(3)); assertThat(rand.nextInt(9), equalTo(8)); assertThat(rand.... | @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } } | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... |
@Test(expected = UnsupportedOperationException.class) public void shouldFailForOthers() { rand.nextInt(3); } | @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } } | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... | ReplayingRandom extends Random { @Override public int nextInt(int n) { if (n == 5) { return getNextValueOf(fives, indexInFives++); } else if (n == 9) { return getNextValueOf(nines, indexInNines++); } throw new UnsupportedOperationException("not expected invocation of nextInt(" + n + ")"); } ReplayingRandom(String five,... |
@Test public void testWriteExcel() { HttpServletResponseExcelWrite.build(fileName, request, response) .deal(ExcelDataList.getTitle(), get(), ExcelDataList.getTenList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new CopyInputStreamExcelWrite(inputStream,... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... |
@Test public void testCglibGetProxy() { ProxyFactory proxyFactory = new ProxyFactory(); Audi audi = new Audi(); TargetSource targetSource = new SingletonTargetSource(audi); proxyFactory.setTargetSource(targetSource); Advisor[] advisors = new Advisor[1]; advisors[0] = advisorAdapterRegistry.wrap(new TestMethodIntercepto... | public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... |
@Test public void testIsMultipleProxy() { Bmw bmw = new Bmw(); ProxyFactory proxyFactory1 = new ProxyFactory(); TargetSource targetSource1 = new SingletonTargetSource(bmw); proxyFactory1.setTargetSource(targetSource1); Advisor[] advisors = new Advisor[1]; advisors[0] = advisorAdapterRegistry.wrap(new TestMethodIntercep... | public static boolean isMultipleProxy(Object proxy) { try { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return false; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory); TargetSource targetSource = (TargetSource) accessor.getPropertyV... | SpringProxyUtils { public static boolean isMultipleProxy(Object proxy) { try { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return false; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory); TargetSource targetSource = (TargetSource) ac... | SpringProxyUtils { public static boolean isMultipleProxy(Object proxy) { try { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return false; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory); TargetSource targetSource = (TargetSource) ac... | SpringProxyUtils { public static boolean isMultipleProxy(Object proxy) { try { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return false; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory); TargetSource targetSource = (TargetSource) ac... | SpringProxyUtils { public static boolean isMultipleProxy(Object proxy) { try { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return false; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory); TargetSource targetSource = (TargetSource) ac... |
@Test public void testGetRealTarget() { Bmw bmw = new Bmw(); ProxyFactory proxyFactory1 = new ProxyFactory(); TargetSource targetSource1 = new SingletonTargetSource(bmw); proxyFactory1.setTargetSource(targetSource1); Advisor[] advisors = new Advisor[1]; advisors[0] = advisorAdapterRegistry.wrap(new TestMethodIntercepto... | public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... |
@Test public void testFindJdkDynamicProxyFactory() { ProxyFactory proxyFactory = new ProxyFactory(); Bmw bmw = new Bmw(); TargetSource targetSource = new SingletonTargetSource(bmw); proxyFactory.setTargetSource(targetSource); Class<?>[] targetInterfaces = ClassUtils.getAllInterfacesForClass(bmw.getClass()); for (Class<... | public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } | SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } } | SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } } | SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } static T getRealTarget... | SpringProxyUtils { public static ProxyFactory findJdkDynamicProxyFactory(Object proxy) { InvocationHandler h = Proxy.getInvocationHandler(proxy); ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(h); return (ProxyFactory) accessor.getPropertyValue("advised"); } static T getRealTarget... |
@Test public void testGetRealTarget2() { Bmw bmw = new Bmw(); ProxyFactory proxyFactory1 = new ProxyFactory(); TargetSource targetSource1 = new SingletonTargetSource(bmw); proxyFactory1.setTargetSource(targetSource1); Advisor[] advisors = new Advisor[1]; advisors[0] = advisorAdapterRegistry.wrap(new TestMethodIntercept... | public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(proxyFactory... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... | SpringProxyUtils { public static <T> T getRealTarget(Object proxy) { Assert.notNull(proxy, "proxy not null"); while (AopUtils.isAopProxy(proxy)) { ProxyFactory proxyFactory = getProxyFactory(proxy); if (proxyFactory == null) { return null; } ConfigurablePropertyAccessor accessor = PropertyAccessorFactory.forDirectField... |
@Test public void testGetFactory() { try { ServiceLocator.getBean("test"); } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), "没有注入spring factory"); } } | public static ApplicationContext getFactory() { Assert.notNull(factory, "没有注入spring factory"); return factory; } | ServiceLocator implements ApplicationContextAware { public static ApplicationContext getFactory() { Assert.notNull(factory, "没有注入spring factory"); return factory; } } | ServiceLocator implements ApplicationContextAware { public static ApplicationContext getFactory() { Assert.notNull(factory, "没有注入spring factory"); return factory; } } | ServiceLocator implements ApplicationContextAware { public static ApplicationContext getFactory() { Assert.notNull(factory, "没有注入spring factory"); return factory; } static ApplicationContext getFactory(); static void setFactory(ApplicationContext context); @SuppressWarnings("unchecked") static T getBean(String beanNam... | ServiceLocator implements ApplicationContextAware { public static ApplicationContext getFactory() { Assert.notNull(factory, "没有注入spring factory"); return factory; } static ApplicationContext getFactory(); static void setFactory(ApplicationContext context); @SuppressWarnings("unchecked") static T getBean(String beanNam... |
@Test public void testDoParse() { final Map<String, String> placeholderVals = new HashMap<>(5); placeholderVals.put("key1", "china"); placeholderVals.put("key2", "3"); placeholderVals.put("key3", "beijin"); String testStr = "hello ${key1}"; PlaceholderResolver resolver = new PlaceholderResolver(placeholderVals::get); r... | public String doParse(String strVal) { if (strVal == null) { return null; } return parseStringValue(strVal, visitedPlaceholders); } | PlaceholderResolver { public String doParse(String strVal) { if (strVal == null) { return null; } return parseStringValue(strVal, visitedPlaceholders); } } | PlaceholderResolver { public String doParse(String strVal) { if (strVal == null) { return null; } return parseStringValue(strVal, visitedPlaceholders); } PlaceholderResolver(PlaceholderResolved resolvedInterceptor); } | PlaceholderResolver { public String doParse(String strVal) { if (strVal == null) { return null; } return parseStringValue(strVal, visitedPlaceholders); } PlaceholderResolver(PlaceholderResolved resolvedInterceptor); String doParse(String strVal); boolean hasPlaceHolder(String strVal); static boolean substringMatch(Char... | PlaceholderResolver { public String doParse(String strVal) { if (strVal == null) { return null; } return parseStringValue(strVal, visitedPlaceholders); } PlaceholderResolver(PlaceholderResolved resolvedInterceptor); String doParse(String strVal); boolean hasPlaceHolder(String strVal); static boolean substringMatch(Char... |
@Test public void testInit() { Company company = new Company(); BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(company); bw.setPropertyValue("name", "Some Company Inc."); PropertyValue value = new PropertyValue("name", "Some Company Inc1."); bw.setPropertyValue(value); Employee employee = new Employee()... | @Override public final void init(FilterConfig filterConfig) throws ServletException { Assert.notNull(filterConfig, "FilterConfig must not be null"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initializing filter '" + filterConfig.getFilterName() + "'"); } initPlaceHolderConfigure(filterConfig); try { PropertyValues p... | JndiSupportFilter implements Filter { @Override public final void init(FilterConfig filterConfig) throws ServletException { Assert.notNull(filterConfig, "FilterConfig must not be null"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initializing filter '" + filterConfig.getFilterName() + "'"); } initPlaceHolderConfigure... | JndiSupportFilter implements Filter { @Override public final void init(FilterConfig filterConfig) throws ServletException { Assert.notNull(filterConfig, "FilterConfig must not be null"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initializing filter '" + filterConfig.getFilterName() + "'"); } initPlaceHolderConfigure... | JndiSupportFilter implements Filter { @Override public final void init(FilterConfig filterConfig) throws ServletException { Assert.notNull(filterConfig, "FilterConfig must not be null"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initializing filter '" + filterConfig.getFilterName() + "'"); } initPlaceHolderConfigure... | JndiSupportFilter implements Filter { @Override public final void init(FilterConfig filterConfig) throws ServletException { Assert.notNull(filterConfig, "FilterConfig must not be null"); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Initializing filter '" + filterConfig.getFilterName() + "'"); } initPlaceHolderConfigure... |
@Test public void testFindModel() { List<EasyUITreeModel> json = service.findChildren(getList(), p -> { EasyUITreeModel m = new EasyUITreeModel(); m.setId(p.getParamId()); m.setText(p.getParamName()); m.setPid(p.getParamType()); return m; }); assertNotNull(json); } | private EasyUITreeModel findModel(List<T> list, Function<T, EasyUITreeModel> mc) { if (null == list) { throw new RuntimeException("没有EasyUI菜单"); } Map<Integer, EasyUITreeModel> p = new HashMap<>(list.size() + 1); EasyUITreeModel root = new EasyUITreeModel(); root.setId(0); p.put(root.getId(), root); findModel(list, p, ... | EasyUITreeServiceImpl implements EasyUITreeService<T> { private EasyUITreeModel findModel(List<T> list, Function<T, EasyUITreeModel> mc) { if (null == list) { throw new RuntimeException("没有EasyUI菜单"); } Map<Integer, EasyUITreeModel> p = new HashMap<>(list.size() + 1); EasyUITreeModel root = new EasyUITreeModel(); root.... | EasyUITreeServiceImpl implements EasyUITreeService<T> { private EasyUITreeModel findModel(List<T> list, Function<T, EasyUITreeModel> mc) { if (null == list) { throw new RuntimeException("没有EasyUI菜单"); } Map<Integer, EasyUITreeModel> p = new HashMap<>(list.size() + 1); EasyUITreeModel root = new EasyUITreeModel(); root.... | EasyUITreeServiceImpl implements EasyUITreeService<T> { private EasyUITreeModel findModel(List<T> list, Function<T, EasyUITreeModel> mc) { if (null == list) { throw new RuntimeException("没有EasyUI菜单"); } Map<Integer, EasyUITreeModel> p = new HashMap<>(list.size() + 1); EasyUITreeModel root = new EasyUITreeModel(); root.... | EasyUITreeServiceImpl implements EasyUITreeService<T> { private EasyUITreeModel findModel(List<T> list, Function<T, EasyUITreeModel> mc) { if (null == list) { throw new RuntimeException("没有EasyUI菜单"); } Map<Integer, EasyUITreeModel> p = new HashMap<>(list.size() + 1); EasyUITreeModel root = new EasyUITreeModel(); root.... |
@Test public void testWriteSingleLtMaxSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle(), get(), ExcelDataList.getTenList())... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteSingleGtMaxSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle(), get(), ExcelDataList.getList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getTenList()) .deal(getTitle1(), get1(), ExcelDataList.getTenList1()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetOverMaxCountExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle1(), get1(), ExcelDataList.getTenList1()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetNullExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), null) .deal(getTitle1(), get1(), null) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetEmptyExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), new ArrayList<>()) .deal(getTitle1(), get1(), new ArrayList<>()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetOverMaxTwoCountExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle1(), get1(), ExcelDataList.getTenList1()) .deal(getTitle(), get(), ExcelDataList.getList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetOverMaxTwoDoubleCountExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle1(), get1(), ExcelDataList.getTenList1()) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle1(), get1(), ExcelDataL... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameLtMaxExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(g... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteExcelByInputStream() { HttpServletResponseExcelWrite.build(this.getClass().getResourceAsStream("/c.xls"), fileName, request, response) .deal(new WriteDeal<ExcelDto>() { public String[] dealBean(ExcelDto obj) { String[] result = new String[3]; result[0] = obj.getId() + ""; result[1] = obj.getN... | public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new CopyInputStreamExcelWrite(inputStream,... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... | HttpServletResponseExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonN... |
@Test public void testWriteMultipleSheetAndNameLtMaxDisorderExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getTenList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameOverMaxCountExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameNullExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), null) .deal(getTitle1(), getTestName(), null) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameEmptyExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), new ArrayList<>()) .deal(getTitle1(), getTestName(), new ArrayList<>()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameOverMaxCountTwoExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList()) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .writ... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameOverMaxCountTwoDisorderExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList(... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetAndNameOverMaxCountTwoTwoDisorderExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), getExcelDtoName(), ExcelDataList.getList()) .deal(getTitle1(), getTestName(), ExcelDataList.getTenList1()) .deal(getTitle1(), getTestName(), ExcelDataList.getList1... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteExcelByInputStream() { FileExcelWrite.build(this.getClass().getResourceAsStream("/c.xls"), fileName) .setLargeDataMode(false) .deal(new WriteDeal<ExcelDto>() { public String[] dealBean(ExcelDto obj) { String[] result = new String[3]; result[0] = obj.getId() + ""; result[1] = obj.getName(); re... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteMultipleSheetExcelByInputStream() { FileExcelWrite.build(this.getClass().getResourceAsStream("/d.xls"), fileName) .setLargeDataMode(true) .deal(new WriteDeal<ExcelDto>() { public String[] dealBean(ExcelDto obj) { String[] result = new String[3]; result[0] = obj.getId() + ""; result[1] = obj.g... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test(expectedExceptions = IllegalArgumentException.class) public void testWriteExcelOverMaxCountExceptionByInputStream() { FileExcelWrite.build(this.getClass().getResourceAsStream("/c.xls"), fileName) .setLargeDataMode(true) .deal(new WriteDeal<ExcelDto>() { public String[] dealBean(ExcelDto obj) { String[] result = n... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteSingleOverMaxSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testWriteExcelMaxCountByInputStream() { List<ExcelDto> list = ExcelDataList.getList(); list.remove(65535); list.remove(65534); list.remove(65533); list.remove(65532); FileExcelWrite.build(this.getClass().getResourceAsStream("/c.xls"), fileName) .setLargeDataMode(true) .deal(new WriteDeal<ExcelDto>() {... | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testRead() { ExcelRead.read(ExcelReadTest.class.getResourceAsStream("/a.xls"), new ExcelReadDeal<ExcelReadDto>() { @Override public ExcelReadDto dealBean(Row row) { ExcelReadDto dto = new ExcelReadDto(); dto.setId(new BigDecimal(row.getCell(0).toString()).longValue()); dto.setName(row.getCell(1).toStr... | public static <E> void read(InputStream inputStream, ExcelReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (Workbook wb = WorkbookFactory.create(inputStream)) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); if (null == sheet) { continue; } i... | ExcelRead { public static <E> void read(InputStream inputStream, ExcelReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (Workbook wb = WorkbookFactory.create(inputStream)) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); if (null == sheet) { c... | ExcelRead { public static <E> void read(InputStream inputStream, ExcelReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (Workbook wb = WorkbookFactory.create(inputStream)) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); if (null == sheet) { c... | ExcelRead { public static <E> void read(InputStream inputStream, ExcelReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (Workbook wb = WorkbookFactory.create(inputStream)) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); if (null == sheet) { c... | ExcelRead { public static <E> void read(InputStream inputStream, ExcelReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (Workbook wb = WorkbookFactory.create(inputStream)) { for (int i = 0; i < wb.getNumberOfSheets(); i++) { Sheet sheet = wb.getSheetAt(i); if (null == sheet) { c... |
@Test public void testRead() { CSVRead.read(CSVReadTest.class.getResourceAsStream("/a.csv"), new CSVReadDeal<CsvReadDto>() { @Override public CsvReadDto dealBean(String[] arr) { CsvReadDto dto = new CsvReadDto(); dto.setId(Long.valueOf(arr[0])); dto.setName(arr[1]); dto.setAge(Integer.valueOf(arr[2])); return dto; } @O... | public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int i = 0; St... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... |
@Test public void testRead1() { CSVParser parser = new CSVParserBuilder().withSeparator('|').withIgnoreQuotations(true).build(); CSVRead.read(CSVReadTest.class.getResourceAsStream("/a1.csv"), new CSVReadDeal<CsvReadDto>() { @Override public CsvReadDto dealBean(String[] arr) { CsvReadDto dto = new CsvReadDto(); dto.setI... | public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int i = 0; St... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... | CSVRead { public static <E> void read(InputStream inputStream, CSVReadDeal<E> deal) { Objects.requireNonNull(inputStream); Objects.requireNonNull(deal); try (CSVReader reader = new CSVReader(new InputStreamReader(new DataInputStream(inputStream)))) { int tmp = deal.getBatchCount(); List<E> l = new ArrayList<>(tmp); int... |
@Test public void testWrite() { String path = FilePdfWriteTest.class.getResource("/d.html").getPath(); FilePdfWrite.build(fileName) .addFontPath(fontPath) .deal(() -> { File file = new File(path); String html = null; try { html = FileUtils.readFileToString(file, Charset.forName("GBK")); } catch (IOException e) { e.prin... | public static FilePdfWrite build(String fileName) { Objects.requireNonNull(fileName); return new FilePdfWrite(fileName); } | FilePdfWrite extends AbstractPdfWrite { public static FilePdfWrite build(String fileName) { Objects.requireNonNull(fileName); return new FilePdfWrite(fileName); } } | FilePdfWrite extends AbstractPdfWrite { public static FilePdfWrite build(String fileName) { Objects.requireNonNull(fileName); return new FilePdfWrite(fileName); } private FilePdfWrite(String fileName); } | FilePdfWrite extends AbstractPdfWrite { public static FilePdfWrite build(String fileName) { Objects.requireNonNull(fileName); return new FilePdfWrite(fileName); } private FilePdfWrite(String fileName); @Override PdfWrite createOutputStream(); static FilePdfWrite build(String fileName); } | FilePdfWrite extends AbstractPdfWrite { public static FilePdfWrite build(String fileName) { Objects.requireNonNull(fileName); return new FilePdfWrite(fileName); } private FilePdfWrite(String fileName); @Override PdfWrite createOutputStream(); static FilePdfWrite build(String fileName); } |
@Test public void testWrite() { String path = FilePdfWriteTest.class.getResource("/d.html").getPath(); HttpServletResponsePdfWrite.build(fileName, request, response) .addFontPath(fontPath) .deal(() -> { File file = new File(path); String html = null; try { html = FileUtils.readFileToString(file, Charset.forName("GBK"))... | public static HttpServletResponsePdfWrite build(String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new HttpServletResponsePdfWrite(fileName, request, response); } | HttpServletResponsePdfWrite extends AbstractPdfWrite { public static HttpServletResponsePdfWrite build(String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new HttpServletResponsePdfWrite(... | HttpServletResponsePdfWrite extends AbstractPdfWrite { public static HttpServletResponsePdfWrite build(String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new HttpServletResponsePdfWrite(... | HttpServletResponsePdfWrite extends AbstractPdfWrite { public static HttpServletResponsePdfWrite build(String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new HttpServletResponsePdfWrite(... | HttpServletResponsePdfWrite extends AbstractPdfWrite { public static HttpServletResponsePdfWrite build(String fileName, HttpServletRequest request, HttpServletResponse response) { Objects.requireNonNull(fileName); Objects.requireNonNull(request); Objects.requireNonNull(response); return new HttpServletResponsePdfWrite(... |
@Test public void testGetMessageCustomExceptionAndCustomMessage() { try { try { String s = null; s.toString(); } catch (Exception e) { String[] str = {"a", "b"}; throw new SystemException("first={0}, second={1}", e, str); } } catch (Exception e) { assertEquals(e.getMessage(), "first=a, second=b"); } } | public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t instanceof SQLException) { oldMessage = getSQLExcep... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... |
@Test public void testGetMessageCustomMessage() { try { try { String s = null; s.toString(); } catch (Exception e) { throw new SystemException("自定义异常信息"); } } catch (Exception e) { assertEquals(e.getMessage(), "自定义异常信息"); } } | public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t instanceof SQLException) { oldMessage = getSQLExcep... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... |
@Test public void testGetMessageNullPointerException() { try { try { String s = null; s.toString(); } catch (Exception e) { throw new SystemException(e); } } catch (SystemException e) { assertEquals(e.getMessage(), "空指针异常"); } } | public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t instanceof SQLException) { oldMessage = getSQLExcep... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... |
@Test public void testGetMessageCustomExceptionAndMessage() { try { try { String s = null; s.toString(); } catch (Exception e) { throw new SystemException("自定义异常信息", e); } } catch (Exception e) { assertEquals(e.getMessage(), "空指针异常"); } } | public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t instanceof SQLException) { oldMessage = getSQLExcep... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... | SystemException extends BaseSystemException { public String getMessage(Throwable t) { String oldMessage; if (t instanceof InvocationTargetException) { oldMessage = getMessage(((InvocationTargetException) t).getTargetException()); } else if (t instanceof SystemException) { oldMessage = t.getMessage(); } else if (t insta... |
@Test public void testWriteSingleNullSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), null) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testMatch() { String s = "/time/;jsessionid=6E697A0D5DDDBC4F7206250E5E594305js/frame/menuModel.js"; assertTrue(PathPatternMatcher.match("*.js", s)); } | public static boolean match(String pattern, String str) { if (str.startsWith("/") != pattern.startsWith("/")) { return false; } List patDirs = tokenizePath(pattern); List strDirs = tokenizePath(str); int patIdxStart = 0; int patIdxEnd = patDirs.size() - 1; int strIdxStart = 0; int strIdxEnd = strDirs.size() - 1; while ... | PathPatternMatcher { public static boolean match(String pattern, String str) { if (str.startsWith("/") != pattern.startsWith("/")) { return false; } List patDirs = tokenizePath(pattern); List strDirs = tokenizePath(str); int patIdxStart = 0; int patIdxEnd = patDirs.size() - 1; int strIdxStart = 0; int strIdxEnd = strDi... | PathPatternMatcher { public static boolean match(String pattern, String str) { if (str.startsWith("/") != pattern.startsWith("/")) { return false; } List patDirs = tokenizePath(pattern); List strDirs = tokenizePath(str); int patIdxStart = 0; int patIdxEnd = patDirs.size() - 1; int strIdxStart = 0; int strIdxEnd = strDi... | PathPatternMatcher { public static boolean match(String pattern, String str) { if (str.startsWith("/") != pattern.startsWith("/")) { return false; } List patDirs = tokenizePath(pattern); List strDirs = tokenizePath(str); int patIdxStart = 0; int patIdxEnd = patDirs.size() - 1; int strIdxStart = 0; int strIdxEnd = strDi... | PathPatternMatcher { public static boolean match(String pattern, String str) { if (str.startsWith("/") != pattern.startsWith("/")) { return false; } List patDirs = tokenizePath(pattern); List strDirs = tokenizePath(str); int patIdxStart = 0; int patIdxEnd = patDirs.size() - 1; int strIdxStart = 0; int strIdxEnd = strDi... |
@Test public void testAdd() { assertEquals(BigDecimalUtil.add(123, 234), 357.0); } | public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testAdd1() { BigDecimal v1 = new BigDecimal(123); BigDecimal v2 = new BigDecimal(234); assertEquals(BigDecimalUtil.add(v1, v2), new BigDecimal("357.00")); } | public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double add(double v1, double v2) { return add(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testSub() { assertEquals(BigDecimalUtil.sub(123, 234), -111.0); } | public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testSub1() { BigDecimal v1 = new BigDecimal(123); BigDecimal v2 = new BigDecimal(234); assertEquals(BigDecimalUtil.sub(v1, v2), new BigDecimal("-111.00")); } | public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double sub(double v1, double v2) { return sub(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testMul() { assertEquals(BigDecimalUtil.mul(10, 23), 230.0); } | public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testMul1() { BigDecimal v1 = new BigDecimal(10); BigDecimal v2 = new BigDecimal(23); assertEquals(BigDecimalUtil.mul(v1, v2), new BigDecimal("230.00")); } | public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double mul(double v1, double v2) { return mul(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testDiv() { assertEquals(BigDecimalUtil.div(23, 10), 2.3); } | public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testDiv1() { BigDecimal v1 = new BigDecimal(23); BigDecimal v2 = new BigDecimal(10); assertEquals(BigDecimalUtil.div(v1, v2), new BigDecimal("2.30")); } | public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testDiv2() { BigDecimal v1 = new BigDecimal(23); BigDecimal v2 = new BigDecimal(0); assertEquals(BigDecimalUtil.div(v1, v2), BigDecimal.ZERO); } | public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } } | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... | BigDecimalUtil { public static double div(double v1, double v2) { return div(v1, v2, Constant.DEFAULT_SCALE); } static double add(double v1, double v2); static double add(double v1, double v2, int scale); static BigDecimal add(BigDecimal v1, BigDecimal v2); static BigDecimal add(BigDecimal v1, BigDecimal v2, int scale... |
@Test public void testWriteSingleEmptySheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), new ArrayList<>()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testToJson() { User user = new User(); user.setName("名称"); user.setDesc("测试"); user.setAge(27); assertEquals("{\"name\":\"名称\",\"age\":27}", JsonUtil.toJson(user, "desc")); } | public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } | JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } } | JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } } | JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } static T fromJson(String json, Class<T> clazz); static String toJson(Object obj, String... ignoreProperties); static Gson gson(String... ignoreProperties); static Gson gson1(String... ignorePro... | JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } static T fromJson(String json, Class<T> clazz); static String toJson(Object obj, String... ignoreProperties); static Gson gson(String... ignoreProperties); static Gson gson1(String... ignorePro... |
@Test public void testGetDistance() { assertEquals(MapDistance.getDistance(116.327396, 39.938416, 120.332685, 37.617222), 462.0); assertEquals(MapDistance.getDistance(120.332685, 37.617222, 116.327396, 39.938416), 462.0); } | public static double getDistance(double lng1, double lat1, double lng2, double lat2) { double radLat1 = rad(lng1); double radLat2 = rad(lng2); double difference = radLat1 - radLat2; double mdifference = rad(lat1) - rad(lat2); double distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(difference / 2), 2) + Math.cos(rad... | MapDistance { public static double getDistance(double lng1, double lat1, double lng2, double lat2) { double radLat1 = rad(lng1); double radLat2 = rad(lng2); double difference = radLat1 - radLat2; double mdifference = rad(lat1) - rad(lat2); double distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(difference / 2), 2) ... | MapDistance { public static double getDistance(double lng1, double lat1, double lng2, double lat2) { double radLat1 = rad(lng1); double radLat2 = rad(lng2); double difference = radLat1 - radLat2; double mdifference = rad(lat1) - rad(lat2); double distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(difference / 2), 2) ... | MapDistance { public static double getDistance(double lng1, double lat1, double lng2, double lat2) { double radLat1 = rad(lng1); double radLat2 = rad(lng2); double difference = radLat1 - radLat2; double mdifference = rad(lat1) - rad(lat2); double distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(difference / 2), 2) ... | MapDistance { public static double getDistance(double lng1, double lat1, double lng2, double lat2) { double radLat1 = rad(lng1); double radLat2 = rad(lng2); double difference = radLat1 - radLat2; double mdifference = rad(lat1) - rad(lat2); double distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(difference / 2), 2) ... |
@Test public void testGetAround() { Map<String, Double> map = MapDistance.getAround(117.11811, 36.68484, 13000); assertEquals(map.get("maxLat"), Double.valueOf("36.941095784459634")); assertEquals(map.get("minLat"), Double.valueOf("36.42858421554037")); assertEquals(map.get("minLng"), Double.valueOf("117.001301883613")... | public static Map<String, Double> getAround(double lng, double lat, double raidusMile) { Map<String, Double> map = new HashMap<>(); double degree = (24901 * 1609) / 360.0; double mpdLng = Double.parseDouble((degree * Math.cos(lng * (Math.PI / 180)) + "").replace("-", "")); double dpmLng = 1 / mpdLng; double radiusLng =... | MapDistance { public static Map<String, Double> getAround(double lng, double lat, double raidusMile) { Map<String, Double> map = new HashMap<>(); double degree = (24901 * 1609) / 360.0; double mpdLng = Double.parseDouble((degree * Math.cos(lng * (Math.PI / 180)) + "").replace("-", "")); double dpmLng = 1 / mpdLng; doub... | MapDistance { public static Map<String, Double> getAround(double lng, double lat, double raidusMile) { Map<String, Double> map = new HashMap<>(); double degree = (24901 * 1609) / 360.0; double mpdLng = Double.parseDouble((degree * Math.cos(lng * (Math.PI / 180)) + "").replace("-", "")); double dpmLng = 1 / mpdLng; doub... | MapDistance { public static Map<String, Double> getAround(double lng, double lat, double raidusMile) { Map<String, Double> map = new HashMap<>(); double degree = (24901 * 1609) / 360.0; double mpdLng = Double.parseDouble((degree * Math.cos(lng * (Math.PI / 180)) + "").replace("-", "")); double dpmLng = 1 / mpdLng; doub... | MapDistance { public static Map<String, Double> getAround(double lng, double lat, double raidusMile) { Map<String, Double> map = new HashMap<>(); double degree = (24901 * 1609) / 360.0; double mpdLng = Double.parseDouble((degree * Math.cos(lng * (Math.PI / 180)) + "").replace("-", "")); double dpmLng = 1 / mpdLng; doub... |
@Test public void testLongToN62() throws Exception { assertEquals(Num62.longToN62(Long.MAX_VALUE), "AzL8n0Y58m7"); } | public static String longToN62(long l) { return longToNBuf(l, N62_CHARS).reverse().toString(); } | Num62 { public static String longToN62(long l) { return longToNBuf(l, N62_CHARS).reverse().toString(); } } | Num62 { public static String longToN62(long l) { return longToNBuf(l, N62_CHARS).reverse().toString(); } } | Num62 { public static String longToN62(long l) { return longToNBuf(l, N62_CHARS).reverse().toString(); } static String longToN62(long l); static String longToN36(long l); static String longToN62(long l, int length); static String longToN36(long l, int length); static long n62ToLong(String n62); static long n36ToLong(S... | Num62 { public static String longToN62(long l) { return longToNBuf(l, N62_CHARS).reverse().toString(); } static String longToN62(long l); static String longToN36(long l); static String longToN62(long l, int length); static String longToN36(long l, int length); static long n62ToLong(String n62); static long n36ToLong(S... |
@Test public void testMapPlainPut() { Map<String, Object> map = MapUtil.<String, Object>build(1).put("name", "name").get(); assertEquals(map.get("name"), "name"); } | public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... |
@Test public void testMapPlainPutAll() { Map<String, Object> mapAll = new HashMap<>(); mapAll.put("name", "name"); mapAll.put("age", 25); Map<String, Object> map = MapUtil.<String, Object>build().putAll(mapAll).get(); assertEquals(map.get("name"), "name"); assertEquals(map.get("age"), 25); } | public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... |
@Test public void testMapPlainPutAllEmpty() { Map<String, Object> mapAll = new HashMap<>(); Map<String, Object> map = MapUtil.<String, Object>build().putAll(mapAll).get(); assertEquals(map.size(), 0); } | public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } } | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... | MapUtil { public static <K, V> MapPlain<K, V> build() { return new MapPlain<>(); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Object> toMap(Object o, String... ignoreProperties)... |
@Test public void testDefaultToMap() { A a = new A(); a.setName("name"); a.setAge(25); Map<String, Object> params = MapUtil.toMap(a); assertEquals(params.get("name"), "name"); assertEquals(params.get("age"), 25); } | public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Object> m = ... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... |
@Test public void testAliasMapToMap() { Map<String, String> alias = new HashMap<>(); alias.put("name", "testName"); A a = new A(); a.setName("name"); a.setAge(25); Map<String, Object> params = MapUtil.toMap(a, alias); assertEquals(params.get("testName"), "name"); assertEquals(params.get("age"), 25); } | public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Object> m = ... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... | MapUtil { public static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(o); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; Map<String, Ob... |
@Test public void testToObject() { Map<String, Object> params = new HashMap<>(); params.put("name", "name"); params.put("age", 25); A a = new A(); MapUtil.toObject(params, a); assertEquals(a.getName(), "name"); assertEquals(a.getAge(), 25); } | public static void toObject(Map<String, Object> source, Object target, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(target); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; for (PropertyDescriptor... | MapUtil { public static void toObject(Map<String, Object> source, Object target, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(target); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; for (Property... | MapUtil { public static void toObject(Map<String, Object> source, Object target, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(target); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; for (Property... | MapUtil { public static void toObject(Map<String, Object> source, Object target, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(target); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; for (Property... | MapUtil { public static void toObject(Map<String, Object> source, Object target, String... ignoreProperties) { PropertyDescriptor[] ts = ReflectUtil.getPropertyDescriptors(target); List<String> ignoreList = (ignoreProperties != null && ignoreProperties.length > 0) ? Arrays.asList(ignoreProperties) : null; for (Property... |
@Test public void testWriteTwoOverMaxSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle(), get(), ExcelDataList.getList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testEmptyMapConvertToList() { Map<String, Object> map = new HashMap<>(); List<Map<String, Object>> list = MapUtil.mapConvertToList(map); assertEquals(list.size(), 0); } | public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... |
@Test public void testMapConvertToList() { Map<String, Object> map = new HashMap<>(); map.put("name", "name"); map.put("age", 25); List<Map<String, Object>> list = MapUtil.mapConvertToList(map); assertEquals(list.size(), 2); assertEquals(list.get(0).get("value"), "name"); assertEquals(list.get(1).get("value"), "age"); ... | public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... |
@Test public void testMapConvertToListDefaultValue() { Map<String, Object> map = new HashMap<>(); map.put("name", "name"); map.put("age", 25); List<Map<String, Object>> list = MapUtil.mapConvertToList(map, "age"); assertTrue((Boolean) list.get(1).get("selected")); } | public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } } | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... | MapUtil { public static <K, V> List<Map<String, Object>> mapConvertToList(Map<K, V> map) { return mapConvertToList(map, null); } static MapPlain<K, V> build(); static MapPlain<K, V> build(int cap); static Map<String, Object> toMap(Object o, Map<String, String> map, String... ignoreProperties); static Map<String, Objec... |
@Test public void testGuessContentType() throws Exception { assertEquals(WebUtil.guessContentType("1.jpg"), "image/jpeg"); assertNull(WebUtil.guessContentType("2.xlsx")); assertEquals(WebUtil.guessContentType("3.png"), "image/png"); assertNull(WebUtil.guessContentType("4.csv")); assertEquals(WebUtil.guessContentType("5... | public static String guessContentType(String fileName) { return URLConnection.getFileNameMap().getContentTypeFor(fileName); } | WebUtil { public static String guessContentType(String fileName) { return URLConnection.getFileNameMap().getContentTypeFor(fileName); } } | WebUtil { public static String guessContentType(String fileName) { return URLConnection.getFileNameMap().getContentTypeFor(fileName); } } | WebUtil { public static String guessContentType(String fileName) { return URLConnection.getFileNameMap().getContentTypeFor(fileName); } static String guessContentType(String fileName); static String encodeContentDisposition(String userAgent, String fileName); } | WebUtil { public static String guessContentType(String fileName) { return URLConnection.getFileNameMap().getContentTypeFor(fileName); } static String guessContentType(String fileName); static String encodeContentDisposition(String userAgent, String fileName); } |
@Test public void testEncodeContentDisposition() throws Exception { assertEquals(MimeUtility.encodeWord("1.jpg"), "1.jpg"); } | public static String encodeContentDisposition(String userAgent, String fileName) { try { String lowUserAgent = userAgent.toLowerCase(); if (lowUserAgent.contains("msie") || lowUserAgent.contains("trident")) { return "attachment;filename=" + StringUtils.replace(URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()),... | WebUtil { public static String encodeContentDisposition(String userAgent, String fileName) { try { String lowUserAgent = userAgent.toLowerCase(); if (lowUserAgent.contains("msie") || lowUserAgent.contains("trident")) { return "attachment;filename=" + StringUtils.replace(URLEncoder.encode(fileName, StandardCharsets.UTF_... | WebUtil { public static String encodeContentDisposition(String userAgent, String fileName) { try { String lowUserAgent = userAgent.toLowerCase(); if (lowUserAgent.contains("msie") || lowUserAgent.contains("trident")) { return "attachment;filename=" + StringUtils.replace(URLEncoder.encode(fileName, StandardCharsets.UTF_... | WebUtil { public static String encodeContentDisposition(String userAgent, String fileName) { try { String lowUserAgent = userAgent.toLowerCase(); if (lowUserAgent.contains("msie") || lowUserAgent.contains("trident")) { return "attachment;filename=" + StringUtils.replace(URLEncoder.encode(fileName, StandardCharsets.UTF_... | WebUtil { public static String encodeContentDisposition(String userAgent, String fileName) { try { String lowUserAgent = userAgent.toLowerCase(); if (lowUserAgent.contains("msie") || lowUserAgent.contains("trident")) { return "attachment;filename=" + StringUtils.replace(URLEncoder.encode(fileName, StandardCharsets.UTF_... |
@Test public void testDateRedMonthBegin() { Date date = DateUtil.parse(DateUtil.YYYY_MM, "201603"); String startDate = DateUtil.dateRedMonthBegin(date, 0); assertEquals(startDate, "2016-03-01"); } | public static String dateRedMonthBegin(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { str = "0" +... | DateUtil { public static String dateRedMonthBegin(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { ... | DateUtil { public static String dateRedMonthBegin(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { ... | DateUtil { public static String dateRedMonthBegin(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { ... | DateUtil { public static String dateRedMonthBegin(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { ... |
@Test public void testDateRedMonthEnd() { Date date = DateUtil.parse(DateUtil.YYYY_MM, "201603"); String endDate = DateUtil.dateRedMonthEnd(date, 0); assertEquals(endDate, "2016-03-31"); } | public static String dateRedMonthEnd(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { str = "0" + m... | DateUtil { public static String dateRedMonthEnd(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { st... | DateUtil { public static String dateRedMonthEnd(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { st... | DateUtil { public static String dateRedMonthEnd(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { st... | DateUtil { public static String dateRedMonthEnd(Date date, int n) { String str = ""; int year = year(date); int month = month(date); if (n >= 12) { int m = n % 12; int s = n / 12; month = 12 - m + month; year = year - s; } else { month = month - n; } if (month == 0) { year = year - 1; month = 12; } if (month < 10) { st... |
@Test public void testFormat() { int count = 2; int j = 2; while (j > 0) { Thread[] threads = new Thread[count]; for (int i = 0; i < count; i++) { Thread thread = new Thread(() -> { String date = DateUtil.format(DateUtil.YYYY_MM_DD_HH_MM_SS, new Date()); assertNotNull(date); date = DateUtil.format(DateUtil.YYYY_MM_DD, ... | public static String format(String format, Date date) { return date != null ? getDateFormat(format).format(date) : null; } | DateUtil { public static String format(String format, Date date) { return date != null ? getDateFormat(format).format(date) : null; } } | DateUtil { public static String format(String format, Date date) { return date != null ? getDateFormat(format).format(date) : null; } } | DateUtil { public static String format(String format, Date date) { return date != null ? getDateFormat(format).format(date) : null; } static DateFormat getDateFormat(String format); static String format(String format, Date date); static Date parse(String format, String date); static String getDateStr(Date date, String... | DateUtil { public static String format(String format, Date date) { return date != null ? getDateFormat(format).format(date) : null; } static DateFormat getDateFormat(String format); static String format(String format, Date date); static Date parse(String format, String date); static String getDateStr(Date date, String... |
@Test public void testStringArrayWriteCsvFile() { String[] title = {"id" , "name"}; List<String[]> bodyList = new ArrayList<>(); String[] data = new String[2]; data[0] = "1"; data[1] = "张三"; bodyList.add(data); data = new String[2]; data[0] = "2"; data[1] = "李四"; bodyList.add(data); CsvUtil.writeCsvFile(fileName, title... | public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Disposition", "... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... |
@Test public void testObjectWriteCsvFile() { String[] title = {"id" , "name"}; List<User> objs = new ArrayList<>(); User user = new User(); user.setId(1); user.setName("张三"); objs.add(user); user = new User(); user.setId(2); user.setName("李四"); objs.add(user); CsvUtil.writeCsvFile(fileName, title, objs, t -> { String[]... | public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Disposition", "... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... | CsvUtil { public static void writeCsvFile(HttpServletResponse response, HttpServletRequest request, String filename, String[] title, List<String[]> bodyList) { response.setContentType("application/octet-stream;charset=GBK"); String fileName = FileUtilies.getFileName(filename, request); response.setHeader("Content-Dispo... |
@Test public void testWriteThreeOverMaxSheetExcel() { FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle(), get(), ExcelDataList.getList()) .deal(getTitle(), get(), ExcelDataList.getList()) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test(expectedExceptions = NullPointerException.class) public void testGetWithKeyNull() { SystemPropertyUtil.get(null, null); } | public static String get(String key) { return get(key, null); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } |
@Test(expectedExceptions = IllegalArgumentException.class) public void testGetWithKeyEmpty() { SystemPropertyUtil.get("", null); } | public static String get(String key) { return get(key, null); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } |
@Test public void testGetDefaultValueWithPropertyNull() { assertEquals("default", SystemPropertyUtil.get("key", "default")); } | public static String get(String key) { return get(key, null); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } |
@Test public void testGetPropertyValue() { System.setProperty("key", "value"); assertEquals("value", SystemPropertyUtil.get("key")); } | public static String get(String key) { return get(key, null); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } | SystemPropertyUtil { public static String get(String key) { return get(key, null); } private SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static int getInt(String key, int def); } |
@Test public void getIntDefaultValueWithPropertyNull() { assertEquals(1, SystemPropertyUtil.getInt("key", 1)); } | public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... |
@Test public void getIntWithPropertValueIsInt() { System.setProperty("key", "123"); assertEquals(123, SystemPropertyUtil.getInt("key", 1)); } | public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... |
@Test public void getIntDefaultValueWithPropertValueIsNotInt() { System.setProperty("key", "NotInt"); assertEquals(1, SystemPropertyUtil.getInt("key", 1)); } | public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); } | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... | SystemPropertyUtil { public static int getInt(String key, int def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Integer.parseInt(value); } catch (Exception e) { } return def; } private SystemPropertyUtil(); static boolean contains(String key); static String get(Strin... |
@Test public void testUnicode2String() { assertEquals(unicode2String("\u674e"), "李"); } | public static String unicode2String(String str) { Matcher matcher = UNICODE_2_STRING_PATTERN.matcher(str); while (matcher.find()) { char ch = (char) Integer.parseInt(matcher.group(2), 16); str = str.replace(matcher.group(1), ch + ""); } return str; } | ISOUtil { public static String unicode2String(String str) { Matcher matcher = UNICODE_2_STRING_PATTERN.matcher(str); while (matcher.find()) { char ch = (char) Integer.parseInt(matcher.group(2), 16); str = str.replace(matcher.group(1), ch + ""); } return str; } } | ISOUtil { public static String unicode2String(String str) { Matcher matcher = UNICODE_2_STRING_PATTERN.matcher(str); while (matcher.find()) { char ch = (char) Integer.parseInt(matcher.group(2), 16); str = str.replace(matcher.group(1), ch + ""); } return str; } ISOUtil(); } | ISOUtil { public static String unicode2String(String str) { Matcher matcher = UNICODE_2_STRING_PATTERN.matcher(str); while (matcher.find()) { char ch = (char) Integer.parseInt(matcher.group(2), 16); str = str.replace(matcher.group(1), ch + ""); } return str; } ISOUtil(); static String ebcdicToAscii(byte[] e); static St... | ISOUtil { public static String unicode2String(String str) { Matcher matcher = UNICODE_2_STRING_PATTERN.matcher(str); while (matcher.find()) { char ch = (char) Integer.parseInt(matcher.group(2), 16); str = str.replace(matcher.group(1), ch + ""); } return str; } ISOUtil(); static String ebcdicToAscii(byte[] e); static St... |
@Test public void testGetConnection() { Connection connection = dbManager.getConnection(); assertNotNull(connection); dbManager.close(connection); } | public Connection getConnection() { try { Class.forName(this.driveName); return DriverManager.getConnection(this.url, this.user, this.password); } catch (ClassNotFoundException e) { throw new RuntimeException("load database class exception : " + e.getMessage(), e); } catch (SQLException e) { throw new RuntimeException(... | DbManager { public Connection getConnection() { try { Class.forName(this.driveName); return DriverManager.getConnection(this.url, this.user, this.password); } catch (ClassNotFoundException e) { throw new RuntimeException("load database class exception : " + e.getMessage(), e); } catch (SQLException e) { throw new Runti... | DbManager { public Connection getConnection() { try { Class.forName(this.driveName); return DriverManager.getConnection(this.url, this.user, this.password); } catch (ClassNotFoundException e) { throw new RuntimeException("load database class exception : " + e.getMessage(), e); } catch (SQLException e) { throw new Runti... | DbManager { public Connection getConnection() { try { Class.forName(this.driveName); return DriverManager.getConnection(this.url, this.user, this.password); } catch (ClassNotFoundException e) { throw new RuntimeException("load database class exception : " + e.getMessage(), e); } catch (SQLException e) { throw new Runti... | DbManager { public Connection getConnection() { try { Class.forName(this.driveName); return DriverManager.getConnection(this.url, this.user, this.password); } catch (ClassNotFoundException e) { throw new RuntimeException("load database class exception : " + e.getMessage(), e); } catch (SQLException e) { throw new Runti... |
@Test public void testGetPreparedStatement() { Connection connection = dbManager.getConnection(); PreparedStatement preparedStatement = dbManager.getPreparedStatement(connection, "select count(1) as count from tb_user"); assertNotNull(preparedStatement); dbManager.close(connection, preparedStatement, null); } | public PreparedStatement getPreparedStatement(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeException("get PrepareStatement exception : " + e.getMessage(), e); } } | DbManager { public PreparedStatement getPreparedStatement(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeException("get PrepareStatement exception : " + e.getMessage(), e); } } } | DbManager { public PreparedStatement getPreparedStatement(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeException("get PrepareStatement exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String passwo... | DbManager { public PreparedStatement getPreparedStatement(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeException("get PrepareStatement exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String passwo... | DbManager { public PreparedStatement getPreparedStatement(Connection connection, String sql) { try { return connection.prepareStatement(sql); } catch (SQLException e) { throw new RuntimeException("get PrepareStatement exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String passwo... |
@Test public void testWriteSingleEqualMaxSheetExcel() { List<ExcelDto> excelDtos = ExcelDataList.getList(); excelDtos.remove(65535); FileExcelWrite.build(fileName) .setLargeDataMode(false) .deal(getTitle(), get(), excelDtos) .write(); } | public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); } | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... | FileExcelWrite implements OutputStreamDelegate { public static ExcelWrite build(InputStream inputStream, String fileName) { Objects.requireNonNull(inputStream); Objects.requireNonNull(fileName); return new CopyInputStreamExcelWrite(inputStream, fileName, new FileExcelWrite()); } private FileExcelWrite(); @Override Out... |
@Test public void testGetResultSet() throws Exception { Connection connection = dbManager.getConnection(); PreparedStatement preparedStatement = dbManager.getPreparedStatement(connection, "select count(1) as count from tb_user"); ResultSet resultSet = dbManager.getResultSet(preparedStatement); assertNotNull(resultSet);... | public ResultSet getResultSet(PreparedStatement preparedStatement) { try { return preparedStatement.executeQuery(); } catch (SQLException e) { throw new RuntimeException("get ResultSet exception : " + e.getMessage(), e); } } | DbManager { public ResultSet getResultSet(PreparedStatement preparedStatement) { try { return preparedStatement.executeQuery(); } catch (SQLException e) { throw new RuntimeException("get ResultSet exception : " + e.getMessage(), e); } } } | DbManager { public ResultSet getResultSet(PreparedStatement preparedStatement) { try { return preparedStatement.executeQuery(); } catch (SQLException e) { throw new RuntimeException("get ResultSet exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); } | DbManager { public ResultSet getResultSet(PreparedStatement preparedStatement) { try { return preparedStatement.executeQuery(); } catch (SQLException e) { throw new RuntimeException("get ResultSet exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCo... | DbManager { public ResultSet getResultSet(PreparedStatement preparedStatement) { try { return preparedStatement.executeQuery(); } catch (SQLException e) { throw new RuntimeException("get ResultSet exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCo... |
@Test public void testGetTables() throws Exception { Connection connection = dbManager.getConnection(); ResultSet resultSet = dbManager.getTables(connection, "", "test_tmp", ""); assertNotNull(resultSet); int size = 0; while (resultSet.next()) { size++; } assertEquals(size, 1); dbManager.close(connection, null, resultS... | public ResultSet getTables(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getTables(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get tables exception : " + e.getMessage(), e... | DbManager { public ResultSet getTables(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getTables(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get tables exception : " + e.get... | DbManager { public ResultSet getTables(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getTables(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get tables exception : " + e.get... | DbManager { public ResultSet getTables(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getTables(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get tables exception : " + e.get... | DbManager { public ResultSet getTables(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getTables(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get tables exception : " + e.get... |
@Test public void testGetColumns() throws Exception { Connection connection = dbManager.getConnection(); ResultSet resultSet = dbManager.getColumns(connection, "", "test_tmp", "tb_user"); assertNotNull(resultSet); int size = 0; while (resultSet.next()) { size++; } assertEquals(size, 6); dbManager.close(connection, null... | public ResultSet getColumns(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getColumns(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get columns exception : " + e.getMessage()... | DbManager { public ResultSet getColumns(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getColumns(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get columns exception : " + e.... | DbManager { public ResultSet getColumns(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getColumns(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get columns exception : " + e.... | DbManager { public ResultSet getColumns(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getColumns(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get columns exception : " + e.... | DbManager { public ResultSet getColumns(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getColumns(localCatalog, localSchema, localTableName, null); } catch (SQLException e) { throw new RuntimeException("get columns exception : " + e.... |
@Test public void testGetPrimaryKeys() throws Exception { Connection connection = dbManager.getConnection(); ResultSet resultSet = dbManager.getPrimaryKeys(connection, "", "test_tmp", "tb_user"); assertNotNull(resultSet); int size = 0; while (resultSet.next()) { size++; } assertEquals(size, 1); dbManager.close(connecti... | public ResultSet getPrimaryKeys(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getPrimaryKeys(localCatalog, localSchema, localTableName); } catch (SQLException e) { throw new RuntimeException("get primary key exception : " + e.getMes... | DbManager { public ResultSet getPrimaryKeys(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getPrimaryKeys(localCatalog, localSchema, localTableName); } catch (SQLException e) { throw new RuntimeException("get primary key exception : ... | DbManager { public ResultSet getPrimaryKeys(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getPrimaryKeys(localCatalog, localSchema, localTableName); } catch (SQLException e) { throw new RuntimeException("get primary key exception : ... | DbManager { public ResultSet getPrimaryKeys(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getPrimaryKeys(localCatalog, localSchema, localTableName); } catch (SQLException e) { throw new RuntimeException("get primary key exception : ... | DbManager { public ResultSet getPrimaryKeys(Connection connection, String localCatalog, String localSchema, String localTableName) { try { return getDatabaseMetaData(connection).getPrimaryKeys(localCatalog, localSchema, localTableName); } catch (SQLException e) { throw new RuntimeException("get primary key exception : ... |
@Test public void testGetResultSetMetaData() throws Exception { Connection connection = dbManager.getConnection(); PreparedStatement preparedStatement = dbManager.getPreparedStatement(connection, "select count(1) as count from tb_user"); ResultSet resultSet = dbManager.getResultSet(preparedStatement); ResultSetMetaData... | public ResultSetMetaData getResultSetMetaData(ResultSet resultSet) { try { return resultSet.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get ResultSetMetaData exception : " + e.getMessage(), e); } } | DbManager { public ResultSetMetaData getResultSetMetaData(ResultSet resultSet) { try { return resultSet.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get ResultSetMetaData exception : " + e.getMessage(), e); } } } | DbManager { public ResultSetMetaData getResultSetMetaData(ResultSet resultSet) { try { return resultSet.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get ResultSetMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); } | DbManager { public ResultSetMetaData getResultSetMetaData(ResultSet resultSet) { try { return resultSet.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get ResultSetMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCon... | DbManager { public ResultSetMetaData getResultSetMetaData(ResultSet resultSet) { try { return resultSet.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get ResultSetMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCon... |
@Test public void testGetDatabaseMetaData() throws Exception { Connection connection = dbManager.getConnection(); DatabaseMetaData databaseMetaData = dbManager.getDatabaseMetaData(connection); assertNotNull(databaseMetaData); assertEquals(databaseMetaData.getDatabaseProductName().toLowerCase(), "mysql"); dbManager.clos... | public DatabaseMetaData getDatabaseMetaData(Connection connection) { try { return connection.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get DatabaseMetaData exception : " + e.getMessage(), e); } } | DbManager { public DatabaseMetaData getDatabaseMetaData(Connection connection) { try { return connection.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get DatabaseMetaData exception : " + e.getMessage(), e); } } } | DbManager { public DatabaseMetaData getDatabaseMetaData(Connection connection) { try { return connection.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get DatabaseMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); } | DbManager { public DatabaseMetaData getDatabaseMetaData(Connection connection) { try { return connection.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get DatabaseMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCon... | DbManager { public DatabaseMetaData getDatabaseMetaData(Connection connection) { try { return connection.getMetaData(); } catch (SQLException e) { throw new RuntimeException("get DatabaseMetaData exception : " + e.getMessage(), e); } } DbManager(); DbManager(String url, String user, String password); Connection getCon... |
@Test public void testASCIIToEBCDIC() { byte[]c = new byte[]{1,2,3,4}; byte[] a = Coder.ASCIIToEBCDIC(c); assertEquals(a[0], 1); assertEquals(a[1], 2); assertEquals(a[2], 3); assertEquals(a[3], 55); } | public static int ASCIIToEBCDIC(int ascii) { return ASCII.AToE[ascii & 0xff] & 0xff; } | Coder { public static int ASCIIToEBCDIC(int ascii) { return ASCII.AToE[ascii & 0xff] & 0xff; } } | Coder { public static int ASCIIToEBCDIC(int ascii) { return ASCII.AToE[ascii & 0xff] & 0xff; } } | Coder { public static int ASCIIToEBCDIC(int ascii) { return ASCII.AToE[ascii & 0xff] & 0xff; } static int ASCIIToEBCDIC(int ascii); static int EBCDICToASCII(int ebcdic); static byte[] ASCIIToEBCDIC(byte[] ascii); static byte[] EBCDICToASCII(byte[] ebcdic); static String ASCIIToEBCDIC(String ascii); static String EBCDI... | Coder { public static int ASCIIToEBCDIC(int ascii) { return ASCII.AToE[ascii & 0xff] & 0xff; } static int ASCIIToEBCDIC(int ascii); static int EBCDICToASCII(int ebcdic); static byte[] ASCIIToEBCDIC(byte[] ascii); static byte[] EBCDICToASCII(byte[] ebcdic); static String ASCIIToEBCDIC(String ascii); static String EBCDI... |
@Test public void testValidate() { User user = new User(); user.setRealName("a"); try { ValidateUtils.validate(user); } catch (Exception e) { String str = e.getMessage(); assertEquals(str, "用户id不能为空"); } } | public static <T> void validate(T bean, Class<?>... groups) { validate(bean, true, groups); } | ValidateUtils { public static <T> void validate(T bean, Class<?>... groups) { validate(bean, true, groups); } } | ValidateUtils { public static <T> void validate(T bean, Class<?>... groups) { validate(bean, true, groups); } } | ValidateUtils { public static <T> void validate(T bean, Class<?>... groups) { validate(bean, true, groups); } static void validate(T bean, Class<?>... groups); static void validate(T bean, boolean flag, Class<?>... groups); } | ValidateUtils { public static <T> void validate(T bean, Class<?>... groups) { validate(bean, true, groups); } static void validate(T bean, Class<?>... groups); static void validate(T bean, boolean flag, Class<?>... groups); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.