@Override public String getSimpleWildcardPattern() { return "*." + getSuffix(); }
@Override public boolean supportsPath(final Path path) { return type.accept(Paths.convert(path)); }
@Override public String getDescription() { String desc = GuidedDecisionTableConstants.INSTANCE.guidedDecisionTableGraphResourceTypeDescription(); if (desc == null || desc.isEmpty()) { return super.getDescription(); } return desc; } }
@Test public void checkSimpleWildcardPattern() { assertEquals( "*." + type.getSuffix(), type.getSimpleWildcardPattern() ); }
@Override protected GuidedDTableGraphResourceTypeDefinition getResourceTypeDefinition() { return new GuidedDTableGraphResourceTypeDefinition(new Decision()); }
@Test public void checkPrefix() { assertEquals( "", type.getPrefix() ); }
@Test public void checkSimpleWildcardPattern() { assertEquals( "*." + type.getSuffix(), type.getSimpleWildcardPattern() ); }
@Override protected GuidedDTableGraphResourceTypeDefinition getResourceTypeDefinition() { return new GuidedDTableGraphResourceTypeDefinition(new Decision()); }
@Test public void checkPrefix() { assertEquals( "", type.getPrefix() ); }
@Override public String getSimpleWildcardPattern() { return "*." + getSuffix(); }
@Before public void setup() { type = new GuidedDTableGraphResourceTypeDefinition(new Decision()); }
@Test public void checkNotAcceptNonGraphPath() { final Path path = mock( Path.class ); when( path.getFileName() ).thenReturn( "a-file.txt" ); assertFalse( type.accept( path ) ); }
@Override public String getDescription() { String desc = GuidedDecisionTableConstants.INSTANCE.guidedDecisionTableGraphResourceTypeDescription(); if (desc == null || desc.isEmpty()) { return super.getDescription(); } return desc; } }
@Override public boolean accept(final Path path) { return path.getFileName().endsWith("." + getSuffix()); } }
@Before public void setup() { type = new GuidedDTableGraphResourceTypeDefinition(new Decision()); }
@Test public void checkNotAcceptNonGraphPath() { final Path path = mock( Path.class ); when( path.getFileName() ).thenReturn( "a-file.txt" ); assertFalse( type.accept( path ) ); }
@Override public boolean accept(final Path path) { return path.getFileName().endsWith("." + getSuffix()); } }
@Test public void checkLoad() { final Path path = mock(Path.class); when(path.toURI()).thenReturn("default://project/src/main/resources/mypackage/dtable." + dtGraphResourceType.getSuffix()); when(ioService.readAllString(any(org.uberfire.java.nio.file.Path.class))).thenReturn(""); final GuidedDecisionTableEditorGraphModel model = service.load(path); verify(ioService, times(1)).readAllString(any(org.uberfire.java.nio.file.Path.class)); assertNotNull(model); }