@Test public void asset_to_asset2_wrapper() { Asset asset = mockAsset(); Resource resource = mockResource(); String clientURL = "clientURL"; train_toClientURL(asset, clientURL); expect(asset.getResource()).andReturn(resource); replay(); Asset2 asset2 = TapestryInternalUtils.toAsset2(asset); assertFalse(asset2.isInvariant()); assertSame(asset2.toClientURL(), clientURL); assertSame(asset2.toString(), asset.toString()); assertSame(asset2.getResource(), resource); verify(); }
public static Asset2 toAsset2(final Asset asset) { if (asset instanceof Asset2) return (Asset2) asset; return new Asset2() { public boolean isInvariant() { return false; } public Resource getResource() { return asset.getResource(); } public String toClientURL() { return asset.toClientURL(); } @Override public String toString() { return asset.toString(); } }; }
TapestryInternalUtils { public static Asset2 toAsset2(final Asset asset) { if (asset instanceof Asset2) return (Asset2) asset; return new Asset2() { public boolean isInvariant() { return false; } public Resource getResource() { return asset.getResource(); } public String toClientURL() { return asset.toClientURL(); } @Override public String toString() { return asset.toString(); } }; } }
TapestryInternalUtils { public static Asset2 toAsset2(final Asset asset) { if (asset instanceof Asset2) return (Asset2) asset; return new Asset2() { public boolean isInvariant() { return false; } public Resource getResource() { return asset.getResource(); } public String toClientURL() { return asset.toClientURL(); } @Override public String toString() { return asset.toString(); } }; }  }
TapestryInternalUtils { public static Asset2 toAsset2(final Asset asset) { if (asset instanceof Asset2) return (Asset2) asset; return new Asset2() { public boolean isInvariant() { return false; } public Resource getResource() { return asset.getResource(); } public String toClientURL() { return asset.toClientURL(); } @Override public String toString() { return asset.toString(); } }; }  static String toUserPresentable(String id); static Map<String, String> mapFromKeysAndValues(String... keysAndValues); static OptionModel toOptionModel(String input); static List<OptionModel> toOptionModels(String input); static SelectModel toSelectModel(String input); static OptionModel toOptionModel(Map.Entry input); static List<OptionModel> toOptionModels(Map<K, V> input); static SelectModel toSelectModel(Map<K, V> input); static OptionModel toOptionModel(Object input); static List<OptionModel> toOptionModels(List<E> input); static SelectModel toSelectModel(List<E> input); static KeyValue parseKeyValue(String input); static String extractIdFromPropertyExpression(String expression); static String defaultLabel(String id, Messages messages, String propertyExpression); static String lastTerm(String input); static String toClassAttributeValue(List<String> classes); static String getLabelForEnum(Messages messages, String prefix, Enum value); static String getLabelForEnum(Messages messages, Enum value); static boolean isEqual(T left, T right); static String[] splitPath(String path); static String[] splitAtCommas(String value); static void copy(InputStream in, OutputStream out); static boolean isEqual(EventContext left, EventContext right); static Asset2 toAsset2(final Asset asset); static InternalPropertyConduit toInternalPropertyConduit(final PropertyConduit conduit); static Orderable<String> mixinTypeAndOrder(String mixinDef); static String[] splitMixinConstraints(String s); static LinkCreationListener2 toLinkCreationListener2(final LinkCreationListener delegate); static String toFileSuffix(String fileName); static V getAndDeref(Map<K, ? extends Reference<V>> map, K key); static Thread[] getAllThreads(); }
TapestryInternalUtils { public static Asset2 toAsset2(final Asset asset) { if (asset instanceof Asset2) return (Asset2) asset; return new Asset2() { public boolean isInvariant() { return false; } public Resource getResource() { return asset.getResource(); } public String toClientURL() { return asset.toClientURL(); } @Override public String toString() { return asset.toString(); } }; }  static String toUserPresentable(String id); static Map<String, String> mapFromKeysAndValues(String... keysAndValues); static OptionModel toOptionModel(String input); static List<OptionModel> toOptionModels(String input); static SelectModel toSelectModel(String input); static OptionModel toOptionModel(Map.Entry input); static List<OptionModel> toOptionModels(Map<K, V> input); static SelectModel toSelectModel(Map<K, V> input); static OptionModel toOptionModel(Object input); static List<OptionModel> toOptionModels(List<E> input); static SelectModel toSelectModel(List<E> input); static KeyValue parseKeyValue(String input); static String extractIdFromPropertyExpression(String expression); static String defaultLabel(String id, Messages messages, String propertyExpression); static String lastTerm(String input); static String toClassAttributeValue(List<String> classes); static String getLabelForEnum(Messages messages, String prefix, Enum value); static String getLabelForEnum(Messages messages, Enum value); static boolean isEqual(T left, T right); static String[] splitPath(String path); static String[] splitAtCommas(String value); static void copy(InputStream in, OutputStream out); static boolean isEqual(EventContext left, EventContext right); static Asset2 toAsset2(final Asset asset); static InternalPropertyConduit toInternalPropertyConduit(final PropertyConduit conduit); static Orderable<String> mixinTypeAndOrder(String mixinDef); static String[] splitMixinConstraints(String s); static LinkCreationListener2 toLinkCreationListener2(final LinkCreationListener delegate); static String toFileSuffix(String fileName); static V getAndDeref(Map<K, ? extends Reference<V>> map, K key); static Thread[] getAllThreads(); static Mapper<Asset, StylesheetLink> assetToStylesheetLink; }