V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  palmers  ›  全部回复第 1 页 / 共 28 页
回复总数  543
1  2  3  4  5  6  7  8  9  10 ... 28  
2021-10-04 13:02:00 +08:00
回复了 HUNYXV 创建的主题 Redis 使用 redis 作为数据库(非缓存),有什么建议吗?
JVM 是指 localcache 的类似东西
2021-10-04 13:00:48 +08:00
回复了 HUNYXV 创建的主题 Redis 使用 redis 作为数据库(非缓存),有什么建议吗?
如果是性能 可以通过多种手段优化,比如 JVM+reids+mysql 的形式 如果数据可以快速恢复 可以放 redis 里 如此数据不丢失 只要可以保障数据安全 我觉得怎么折腾都可以 只要达到目的就行了
2021-08-20 08:53:06 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
test-module 模块
```xml
<parent>
<artifactId>unit-testing</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>test-module</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
```
2021-08-20 08:47:42 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>unit-testing</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>test-module</module>
</modules>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<skipMain>true</skipMain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
```
2021-08-20 08:46:09 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
@sutra unit-testing 是 test-module 的父模块 然后单元测试在 test-module 模块中
2021-08-19 20:07:02 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
@sutra 日志就是上面这样的
2021-08-19 20:06:30 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
```java
public class MethClazzTest {

@Test
public void sayHello() {
new MethClazz().sayHello();
}
}
```

```
$ mvn test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] unit-testing [pom]
[INFO] test-module [jar]
[INFO]
[INFO] ----------------------< org.example:unit-testing >----------------------
[INFO] Building unit-testing 1.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] ----------------------< org.example:test-module >-----------------------
[INFO] Building test-module 1.0-SNAPSHOT [2/2]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test-module ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ test-module ---
[INFO] Not compiling main sources
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test-module ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\projects\unit-testing\test-module\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ test-module ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 1 source file to E:\projects\unit-testing\test-module\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /E:/projects/unit-testing/test-module/src/test/java/org/example/d1/MethClazzTest.java:[14,13] 找不到符号
符号: 类 MethClazz
位置: 类 org.example.d1.MethClazzTest
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] unit-testing 1.0-SNAPSHOT .......................... SUCCESS [ 0.040 s]
[INFO] test-module 1.0-SNAPSHOT ........................... FAILURE [ 3.981 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.484 s
[INFO] Finished at: 2021-08-19T20:03:02+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project test-module: Compilation failure
[ERROR] /E:/projects/unit-testing/test-module/src/test/java/org/example/d1/MethClazzTest.java:[14,13] 找不到符号
[ERROR] 符号: 类 MethClazz
[ERROR] 位置: 类 org.example.d1.MethClazzTest
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :test-module

```
2021-08-19 20:04:51 +08:00
回复了 palmers 创建的主题 程序员 请教:单元测试运行找不到类问题
源码:
2021-08-04 09:59:19 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@aragakiyuii 谢谢 大概这意思还是使用 枚举的方式实现了
2021-08-04 09:38:24 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@PolarBears 好 我去查查 enum flag 多谢~
2021-08-04 09:37:23 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@PolarBears 谢谢 我知道了
2021-08-04 09:37:01 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@weofuh 好 我试试 谢谢了
2021-08-04 09:31:21 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@aragakiyuii 谢谢 我大概了解了 但是还没有想明白怎么运用到 es 上
2021-08-04 09:05:16 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@PolarBears 字符串数组 如何查询呢?
2021-08-04 09:03:52 +08:00
回复了 palmers 创建的主题 程序员 有一个技术问题请大家帮忙指导,谢谢大家了
@kernelpanic 谢谢 不过我还有一点不明白,这种查询直接匹配 被 1 2 3 同时标记的数据检索很方便? 如果是或者的关系, 比如 只要是被 1 或 2 或 3 标记过的或更复杂的或关系 都查询出来 那我入参需要将这 N 种情况全部换算出来然后使用 should 去查询吗?
2021-06-21 09:38:41 +08:00
回复了 microyu 创建的主题 Android 通知声音和电话声音如何分离调整?
靠 写了一个 iso 8859-1
2021-06-21 09:38:20 +08:00
回复了 microyu 创建的主题 Android 通知声音和电话声音如何分离调整?
iso 好像也没有 微信经常很大声 只能全局禁声
2021-05-27 09:27:58 +08:00
回复了 neruda 创建的主题 程序员 Java 收徒 7 天后情况汇报
支持!
2021-05-14 14:24:12 +08:00
回复了 hackingwu 创建的主题 Redis 大家使用 redis 的时候,有考虑 redis 挂的场景?
首先讨论 redis 挂的情况, 这种情况 会自动降级,比如兜底方案或不展示某些边缘信息,因为这个过程不会持续很长时间的,否则也没有必要做 redis 挂了的假设或处理;
其次是 redis 不会挂,原因有:1. redis 现在本身已经是做了高可用,比如集群; 2.再者服务部署多主多从,多机房,尤其是多机房,在高可用里是有要求的,比如 两个机房不能在一个城市,距离上有严格的要求否则形同虚设, 这是为了应对那种极端的灾难, 例如地震 山洪 等。
2021-05-08 18:34:54 +08:00
回复了 maloneleo88 创建的主题 JavaScript 关于嵌套数组去重保留原格式?
[... new Set([[100,200],[111,222],[100,200],[111,222],[100,200],[111,222]].flatMap(e => e))] 这样行吗?
1  2  3  4  5  6  7  8  9  10 ... 28  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3172 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 12:25 · PVG 20:25 · LAX 05:25 · JFK 08:25
Developed with CodeLauncher
♥ Do have faith in what you're doing.