OresHelper { public static String calculateTypeName(Class aClass) { return calculateTypeName(aClass, null); }  static OLATResourceable createOLATResourceableInstance(final String type, final Long key); static OLATResourceable createOLATResourceableType(final String type, final String subtype); static OLATResourceable createOLATResourceableType(final String type); static OLATResourceable createOLATResourceableType(Class clazz); static OLATResourceable createOLATResourceableInstance(Class aClass, final Long key); static String createStringRepresenting(OLATResourceable ores, String subKey); static String createStringRepresenting(OLATResourceable ores); static OLATResourceable lookupType(Class aClass); static String calculateTypeName(Class aClass); static String calculateTypeName(Class aClass, String subType); static boolean isOfType(OLATResourceable ores, Class aClass); static OLATResourceable lookupType(Class aClass, String subType); static boolean equals(OLATResourceable a, OLATResourceable b); static OLATResourceable createOLATResourceableTypeWithoutCheck(String type); static OLATResourceable createOLATResourceableInstanceWithoutCheck(final String type, final Long key); static final int ORES_TYPE_LENGTH; }
@Test public void calculateTypeName_WithClassArg() { String typeName = OresHelper.calculateTypeName(classInstance); assertEquals(typeName, CLASS_NAME_NO_PACKAGE); }
@Test public void calculateTypeName_WithClassAndSubtypeArgs() { String typeName = OresHelper.calculateTypeName(classInstance, SUBTYPE); assertEquals(typeName, CLASS_NAME_NO_PACKAGE_WITH_SUBTYPE); }
@Test(expected = AssertException.class) public void calculateTypeName_WithTypeAndSubtypeArgs_wrongType() { OresHelper.calculateTypeName(CLASS_NAME_NO_PACKAGE, SUBTYPE); }
@Test public void calculateTypeName_WithTypeAndSubtypeArgs() { String typeName = OresHelper.calculateTypeName(classInstance.getName(), SUBTYPE); assertEquals(typeName, CLASS_NAME_NO_PACKAGE_WITH_SUBTYPE); }