ResourcePersister persister = new DefaultResourcePersister(getSession());
persister.saveProject(singleProject, null);
- checkTables("shouldSaveNewProject", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldSaveNewProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
@Test
persister.saveProject(moduleB, multiModuleProject);
persister.saveProject(moduleB1, moduleB);
- checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
@Test
persister.saveResource(singleProject, new JavaPackage("org.foo").setEffectiveKey("foo:org.foo"));
// check that the directory is attached to the project
- checkTables("shouldSaveNewDirectory", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldSaveNewDirectory", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
@Test
persister.saveResource(singleProject, new Library("junit:junit", "4.8.2").setEffectiveKey("junit:junit"));// do nothing, already saved
persister.saveResource(singleProject, new Library("junit:junit", "3.2").setEffectiveKey("junit:junit"));
- checkTables("shouldSaveNewLibrary", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldSaveNewLibrary", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
@Test
singleProject.setDescription("new description");
persister.saveProject(singleProject, null);
- checkTables("shouldUpdateExistingResource", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldUpdateExistingResource", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
// SONAR-1700
ResourcePersister persister = new DefaultResourcePersister(getSession());
persister.saveProject(singleProject, null);
- checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date"}, "projects", "snapshots");
+ checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
}
}
<!-- other project -->
<projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
name="Other project" long_name="Other" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="Foo" long_name="Foo" description="some description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<!-- old snapshot -->
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
<!-- This project has a root_id which should be set to NULL (SONAR-1700) -->
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="12345"
name="name" long_name="long name" description="description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
<!-- other project -->
<projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
name="Other project" long_name="Other" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
<!-- new project -->
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="Foo" long_name="Foo" description="some description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
name="org.foo" long_name="org.foo" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
<!-- other project -->
<projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
name="Other project" long_name="Other" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
<!-- new project -->
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="Foo" long_name="Foo" description="some description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<projects id="1002" scope="PRJ" qualifier="LIB" kee="junit:junit" root_id="[null]"
name="junit:junit" long_name="junit:junit" description="[null]"
- enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
<!-- other project -->
<projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
name="Other project" long_name="Other" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
<!-- new project -->
<projects id="1001" scope="PRJ" qualifier="TRK" kee="root" root_id="[null]"
name="Root" long_name="Root" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<projects id="1002" scope="PRJ" qualifier="BRC" kee="a" root_id="1001"
name="A" long_name="A" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<projects id="1003" scope="PRJ" qualifier="BRC" kee="b" root_id="1001"
name="B" long_name="B" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<projects id="1004" scope="PRJ" qualifier="BRC" kee="b1" root_id="1001"
name="B1" long_name="B1" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" root_project_id="1001" parent_snapshot_id="[null]" root_snapshot_id="[null]"
<!-- other project -->
<projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
name="Other project" long_name="Other" description="[null]"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
<!-- new project -->
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="Foo" long_name="Foo" description="some description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="new name" long_name="new name" description="new description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<!-- old snapshot -->
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
<projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
name="old name" long_name="old name" description="old description"
- enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+ enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
<snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""