public class ResourceIndexerDao {
- public static final int MINIMUM_KEY_SIZE = 3;
+ public static final int MINIMUM_KEY_SIZE = 1;
// The scopes and qualifiers that are not in the following constants are not indexed at all.
// Directories and packages are explicitly excluded.
}
@Test
- public void shouldNotIndexWhenTooShortName() {
- setupData("empty");
+ public void shouldIndexTwoLettersLongResources() {
+ setupData("shouldIndexTwoLettersLongResource");
dao.indexResource(10, "AB", Qualifiers.FILE, 3);
- checkTables("empty", new String[] {"id"}, "resource_index");
+ checkTables("shouldIndexTwoLettersLongResource", new String[] {"id"}, "resource_index");
}
@Test
+++ /dev/null
-<dataset>
- <resource_index kee="other" position="0" name_size="5" resource_id="4" root_project_id="1" qualifier="CLA"/>
-</dataset>
\ No newline at end of file
+++ /dev/null
-<dataset>
- <resource_index id="1" kee="other" position="0" name_size="5" resource_id="4" root_project_id="1" qualifier="CLA"/>
-</dataset>
\ No newline at end of file
<resource_index kee="ntext" position="9" name_size="14" resource_id="4" root_project_id="1" qualifier="CLA"/>
<resource_index kee="text" position="10" name_size="14" resource_id="4" root_project_id="1" qualifier="CLA"/>
<resource_index kee="ext" position="11" name_size="14" resource_id="4" root_project_id="1" qualifier="CLA"/>
+ <resource_index kee="xt" position="12" name_size="14" resource_id="4" root_project_id="1" qualifier="CLA"/>
+ <resource_index kee="t" position="13" name_size="14" resource_id="4" root_project_id="1" qualifier="CLA"/>
<!-- Struts -->
<resource_index kee="struts" position="0" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="truts" position="1" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="ruts" position="2" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="uts" position="3" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="ts" position="4" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="s" position="5" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<!-- Struts Core -->
<resource_index kee="struts core" position="0" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
<resource_index kee=" core" position="6" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
<resource_index kee="core" position="7" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
<resource_index kee="ore" position="8" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
+ <resource_index kee="re" position="9" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
+ <resource_index kee="e" position="10" name_size="11" resource_id="2" root_project_id="1" qualifier="BRC"/>
</dataset>
<resource_index kee="ntext" position="9" name_size="14" resource_id="3" root_project_id="1" qualifier="CLA"/>
<resource_index kee="text" position="10" name_size="14" resource_id="3" root_project_id="1" qualifier="CLA"/>
<resource_index kee="ext" position="11" name_size="14" resource_id="3" root_project_id="1" qualifier="CLA"/>
+ <resource_index kee="xt" position="12" name_size="14" resource_id="3" root_project_id="1" qualifier="CLA"/>
+ <resource_index kee="t" position="13" name_size="14" resource_id="3" root_project_id="1" qualifier="CLA"/>
<!-- Struts -->
<resource_index kee="struts" position="0" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="truts" position="1" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="ruts" position="2" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="uts" position="3" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="ts" position="4" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="s" position="5" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
</dataset>
<resource_index kee="utils" position="3" name_size="8" resource_id="10" root_project_id="8" qualifier="FIL"/>
<resource_index kee="tils" position="4" name_size="8" resource_id="10" root_project_id="8" qualifier="FIL"/>
<resource_index kee="ils" position="5" name_size="8" resource_id="10" root_project_id="8" qualifier="FIL"/>
+ <resource_index kee="ls" position="6" name_size="8" resource_id="10" root_project_id="8" qualifier="FIL"/>
+ <resource_index kee="s" position="7" name_size="8" resource_id="10" root_project_id="8" qualifier="FIL"/>
</dataset>
\ No newline at end of file
--- /dev/null
+<dataset>
+ <resource_index kee="ab" position="0" name_size="2" resource_id="10" root_project_id="3" qualifier="FIL"/>
+ <resource_index kee="b" position="1" name_size="2" resource_id="10" root_project_id="3" qualifier="FIL"/>
+</dataset>
\ No newline at end of file
--- /dev/null
+<dataset></dataset>
<resource_index kee="truts" position="1" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="ruts" position="2" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="uts" position="3" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="ts" position="4" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="s" position="5" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
</dataset>
\ No newline at end of file
<resource_index id="2" kee="truts" position="1" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index id="3" kee="ruts" position="2" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index id="4" kee="uts" position="3" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index id="5" kee="ts" position="4" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index id="6" kee="s" position="5" name_size="6" resource_id="1" root_project_id="1" qualifier="TRK"/>
</dataset>
\ No newline at end of file
<resource_index kee="truts" position="8" name_size="13" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="ruts" position="9" name_size="13" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="uts" position="10" name_size="13" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="ts" position="11" name_size="13" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="s" position="12" name_size="13" resource_id="1" root_project_id="1" qualifier="TRK"/>
</dataset>
<resource_index kee="truts" position="5" name_size="10" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="ruts" position="6" name_size="10" resource_id="1" root_project_id="1" qualifier="TRK"/>
<resource_index kee="uts" position="7" name_size="10" resource_id="1" root_project_id="1" qualifier="TRK"/>
-
+ <resource_index kee="ts" position="8" name_size="10" resource_id="1" root_project_id="1" qualifier="TRK"/>
+ <resource_index kee="s" position="9" name_size="10" resource_id="1" root_project_id="1" qualifier="TRK"/>
</dataset>
\ No newline at end of file