我有一个用于 JUnit 测试的 java 程序,我在 netbeans IDE 中编写了该程序,我正在使用单线程测试一个类。当我要编译这个程序时,它工作正常并显示结果 100% 成功,但是当我尝试运行这个程序时,我得到一个异常 -
测试套件:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 测试运行:1,失败:1,错误:0,已用时间:0.057 秒
测试用例:警告(junit.framework.TestSuite$1):失败在 glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 中找不到测试 junit.framework.AssertionFailedError:在 glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 中找不到测试
测试套件:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest 测试运行:1,失败:0,错误:1,已用时间:0 秒
测试用例:glb.chatmeter.crawler.yahoolocal.YahooBusinessDataTest:null:导致错误 Forked Java VM 异常退出。请注意,报告中的时间并不反映虚拟机退出之前的时间。junit.framework.AssertionFailedError:分叉的 Java VM 异常退出。请注意,报告中的时间并不反映虚拟机退出之前的时间。在 org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
是netbean问题还是其他什么问题?有没有人帮帮我谢谢。
我的代码是这样的——
public class BusinessDataTest {
String url = "http://local.com/info-66122628-andy-richards-house-painting-mesa";
Integer[] locId = {1354};
String customerDetail ="Business Name";
public BusinessDataTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Test
public void testGetFullDataOfBusiness() {
System.out.println("getFullDataOfBusiness");
BusinessData instance …Run Code Online (Sandbox Code Playgroud) 我在mysql中有一个带varchar(100)的字段,我想存储前100个字符,因为我的数据长度是200个字符(忽略最后100个字符).我不想更改我的源代码.这在MS-Access和MS Server中是可能的,但我想在mysql中执行此操作.
我在java中使用hibernate应用它,意味着我不是为此编写插入代码.这里我只使用save()方法并抛出"大数据".
我有例外 -
引起:java.sql.BatchUpdateException:数据截断:第1行的列'FBUrl'的数据太长
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1527) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1065) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195) glb.chatmeter.exception.AdException: Could not Save Facebook page Data.
您好,我有一个休眠查询,它为我提供了一个类型为 的列表List<List<integer>>。我怎样才能迭代这个?我的休眠查询是:
String SQL_QUERY = "select DISTINCT cbl.franchiseId,cbl.resellerId from
CustomerBusinessLocation cbl where cbl.cmcustLocId in (:locationId)";
Query query = getSession().createQuery(SQL_QUERY);
query.setParameterList("locationId", customerLocId);
List<List<Integer>> rc_list = query.list();
Run Code Online (Sandbox Code Playgroud)
或者,是否有其他方法可以轻松提取这些数据?
我是 Spring 的新手,我想了解一些依赖注入的真实示例。实际情况如何使用它。请帮我举一些现实世界的例子。