def test_rowkey():	
	# entity with no row key mapping
	metadata = EntityMetadata.getInstance()
	try:
		nokeyinfo = metadata.getInfo(TestEntities.NoKeyEntity)
		fail("EntityMetadata should have failed parsing NoKeyEntity due to missing HRowKey")
	except MappingException, me:
		assertMatches(me.getMessage(), "Missing .* row key property")
예제 #2
0
def test_rowkey():
    # entity with no row key mapping
    metadata = EntityMetadata.getInstance()
    try:
        nokeyinfo = metadata.getInfo(TestEntities.NoKeyEntity)
        fail(
            "EntityMetadata should have failed parsing NoKeyEntity due to missing HRowKey"
        )
    except MappingException, me:
        assertMatches(me.getMessage(), "Missing .* row key property")
예제 #3
0
    def run(self):
        metadata = EntityMetadata.getInstance()
        iteminfo = metadata.getInfo(self.entitycls)

        assertEquals(iteminfo.getTablename(), self.tablename)

        keyprop = iteminfo.getKeyProperty()
        assertNotNull(keyprop)
        assertEquals(keyprop.getName(), "id")

        for field, propname in self.fieldprops.items():
            prop = iteminfo.getFieldProperty(field)
            assertNotNull(prop)
            assertEquals(prop.getName(), propname)
	def run(self):
		metadata = EntityMetadata.getInstance()
		iteminfo = metadata.getInfo(self.entitycls)
		
		assertEquals(iteminfo.getTablename(), self.tablename)
	
		keyprop = iteminfo.getKeyProperty()
		assertNotNull(keyprop)
		assertEquals(keyprop.getName(), "id")
		
		
		for field, propname in self.fieldprops.items():
			prop = iteminfo.getFieldProperty(field)
			assertNotNull(prop)
			assertEquals(prop.getName(), propname)
def test_indexes():
	metadata = EntityMetadata.getInstance()
	idxinfo = metadata.getInfo(TestEntities.IndexedEntity)
	idxmapping = idxinfo.getFirstPropertyIndex("stringProperty")
	assertNotNull(idxmapping)
	assertEquals(idxmapping.getTableName(), "test_indexed-by_stringcol")
예제 #6
0
def test_indexes():
    metadata = EntityMetadata.getInstance()
    idxinfo = metadata.getInfo(TestEntities.IndexedEntity)
    idxmapping = idxinfo.getFirstPropertyIndex("stringProperty")
    assertNotNull(idxmapping)
    assertEquals(idxmapping.getTableName(), "test_indexed-by_stringcol")