Judgment in an action on a contested claim shall be that such claim or some amount thereof be allowed, or that the same be disallowed, or that the assignee recover from the person making the claim a certain amount. If the claim is allowed, judgment for costs shall be adjudged against the party or parties contesting the same. If the claim is allowed in part only, the court shall apportion the costs or adjudge them as may be just. If the claim is wholly disallowed, or the assignee recovers judgment, costs shall be adjudged against the claimant, but in no case shall the costs be paid out of the assigned estate except as otherwise provided in this chapter. In such cause the claimant shall be named as plaintiff, and the contestants or contestant as defendant. Judgment in favor of the assignee or for costs shall be collected as in other cases.