MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / test

Method test

src/test/java/com/rtg/mode/ProteinTest.java:54–70  ·  view source on GitHub ↗

Test method for com.rtg.mode.Protein(). @throws InvocationTargetException @throws IllegalAccessException @throws IllegalArgumentException @throws NoSuchMethodException @throws SecurityException

()

Source from the content-addressed store, hash-verified

52 * @throws SecurityException
53 */
54 public final void test() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
55 // Check toString of values
56 final String methodName = "values";
57 Method m = Protein.class.getMethod(methodName);
58 final Protein[] r = (Protein[]) m.invoke(null);
59 assertEquals("[X, *, A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, V]", Arrays.toString(r));
60 final String valueOfMethod = "valueOf";
61 m = Protein.class.getMethod(valueOfMethod, String.class);
62 // Check ordinal and valueOf
63 for (int i = 0; i < r.length; ++i) {
64 assertEquals(i, r[i].ordinal());
65 if (r[i] != Protein.STOP) {
66 assertEquals(r[i], m.invoke(null, r[i].toString()));
67 assertEquals(Protein.valueOf(r[i].toString()), r[i]);
68 }
69 }
70 }
71
72 //Copied from the IUPAC page
73 private static final String STR = ""

Callers

nothing calls this directly

Calls 5

valueOfMethod · 0.95
invokeMethod · 0.80
toStringMethod · 0.65
ordinalMethod · 0.65
assertEqualsMethod · 0.45

Tested by

no test coverage detected