target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void shouldParseEmptyAtendees() { assertThat(GoogleCalendarUtils.parseAtendees("")).isEmpty(); } | static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... |
@Test @Parameters({"2 == 1, 2 == 1", "${body.prop} == 1, ${body[prop]} == 1", "${body.prop} == 1 OR ${body.fr_op.gl$op.ml0op[3]} == '2.4', ${body[prop]} == 1 OR ${body[fr_op][gl$op][ml0op][3]} == '2.4'"}) public void shouldConvertSimpleExpressionsToOgnl(final String simple, final String ognl) { assertThat(convertSimple... | @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl,... | JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgn... | JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgn... | JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgn... | JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgn... |
@Test public void shouldParseNullAtendees() { assertThat(GoogleCalendarUtils.parseAtendees(null)).isEmpty(); } | static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... | GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ... |
@Test public void createsConnectorModelFromTrivialGoogleModel() { final Event googleModel = new Event(); final GoogleCalendarEventModel eventModel = GoogleCalendarEventModel.newFrom(googleModel); assertThat(eventModel).isEqualToComparingFieldByField(new GoogleCalendarEventModel()); } | public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescription()); model.attendees ... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... |
@Test public void newModelFromNullIsValid() { final GoogleCalendarEventModel eventModel = GoogleCalendarEventModel.newFrom(null); assertThat(eventModel).isEqualToComparingFieldByField(new GoogleCalendarEventModel()); } | public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescription()); model.attendees ... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... | GoogleCalendarEventModel { public static GoogleCalendarEventModel newFrom(final Event event) { final GoogleCalendarEventModel model = new GoogleCalendarEventModel(); if (event == null) { return model; } model.title = StringHelper.trimToNull(event.getSummary()); model.description = StringHelper.trimToNull(event.getDescr... |
@Test public void retrieveQueuesListTest() { CamelContext context = new DefaultCamelContext(); AWSSQSMetaDataExtension extension = new AWSSQSMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("accessKey", "accessKey"); properties.put("secretKey", "secretKey"); properties.put("r... | @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region = ConnectorOptions.extractOption(parameters, "region"); Amazo... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... |
@Test public void noChannelTest() { CamelContext context = new DefaultCamelContext(); AWSSQSMetaDataExtension extension = new AWSSQSMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("webhookurl", "token"); Optional<MetaDataExtension.MetaData> meta = extension.meta(properties);... | @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region = ConnectorOptions.extractOption(parameters, "region"); Amazo... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... | AWSSQSMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String accessKey = ConnectorOptions.extractOption(parameters, "accessKey"); final String secretKey = ConnectorOptions.extractOption(parameters, "secretKey"); final String region =... |
@Test public void mapToJsonBeanTest() throws JsonProcessingException { final ObjectMapper mapper = new ObjectMapper(); final SimpleOutputBean bean = new SimpleOutputBean(); bean.setC(50); final String jsonBeanExpected = mapper.writeValueAsString(bean); final Map<String, Object> map = new HashMap<>(); map.put("c", 50); ... | @SuppressWarnings("unchecked") public static String toJSONBean(final List<Object> list) { String json = null; if (list.size() == 1) { final Map<String, Object> map = (Map<String, Object>) list.get(0); json = JSONBeanUtil.toJSONBean(map); } else if (list.size() > 1) { final StringBuilder stringBuilder = new StringBuilde... | JSONBeanUtil { @SuppressWarnings("unchecked") public static String toJSONBean(final List<Object> list) { String json = null; if (list.size() == 1) { final Map<String, Object> map = (Map<String, Object>) list.get(0); json = JSONBeanUtil.toJSONBean(map); } else if (list.size() > 1) { final StringBuilder stringBuilder = n... | JSONBeanUtil { @SuppressWarnings("unchecked") public static String toJSONBean(final List<Object> list) { String json = null; if (list.size() == 1) { final Map<String, Object> map = (Map<String, Object>) list.get(0); json = JSONBeanUtil.toJSONBean(map); } else if (list.size() > 1) { final StringBuilder stringBuilder = n... | JSONBeanUtil { @SuppressWarnings("unchecked") public static String toJSONBean(final List<Object> list) { String json = null; if (list.size() == 1) { final Map<String, Object> map = (Map<String, Object>) list.get(0); json = JSONBeanUtil.toJSONBean(map); } else if (list.size() > 1) { final StringBuilder stringBuilder = n... | JSONBeanUtil { @SuppressWarnings("unchecked") public static String toJSONBean(final List<Object> list) { String json = null; if (list.size() == 1) { final Map<String, Object> map = (Map<String, Object>) list.get(0); json = JSONBeanUtil.toJSONBean(map); } else if (list.size() > 1) { final StringBuilder stringBuilder = n... |
@Test public void parsePropertiesFromJSONBeanTest() throws JsonProcessingException { final ObjectMapper mapper = new ObjectMapper(); final SimpleInputBean bean = new SimpleInputBean(); bean.setA(20); bean.setB(30); final String jsonBean = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(bean); final Propertie... | public static Properties parsePropertiesFromJSONBean(final String json) { final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOException e) { throw new IllegalArgumentException("Unable to parse given JSON", e); } final Properties ret = new Properties(); ... | JSONBeanUtil { public static Properties parsePropertiesFromJSONBean(final String json) { final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOException e) { throw new IllegalArgumentException("Unable to parse given JSON", e); } final Properties ret = new... | JSONBeanUtil { public static Properties parsePropertiesFromJSONBean(final String json) { final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOException e) { throw new IllegalArgumentException("Unable to parse given JSON", e); } final Properties ret = new... | JSONBeanUtil { public static Properties parsePropertiesFromJSONBean(final String json) { final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOException e) { throw new IllegalArgumentException("Unable to parse given JSON", e); } final Properties ret = new... | JSONBeanUtil { public static Properties parsePropertiesFromJSONBean(final String json) { final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOException e) { throw new IllegalArgumentException("Unable to parse given JSON", e); } final Properties ret = new... |
@Test public void parseSqlParametersFromJSONBeanWhenNoParameters() throws JsonProcessingException { try { String[] jsonParamValues = { null, "", "{}", "[]", "something else" }; for (int i = 0; i < jsonParamValues.length; ++i) { Map<String, SqlParameterValue> retMap = JSONBeanUtil.parseSqlParametersFromJSONBean(jsonPara... | public static Map<String, SqlParameterValue> parseSqlParametersFromJSONBean(final String json, final Map<String, Integer> jdbcTypeMap) { if (!isValidJSONBean(json)) { return Collections.emptyMap(); } final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } catch (final IOE... | JSONBeanUtil { public static Map<String, SqlParameterValue> parseSqlParametersFromJSONBean(final String json, final Map<String, Integer> jdbcTypeMap) { if (!isValidJSONBean(json)) { return Collections.emptyMap(); } final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } c... | JSONBeanUtil { public static Map<String, SqlParameterValue> parseSqlParametersFromJSONBean(final String json, final Map<String, Integer> jdbcTypeMap) { if (!isValidJSONBean(json)) { return Collections.emptyMap(); } final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } c... | JSONBeanUtil { public static Map<String, SqlParameterValue> parseSqlParametersFromJSONBean(final String json, final Map<String, Integer> jdbcTypeMap) { if (!isValidJSONBean(json)) { return Collections.emptyMap(); } final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } c... | JSONBeanUtil { public static Map<String, SqlParameterValue> parseSqlParametersFromJSONBean(final String json, final Map<String, Integer> jdbcTypeMap) { if (!isValidJSONBean(json)) { return Collections.emptyMap(); } final Map<String, String> parsed; try { parsed = MAPPER.readerFor(STRING_STRING_MAP).readValue(json); } c... |
@Test public void shouldStoreSpecificationInTemporaryDirectory() { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put(SPECIFICATION, CONTENTS); customizer.customize(NOT_USED, options); assertThat(options).containsKey... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(ComponentProperties.SPECIFICATION)) { consumeOption(options, ComponentP... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... |
@Test public void shouldIgnoreSpecificationWhenWsdlUrlIsPresent() { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put(SPECIFICATION, CONTENTS); options.put(WSDL_URL, HTTP_DUMMY_URL); customizer.customize(NOT_USED, o... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(ComponentProperties.SPECIFICATION)) { consumeOption(options, ComponentP... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... |
@Test @Parameters({"body.prop, body[prop]", "body.size(), body.size()", "body[3], body[3]", "body[3].prop, body[3][prop]", "body.fr_op.gl$op.ml0op[3], body[fr_op][gl\\$op][ml0op][3]"}) public void shouldConvertSimpleToOgnl(final String simple, final String ognl) { final Matcher matcher = Pattern.compile("(.*)").matcher... | static String toOgnl(final Matcher matcher) { final String expression = matcher.group(1); if (!(expression.startsWith("body.") || expression.startsWith("body[")) || isCollectionPath(expression)) { return expression; } final StringBuilder ognl = new StringBuilder(expression.length() + 5); final char[] chars = expression... | JsonSimplePredicate implements Predicate { static String toOgnl(final Matcher matcher) { final String expression = matcher.group(1); if (!(expression.startsWith("body.") || expression.startsWith("body[")) || isCollectionPath(expression)) { return expression; } final StringBuilder ognl = new StringBuilder(expression.len... | JsonSimplePredicate implements Predicate { static String toOgnl(final Matcher matcher) { final String expression = matcher.group(1); if (!(expression.startsWith("body.") || expression.startsWith("body[")) || isCollectionPath(expression)) { return expression; } final StringBuilder ognl = new StringBuilder(expression.len... | JsonSimplePredicate implements Predicate { static String toOgnl(final Matcher matcher) { final String expression = matcher.group(1); if (!(expression.startsWith("body.") || expression.startsWith("body[")) || isCollectionPath(expression)) { return expression; } final StringBuilder ognl = new StringBuilder(expression.len... | JsonSimplePredicate implements Predicate { static String toOgnl(final Matcher matcher) { final String expression = matcher.group(1); if (!(expression.startsWith("body.") || expression.startsWith("body[")) || isCollectionPath(expression)) { return expression; } final StringBuilder ognl = new StringBuilder(expression.len... |
@Test public void testType() { assertEquals(LTLType.AND, a_and_b.getLTLType()); assertEquals(LTLType.AND, a_and_c.getLTLType()); } | @Override public LTLType getLTLType(){ return LTLType.AND; } | And extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.AND; } } | And extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.AND; } And(ArrayList<LTLFormula> children); } | And extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.AND; } And(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @Override LTLFormula copy(); @Override LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); @Override ATransition d(HashMap<LTLFormula, ATransition> D); static void... | And extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.AND; } And(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @Override LTLFormula copy(); @Override LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); @Override ATransition d(HashMap<LTLFormula, ATransition> D); static void... |
@Test public void testCopy() { assertEquals(a_or_b, a_or_b.copy()); assertEquals(a_or_c, a_or_c.copy()); } | public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new Or(copiedChildren); } | Or extends LTLFormula { public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new Or(copiedChildren); } } | Or extends LTLFormula { public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new Or(copiedChildren); } Or(ArrayList<LTLFormula> children); } | Or extends LTLFormula { public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new Or(copiedChildren); } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); Linked... | Or extends LTLFormula { public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new Or(copiedChildren); } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); Linked... |
@Test public void testType() { assertEquals(LTLType.XOR, a_xor_b.getLTLType()); assertEquals(LTLType.XOR, a_xor_c.getLTLType()); } | @Override public LTLType getLTLType(){ return LTLType.XOR; } | XOr extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.XOR; } } | XOr extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.XOR; } XOr(ArrayList<LTLFormula> children); } | XOr extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.XOR; } XOr(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @Override LTLFormula normalize(); @Override LTLFormula copy(); static void main(String[] args); } | XOr extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.XOR; } XOr(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @Override LTLFormula normalize(); @Override LTLFormula copy(); static void main(String[] args); } |
@Test public void testLower() { LTLFormula expected = OrTest.makeOr(AndTest.makeAnd(new Negation(a), b), AndTest.makeAnd(a, new Negation(b))); assertEquals(expected, a_xor_b.simplify()); } | @Override protected LTLFormula lower(){ for(int i = 0; i < children.size(); ++i){ children.set(i,children.get(i).lower()); } ArrayList<LTLFormula> nextChildren; LTLFormula left = children.get(0); for(int i = 1; i < children.size(); ++i){ nextChildren = new ArrayList<LTLFormula>(2); LTLFormula right = children.get(i); n... | XOr extends LTLFormula { @Override protected LTLFormula lower(){ for(int i = 0; i < children.size(); ++i){ children.set(i,children.get(i).lower()); } ArrayList<LTLFormula> nextChildren; LTLFormula left = children.get(0); for(int i = 1; i < children.size(); ++i){ nextChildren = new ArrayList<LTLFormula>(2); LTLFormula r... | XOr extends LTLFormula { @Override protected LTLFormula lower(){ for(int i = 0; i < children.size(); ++i){ children.set(i,children.get(i).lower()); } ArrayList<LTLFormula> nextChildren; LTLFormula left = children.get(0); for(int i = 1; i < children.size(); ++i){ nextChildren = new ArrayList<LTLFormula>(2); LTLFormula r... | XOr extends LTLFormula { @Override protected LTLFormula lower(){ for(int i = 0; i < children.size(); ++i){ children.set(i,children.get(i).lower()); } ArrayList<LTLFormula> nextChildren; LTLFormula left = children.get(0); for(int i = 1; i < children.size(); ++i){ nextChildren = new ArrayList<LTLFormula>(2); LTLFormula r... | XOr extends LTLFormula { @Override protected LTLFormula lower(){ for(int i = 0; i < children.size(); ++i){ children.set(i,children.get(i).lower()); } ArrayList<LTLFormula> nextChildren; LTLFormula left = children.get(0); for(int i = 1; i < children.size(); ++i){ nextChildren = new ArrayList<LTLFormula>(2); LTLFormula r... |
@Test public void testCopy() { assertEquals(a_xor_b, a_xor_b.copy()); assertEquals(a_xor_c, a_xor_c.copy()); } | @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new XOr(copiedChildren); } | XOr extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new XOr(copiedChildren); } } | XOr extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new XOr(copiedChildren); } XOr(ArrayList<LTLFormula> children); } | XOr extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new XOr(copiedChildren); } XOr(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @O... | XOr extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new XOr(copiedChildren); } XOr(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @O... |
@Test public void equalityTest() { ERE a_x5_again = Repeat.get(a, 5); assertEquals(a_x5, a_x5_again); assertEquals(0, a_x5.compareTo(a_x5_again)); } | public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } |
@Test public void inequalityTest() { ERE a_x10 = Repeat.get(a, 10); Symbol b = Symbol.get("b"); ERE b_x5 = Repeat.get(b, 5); assertFalse(a_x5.equals(a_x10)); assertFalse(0 == a_x5.compareTo(a_x10)); assertFalse(a_x5.equals(b_x5)); assertFalse(0 == a_x5.compareTo(b_x5)); } | public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } |
@Test public void deriveTest() { Symbol a = Symbol.get("a"); Epsilon epsilon = Epsilon.get(); assertEquals(epsilon, a_x3.derive(a).derive(a).derive(a)); Empty empty = Empty.get(); assertEquals(empty, a_x3.derive(a).derive(a).derive(a).derive(a)); Symbol b = Symbol.get("b"); assertEquals(empty, a_x3.derive(b)); } | public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } | Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } static ERE get(ERE child, int num); } |
@Test public void testEquality() { ERE one = Concat.get(a, b); ERE two = Concat.get(a, b); assertEquals(one, two); assertEquals(0, one.compareTo(two)); } | public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean ... | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean ... |
@Test public void testInequality() { ERE one = Concat.get(a, b); ERE two = Concat.get(a, c); assertFalse(one.equals(two)); assertFalse(0 == one.compareTo(two)); assertFalse(one.equals(a)); assertFalse(0 == one.compareTo(a)); } | public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); } | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean ... | Concat extends ERE { public static ERE get(ERE left, ERE right) { Concat cat = new Concat(left, right); ERE ret = cat.simplify(); return ret; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean ... |
@Test public void testContainsEpsilon() { Epsilon epsilon = Epsilon.get(); assertFalse(Concat.get(a, b).containsEpsilon()); assertFalse(Concat.get(a, epsilon).containsEpsilon()); assertFalse(Concat.get(epsilon, b).containsEpsilon()); assertTrue(Concat.get(epsilon, epsilon).containsEpsilon()); } | @Override public boolean containsEpsilon() { for(ERE child : children) { if(!child.containsEpsilon()) { return false; } } return true; } | Concat extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(!child.containsEpsilon()) { return false; } } return true; } } | Concat extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(!child.containsEpsilon()) { return false; } } return true; } private Concat(ERE left, ERE right); } | Concat extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(!child.containsEpsilon()) { return false; } } return true; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Ove... | Concat extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(!child.containsEpsilon()) { return false; } } return true; } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Ove... |
@Test public void testNormalize() { { ArrayList<LTLFormula> orElements = new ArrayList<LTLFormula>( Arrays.asList(new Negation(a), new Negation(b))); Collections.sort(orElements); Or expected = new Or(orElements); assertEquals(expected, a_and_b.copy().normalize(true)); } assertEquals(makeAnd(a, c), a_and_c.normalize(fa... | @Override protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new Or(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } | And extends LTLFormula { @Override protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new Or(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } } | And extends LTLFormula { @Override protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new Or(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } And(... | And extends LTLFormula { @Override protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new Or(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } And(... | And extends LTLFormula { @Override protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new Or(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } And(... |
@Test public void testSimplify() { Epsilon epsilon = Epsilon.get(); Empty empty = Empty.get(); assertEquals(empty, Concat.get(a, empty)); assertEquals(empty, Concat.get(empty, a)); assertEquals(a, Concat.get(a, epsilon)); assertEquals(a, Concat.get(epsilon, a)); assertEquals(empty, Concat.get(epsilon, empty)); assertEq... | private ERE simplify(){ if(children.get(0) == Empty.get()) { return Empty.get(); } else if(children.get(1) == Empty.get()) { return Empty.get(); } else if(children.get(0) == Epsilon.get()) { return children.get(1); } else if(children.get(1) == Epsilon.get()) { return children.get(0); } return this; } | Concat extends ERE { private ERE simplify(){ if(children.get(0) == Empty.get()) { return Empty.get(); } else if(children.get(1) == Empty.get()) { return Empty.get(); } else if(children.get(0) == Epsilon.get()) { return children.get(1); } else if(children.get(1) == Epsilon.get()) { return children.get(0); } return this;... | Concat extends ERE { private ERE simplify(){ if(children.get(0) == Empty.get()) { return Empty.get(); } else if(children.get(1) == Empty.get()) { return Empty.get(); } else if(children.get(0) == Epsilon.get()) { return children.get(1); } else if(children.get(1) == Epsilon.get()) { return children.get(0); } return this;... | Concat extends ERE { private ERE simplify(){ if(children.get(0) == Empty.get()) { return Empty.get(); } else if(children.get(1) == Empty.get()) { return Empty.get(); } else if(children.get(0) == Epsilon.get()) { return children.get(1); } else if(children.get(1) == Epsilon.get()) { return children.get(0); } return this;... | Concat extends ERE { private ERE simplify(){ if(children.get(0) == Empty.get()) { return Empty.get(); } else if(children.get(1) == Empty.get()) { return Empty.get(); } else if(children.get(0) == Epsilon.get()) { return children.get(1); } else if(children.get(1) == Epsilon.get()) { return children.get(0); } return this;... |
@Test public void testCopy() { ERE concat = Concat.get(a, b); ERE copy = concat.copy(); assertEquals(concat, copy); } | @Override public ERE copy() { return new Concat(children.get(0).copy(), children.get(1).copy()); } | Concat extends ERE { @Override public ERE copy() { return new Concat(children.get(0).copy(), children.get(1).copy()); } } | Concat extends ERE { @Override public ERE copy() { return new Concat(children.get(0).copy(), children.get(1).copy()); } private Concat(ERE left, ERE right); } | Concat extends ERE { @Override public ERE copy() { return new Concat(children.get(0).copy(), children.get(1).copy()); } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Over... | Concat extends ERE { @Override public ERE copy() { return new Concat(children.get(0).copy(), children.get(1).copy()); } private Concat(ERE left, ERE right); static ERE get(ERE left, ERE right); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Over... |
@Test public void testDerive() { Epsilon epsilon = Epsilon.get(); Empty empty = Empty.get(); ERE ab = Concat.get(a, b); assertEquals(b, ab.derive(a)); assertEquals(empty, ab.derive(b)); ERE aStar = Kleene.get(a); ERE aStarb = Concat.get(aStar, b); assertEquals(aStarb, aStarb.derive(a)); assertEquals(epsilon, aStarb.der... | @Override public ERE derive(Symbol s){ ERE left = children.get(0); ERE right = children.get(1); if(left.containsEpsilon()) { ArrayList<ERE> orChildren = new ArrayList<ERE>(2); orChildren.add(Concat.get(left.derive(s), right.copy())); orChildren.add(right.derive(s)); return Or.get(orChildren); } return Concat.get(left.d... | Concat extends ERE { @Override public ERE derive(Symbol s){ ERE left = children.get(0); ERE right = children.get(1); if(left.containsEpsilon()) { ArrayList<ERE> orChildren = new ArrayList<ERE>(2); orChildren.add(Concat.get(left.derive(s), right.copy())); orChildren.add(right.derive(s)); return Or.get(orChildren); } ret... | Concat extends ERE { @Override public ERE derive(Symbol s){ ERE left = children.get(0); ERE right = children.get(1); if(left.containsEpsilon()) { ArrayList<ERE> orChildren = new ArrayList<ERE>(2); orChildren.add(Concat.get(left.derive(s), right.copy())); orChildren.add(right.derive(s)); return Or.get(orChildren); } ret... | Concat extends ERE { @Override public ERE derive(Symbol s){ ERE left = children.get(0); ERE right = children.get(1); if(left.containsEpsilon()) { ArrayList<ERE> orChildren = new ArrayList<ERE>(2); orChildren.add(Concat.get(left.derive(s), right.copy())); orChildren.add(right.derive(s)); return Or.get(orChildren); } ret... | Concat extends ERE { @Override public ERE derive(Symbol s){ ERE left = children.get(0); ERE right = children.get(1); if(left.containsEpsilon()) { ArrayList<ERE> orChildren = new ArrayList<ERE>(2); orChildren.add(Concat.get(left.derive(s), right.copy())); orChildren.add(right.derive(s)); return Or.get(orChildren); } ret... |
@Test public void testConcat() { ERE ab = Concat.get(a, b); String fsm = "s0 [" + NEWLINE + " a -> s1" + NEWLINE + "]" + NEWLINE + "s1 [" + NEWLINE + " b -> s2" + NEWLINE + "]" + NEWLINE + "s2 [" + NEWLINE + "]" + NEWLINE + "alias match = s2 " + NEWLINE; assertEquals(fsm, printFSM(ab, a, b)); } | static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); public LinkedHashMap<ERE, LinkedHashMap<Symbol, ERE>> contents; public LinkedHashSet<ERE> match; } |
@Test public void testOr() { ERE or = Or.get(new ArrayList<ERE>(Arrays.asList(a, b))); String fsm = "s0 [" + NEWLINE + " a -> s1" + NEWLINE + " b -> s1" + NEWLINE + "]" + NEWLINE + "s1 [" + NEWLINE + "]" + NEWLINE + "alias match = s1 " + NEWLINE; assertEquals(fsm, printFSM(or, a, b)); } | static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); public LinkedHashMap<ERE, LinkedHashMap<Symbol, ERE>> contents; public LinkedHashSet<ERE> match; } |
@Test public void testKleene() { ERE aStar = Kleene.get(a); String fsm = "s0 [" + NEWLINE + " a -> s0" + NEWLINE + "]" + NEWLINE + "alias match = s0 " + NEWLINE; assertEquals(fsm, printFSM(aStar, a)); } | static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); } | FSM { static public FSM get(ERE input, Symbol[] events) { return new FSM(input, events); } private FSM(ERE input, Symbol[] events); static FSM get(ERE input, Symbol[] events); void print(PrintStream p); public LinkedHashMap<ERE, LinkedHashMap<Symbol, ERE>> contents; public LinkedHashSet<ERE> match; } |
@Test public void testEquality() { ERE one = Negation.get(symbol); ERE one_again = Negation.get(symbol); assertEquals(one, one_again); assertEquals(0, one.compareTo(one_again)); } | public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... |
@Test public void testInequality() { Epsilon epsilon = Epsilon.get(); ERE one = Negation.get(symbol); ERE two = Negation.get(epsilon); assertFalse(one.equals(two)); assertFalse(0 == one.compareTo(two)); } | public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... |
@Test public void testSimplification() { ERE negation = Negation.get(symbol); ERE doubleNegation = Negation.get(negation); assertEquals(symbol, doubleNegation); } | public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); } | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... | Negation extends ERE { public static ERE get(ERE child) { if(child.getEREType() == EREType.NEG) return child.children.get(0); return new Negation(child); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contai... |
@Test public void testContainsEpsilon() { ERE negateEmpty = Negation.get(empty); ERE negateEpsilon = Negation.get(epsilon); assertTrue(negateEmpty.containsEpsilon()); assertFalse(negateEpsilon.containsEpsilon()); } | @Override public boolean containsEpsilon() { return !(children.get(0).containsEpsilon()); } | Negation extends ERE { @Override public boolean containsEpsilon() { return !(children.get(0).containsEpsilon()); } } | Negation extends ERE { @Override public boolean containsEpsilon() { return !(children.get(0).containsEpsilon()); } private Negation(ERE child); } | Negation extends ERE { @Override public boolean containsEpsilon() { return !(children.get(0).containsEpsilon()); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol ... | Negation extends ERE { @Override public boolean containsEpsilon() { return !(children.get(0).containsEpsilon()); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol ... |
@Test public void testReduce() { { And duplicate = makeAnd(a, b, c, a, b, c); assertEquals(makeAnd(a, b, c), duplicate.reduce()); } { And combined = makeAnd(a_and_b,a_and_c); assertEquals(makeAnd(a, b, c), combined.reduce()); } { And withTrue = makeAnd(a, b, True.get()); assertEquals(a_and_b, withTrue.reduce()); } { An... | @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == False.get()){ return False.get(); } if(children.get(i) == True.get()){... | And extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == False.get()){ return False.get(); } if(childr... | And extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == False.get()){ return False.get(); } if(childr... | And extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == False.get()){ return False.get(); } if(childr... | And extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == False.get()){ return False.get(); } if(childr... |
@Test public void testDerive() { ERE negateEmpty = Negation.get(empty); ERE negateEpsilon = Negation.get(epsilon); ERE derived = negateEpsilon.derive(Symbol.get("test")); assertEquals(negateEmpty, derived); } | @Override public ERE derive(Symbol s) { return Negation.get(children.get(0).derive(s)); } | Negation extends ERE { @Override public ERE derive(Symbol s) { return Negation.get(children.get(0).derive(s)); } } | Negation extends ERE { @Override public ERE derive(Symbol s) { return Negation.get(children.get(0).derive(s)); } private Negation(ERE child); } | Negation extends ERE { @Override public ERE derive(Symbol s) { return Negation.get(children.get(0).derive(s)); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s)... | Negation extends ERE { @Override public ERE derive(Symbol s) { return Negation.get(children.get(0).derive(s)); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s)... |
@Test public void testCopy() { ERE negation = Negation.get(empty); ERE copy = negation.copy(); assertEquals(negation, copy); } | @Override public ERE copy() { return new Negation(children.get(0).copy()); } | Negation extends ERE { @Override public ERE copy() { return new Negation(children.get(0).copy()); } } | Negation extends ERE { @Override public ERE copy() { return new Negation(children.get(0).copy()); } private Negation(ERE child); } | Negation extends ERE { @Override public ERE copy() { return new Negation(children.get(0).copy()); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Negation extends ERE { @Override public ERE copy() { return new Negation(children.get(0).copy()); } private Negation(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testCopy() { ERE copy = one.copy(); assertEquals(one, copy); } | @Override public ERE copy() { return this; } | Symbol extends ERE { @Override public ERE copy() { return this; } } | Symbol extends ERE { @Override public ERE copy() { return this; } private Symbol(); } | Symbol extends ERE { @Override public ERE copy() { return this; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ER... | Symbol extends ERE { @Override public ERE copy() { return this; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ER... |
@Test public void testEREType() { EREType type = one.getEREType(); assertEquals(EREType.S, type); } | @Override public EREType getEREType() { return EREType.S; } | Symbol extends ERE { @Override public EREType getEREType() { return EREType.S; } } | Symbol extends ERE { @Override public EREType getEREType() { return EREType.S; } private Symbol(); } | Symbol extends ERE { @Override public EREType getEREType() { return EREType.S; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(... | Symbol extends ERE { @Override public EREType getEREType() { return EREType.S; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(... |
@Test public void testContainsEpsilon() { assertFalse(one.containsEpsilon()); } | @Override public boolean containsEpsilon() { return false; } | Symbol extends ERE { @Override public boolean containsEpsilon() { return false; } } | Symbol extends ERE { @Override public boolean containsEpsilon() { return false; } private Symbol(); } | Symbol extends ERE { @Override public boolean containsEpsilon() { return false; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon... | Symbol extends ERE { @Override public boolean containsEpsilon() { return false; } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon... |
@Test public void testDerive() { Empty empty = Empty.get(); Epsilon epsilon = Epsilon.get(); assertEquals(epsilon, one.derive(one)); assertEquals(empty, one.derive(two)); assertEquals(epsilon, two.derive(two)); assertEquals(empty, two.derive(one)); } | @Override public ERE derive(Symbol s) { if(this == s) { return Epsilon.get(); } return Empty.get(); } | Symbol extends ERE { @Override public ERE derive(Symbol s) { if(this == s) { return Epsilon.get(); } return Empty.get(); } } | Symbol extends ERE { @Override public ERE derive(Symbol s) { if(this == s) { return Epsilon.get(); } return Empty.get(); } private Symbol(); } | Symbol extends ERE { @Override public ERE derive(Symbol s) { if(this == s) { return Epsilon.get(); } return Empty.get(); } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toSt... | Symbol extends ERE { @Override public ERE derive(Symbol s) { if(this == s) { return Epsilon.get(); } return Empty.get(); } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toSt... |
@Test public void testString() { assertEquals("one", one.toString()); assertEquals("two", two.toString()); } | @Override public String toString() { return refToString.get(this); } | Symbol extends ERE { @Override public String toString() { return refToString.get(this); } } | Symbol extends ERE { @Override public String toString() { return refToString.get(this); } private Symbol(); } | Symbol extends ERE { @Override public String toString() { return refToString.get(this); } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean contain... | Symbol extends ERE { @Override public String toString() { return refToString.get(this); } private Symbol(); static Symbol get(String name); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean contain... |
@Test public void testType() { assertEquals(empty.getEREType(), EREType.EMP); } | @Override public EREType getEREType() { return EREType.EMP; } | Empty extends ERE { @Override public EREType getEREType() { return EREType.EMP; } } | Empty extends ERE { @Override public EREType getEREType() { return EREType.EMP; } private Empty(); } | Empty extends ERE { @Override public EREType getEREType() { return EREType.EMP; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override... | Empty extends ERE { @Override public EREType getEREType() { return EREType.EMP; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override... |
@Test public void testString() { assertEquals("empty", empty.toString()); } | @Override public String toString() { return "empty"; } | Empty extends ERE { @Override public String toString() { return "empty"; } } | Empty extends ERE { @Override public String toString() { return "empty"; } private Empty(); } | Empty extends ERE { @Override public String toString() { return "empty"; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE de... | Empty extends ERE { @Override public String toString() { return "empty"; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE de... |
@Test public void testDerive() { ERE derived = empty.derive(Symbol.get("test")); assertEquals(empty, derived); } | @Override public ERE derive(Symbol s) { return empty; } | Empty extends ERE { @Override public ERE derive(Symbol s) { return empty; } } | Empty extends ERE { @Override public ERE derive(Symbol s) { return empty; } private Empty(); } | Empty extends ERE { @Override public ERE derive(Symbol s) { return empty; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE d... | Empty extends ERE { @Override public ERE derive(Symbol s) { return empty; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE d... |
@Test public void testCopy() { assertEquals(a_and_b, a_and_b.copy()); assertEquals(a_and_c, a_and_c.copy()); } | @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new And(copiedChildren); } | And extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new And(copiedChildren); } } | And extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new And(copiedChildren); } And(ArrayList<LTLFormula> children); } | And extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new And(copiedChildren); } And(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @O... | And extends LTLFormula { @Override public LTLFormula copy() { ArrayList<LTLFormula> copiedChildren = new ArrayList<LTLFormula>(children.size()); for(LTLFormula child : children){ copiedChildren.add(child.copy()); } return new And(copiedChildren); } And(ArrayList<LTLFormula> children); @Override LTLType getLTLType(); @O... |
@Test public void testContainsEpsilon() { assertFalse(empty.containsEpsilon()); } | @Override public boolean containsEpsilon() { return false; } | Empty extends ERE { @Override public boolean containsEpsilon() { return false; } } | Empty extends ERE { @Override public boolean containsEpsilon() { return false; } private Empty(); } | Empty extends ERE { @Override public boolean containsEpsilon() { return false; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ... | Empty extends ERE { @Override public boolean containsEpsilon() { return false; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ... |
@Test public void testCopy() { ERE copy = empty.copy(); assertEquals(empty, copy); } | @Override public ERE copy() { return this; } | Empty extends ERE { @Override public ERE copy() { return this; } } | Empty extends ERE { @Override public ERE copy() { return this; } private Empty(); } | Empty extends ERE { @Override public ERE copy() { return this; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE derive(Symbo... | Empty extends ERE { @Override public ERE copy() { return this; } private Empty(); static Empty get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE derive(Symbo... |
@Test public void testEquality() { ERE or_again = Or.get(new ArrayList<ERE>(Arrays.asList(a, b))); ERE or_reverse = Or.get(new ArrayList<ERE>(Arrays.asList(a, b))); assertEquals(aOrb, or_again); assertEquals(0, aOrb.compareTo(or_again)); assertEquals(aOrb, or_reverse); assertEquals(0, aOrb.compareTo(or_reverse)); } | static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contains... | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contains... |
@Test public void testInequality() { Symbol c = Symbol.get("c"); ERE aOrc = Or.get(new ArrayList<ERE>(Arrays.asList(a, c))); assertFalse(aOrb.equals(aOrc)); assertFalse(0 == aOrb.compareTo(aOrc)); assertFalse(aOrb.equals(a)); assertFalse(0 == aOrb.compareTo(a)); } | static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); } | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contains... | Or extends ERE { static public ERE get(List<ERE> children) { Or or = new Or(children); ERE ret = or.simplify(); return ret; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean contains... |
@Test public void testCopy() { ERE copy = aOrb.copy(); assertEquals(aOrb, copy); } | @Override public ERE copy() { ArrayList<ERE> retChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { retChildren.add(child.copy()); } return new Or(retChildren); } | Or extends ERE { @Override public ERE copy() { ArrayList<ERE> retChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { retChildren.add(child.copy()); } return new Or(retChildren); } } | Or extends ERE { @Override public ERE copy() { ArrayList<ERE> retChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { retChildren.add(child.copy()); } return new Or(retChildren); } private Or(List<ERE> children); } | Or extends ERE { @Override public ERE copy() { ArrayList<ERE> retChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { retChildren.add(child.copy()); } return new Or(retChildren); } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType();... | Or extends ERE { @Override public ERE copy() { ArrayList<ERE> retChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { retChildren.add(child.copy()); } return new Or(retChildren); } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType();... |
@Test public void testEREType() { assertEquals(EREType.OR, aOrb.getEREType()); } | @Override public EREType getEREType() { return EREType.OR; } | Or extends ERE { @Override public EREType getEREType() { return EREType.OR; } } | Or extends ERE { @Override public EREType getEREType() { return EREType.OR; } private Or(List<ERE> children); } | Or extends ERE { @Override public EREType getEREType() { return EREType.OR; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Or extends ERE { @Override public EREType getEREType() { return EREType.OR; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testContainsEpsilon() { assertFalse(aOrb.containsEpsilon()); Epsilon epsilon = Epsilon.get(); ERE aOrepsilon = Or.get(new ArrayList<ERE>(Arrays.asList(a, epsilon))); assertTrue(aOrepsilon.containsEpsilon()); } | @Override public boolean containsEpsilon() { for(ERE child : children) { if(child.containsEpsilon()) { return true; } } return false; } | Or extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(child.containsEpsilon()) { return true; } } return false; } } | Or extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(child.containsEpsilon()) { return true; } } return false; } private Or(List<ERE> children); } | Or extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(child.containsEpsilon()) { return true; } } return false; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy();... | Or extends ERE { @Override public boolean containsEpsilon() { for(ERE child : children) { if(child.containsEpsilon()) { return true; } } return false; } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType getEREType(); @Override String toString(); @Override ERE copy();... |
@Test public void testDerive() { Symbol c = Symbol.get("c"); Epsilon epsilon = Epsilon.get(); Empty empty = Empty.get(); assertEquals(epsilon, aOrb.derive(a)); assertEquals(epsilon, aOrb.derive(b)); assertEquals(empty, aOrb.derive(c)); } | @Override public ERE derive(Symbol s) { ArrayList<ERE> orChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { orChildren.add(child.derive(s)); } return Or.get(orChildren); } | Or extends ERE { @Override public ERE derive(Symbol s) { ArrayList<ERE> orChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { orChildren.add(child.derive(s)); } return Or.get(orChildren); } } | Or extends ERE { @Override public ERE derive(Symbol s) { ArrayList<ERE> orChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { orChildren.add(child.derive(s)); } return Or.get(orChildren); } private Or(List<ERE> children); } | Or extends ERE { @Override public ERE derive(Symbol s) { ArrayList<ERE> orChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { orChildren.add(child.derive(s)); } return Or.get(orChildren); } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType get... | Or extends ERE { @Override public ERE derive(Symbol s) { ArrayList<ERE> orChildren = new ArrayList<ERE>(children.size()); for(ERE child : children) { orChildren.add(child.derive(s)); } return Or.get(orChildren); } private Or(List<ERE> children); static ERE get(List<ERE> children); ERE simplify(); @Override EREType get... |
@Test public void testSimplify() { Symbol c = Symbol.get("c"); Epsilon epsilon = Epsilon.get(); assertEquals(aOrb, Or.get(new ArrayList<ERE>(Arrays.asList(a, b, a, b, a, b, a, b, a)))); assertEquals(Or.get(new ArrayList<ERE>(Arrays.asList(a, b, c))), Or.get(new ArrayList<ERE>(Arrays.asList(aOrb, c)))); } | public ERE simplify() { ArrayList<ERE> flattened = new ArrayList<ERE>(children.size() >> 1); ArrayList<ERE> previous = new ArrayList<ERE>(children); boolean changed = true; while(changed) { changed = false; flattened = new ArrayList<ERE>(children.size()); for(ERE child : previous) { if(child.getEREType() == EREType.OR)... | Or extends ERE { public ERE simplify() { ArrayList<ERE> flattened = new ArrayList<ERE>(children.size() >> 1); ArrayList<ERE> previous = new ArrayList<ERE>(children); boolean changed = true; while(changed) { changed = false; flattened = new ArrayList<ERE>(children.size()); for(ERE child : previous) { if(child.getEREType... | Or extends ERE { public ERE simplify() { ArrayList<ERE> flattened = new ArrayList<ERE>(children.size() >> 1); ArrayList<ERE> previous = new ArrayList<ERE>(children); boolean changed = true; while(changed) { changed = false; flattened = new ArrayList<ERE>(children.size()); for(ERE child : previous) { if(child.getEREType... | Or extends ERE { public ERE simplify() { ArrayList<ERE> flattened = new ArrayList<ERE>(children.size() >> 1); ArrayList<ERE> previous = new ArrayList<ERE>(children); boolean changed = true; while(changed) { changed = false; flattened = new ArrayList<ERE>(children.size()); for(ERE child : previous) { if(child.getEREType... | Or extends ERE { public ERE simplify() { ArrayList<ERE> flattened = new ArrayList<ERE>(children.size() >> 1); ArrayList<ERE> previous = new ArrayList<ERE>(children); boolean changed = true; while(changed) { changed = false; flattened = new ArrayList<ERE>(children.size()); for(ERE child : previous) { if(child.getEREType... |
@Test public void testEquality() { ERE aStar_again = Kleene.get(a); assertEquals(aStar, aStar_again); assertEquals(0, aStar.compareTo(aStar_again)); } | public static ERE get(ERE child) { return new Kleene(child); } | Kleene extends ERE { public static ERE get(ERE child) { return new Kleene(child); } } | Kleene extends ERE { public static ERE get(ERE child) { return new Kleene(child); } private Kleene(ERE child); } | Kleene extends ERE { public static ERE get(ERE child) { return new Kleene(child); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Kleene extends ERE { public static ERE get(ERE child) { return new Kleene(child); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testCopy() { LTLFormula a_copy = a.copy(); assertEquals(a, a_copy); assertEquals(0, a.compareTo(a_copy)); assertEquals(a.hashCode(), a_copy.hashCode()); } | @Override public LTLFormula copy(){ return this; } | Atom extends LTLFormula { @Override public LTLFormula copy(){ return this; } } | Atom extends LTLFormula { @Override public LTLFormula copy(){ return this; } private Atom(); } | Atom extends LTLFormula { @Override public LTLFormula copy(){ return this; } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Override void subFormulae(LinkedHa... | Atom extends LTLFormula { @Override public LTLFormula copy(){ return this; } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Override void subFormulae(LinkedHa... |
@Test public void testEREType() { assertEquals(EREType.STAR, aStar.getEREType()); } | @Override public EREType getEREType() { return EREType.STAR; } | Kleene extends ERE { @Override public EREType getEREType() { return EREType.STAR; } } | Kleene extends ERE { @Override public EREType getEREType() { return EREType.STAR; } private Kleene(ERE child); } | Kleene extends ERE { @Override public EREType getEREType() { return EREType.STAR; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Kleene extends ERE { @Override public EREType getEREType() { return EREType.STAR; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testString() { assertEquals("a*", aStar.toString()); } | @Override public String toString() { return children.get(0) + "*"; } | Kleene extends ERE { @Override public String toString() { return children.get(0) + "*"; } } | Kleene extends ERE { @Override public String toString() { return children.get(0) + "*"; } private Kleene(ERE child); } | Kleene extends ERE { @Override public String toString() { return children.get(0) + "*"; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Kleene extends ERE { @Override public String toString() { return children.get(0) + "*"; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testContainsEpsilon() { assertTrue(aStar.containsEpsilon()); } | @Override public boolean containsEpsilon() { return true; } | Kleene extends ERE { @Override public boolean containsEpsilon() { return true; } } | Kleene extends ERE { @Override public boolean containsEpsilon() { return true; } private Kleene(ERE child); } | Kleene extends ERE { @Override public boolean containsEpsilon() { return true; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Kleene extends ERE { @Override public boolean containsEpsilon() { return true; } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testCopy() { ERE copy = aStar.copy(); assertEquals(aStar, copy); } | @Override public ERE copy() { return new Kleene(children.get(0).copy()); } | Kleene extends ERE { @Override public ERE copy() { return new Kleene(children.get(0).copy()); } } | Kleene extends ERE { @Override public ERE copy() { return new Kleene(children.get(0).copy()); } private Kleene(ERE child); } | Kleene extends ERE { @Override public ERE copy() { return new Kleene(children.get(0).copy()); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } | Kleene extends ERE { @Override public ERE copy() { return new Kleene(children.get(0).copy()); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol s); } |
@Test public void testDerive() { Epsilon epsilon = Epsilon.get(); Empty empty = Empty.get(); assertEquals(aStar, aStar.derive(a)); assertEquals(empty, aStar.derive(b)); ERE ab = Concat.get(a, b); ERE ab_Star = Kleene.get(ab); assertEquals(ab_Star, ab_Star.derive(a).derive(b)); assertEquals(empty, ab_Star.derive(b)); } | @Override public ERE derive(Symbol s) { return Concat.get(children.get(0).derive(s), copy()); } | Kleene extends ERE { @Override public ERE derive(Symbol s) { return Concat.get(children.get(0).derive(s), copy()); } } | Kleene extends ERE { @Override public ERE derive(Symbol s) { return Concat.get(children.get(0).derive(s), copy()); } private Kleene(ERE child); } | Kleene extends ERE { @Override public ERE derive(Symbol s) { return Concat.get(children.get(0).derive(s), copy()); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol ... | Kleene extends ERE { @Override public ERE derive(Symbol s) { return Concat.get(children.get(0).derive(s), copy()); } private Kleene(ERE child); static ERE get(ERE child); @Override EREType getEREType(); @Override String toString(); @Override ERE copy(); @Override boolean containsEpsilon(); @Override ERE derive(Symbol ... |
@Test public void testType() { assertEquals(epsilon.getEREType(), EREType.EPS); } | @Override public EREType getEREType() { return EREType.EPS; } | Epsilon extends ERE { @Override public EREType getEREType() { return EREType.EPS; } } | Epsilon extends ERE { @Override public EREType getEREType() { return EREType.EPS; } private Epsilon(); } | Epsilon extends ERE { @Override public EREType getEREType() { return EREType.EPS; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Ov... | Epsilon extends ERE { @Override public EREType getEREType() { return EREType.EPS; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Ov... |
@Test public void testString() { assertEquals("epsilon", epsilon.toString()); } | @Override public String toString() { return "epsilon"; } | Epsilon extends ERE { @Override public String toString() { return "epsilon"; } } | Epsilon extends ERE { @Override public String toString() { return "epsilon"; } private Epsilon(); } | Epsilon extends ERE { @Override public String toString() { return "epsilon"; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Overrid... | Epsilon extends ERE { @Override public String toString() { return "epsilon"; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Overrid... |
@Test public void testDerive() { ERE derived = epsilon.derive(Symbol.get("test")); Empty empty = Empty.get(); assertEquals(empty, derived); } | @Override public ERE derive(Symbol s) { return Empty.get(); } | Epsilon extends ERE { @Override public ERE derive(Symbol s) { return Empty.get(); } } | Epsilon extends ERE { @Override public ERE derive(Symbol s) { return Empty.get(); } private Epsilon(); } | Epsilon extends ERE { @Override public ERE derive(Symbol s) { return Empty.get(); } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Ov... | Epsilon extends ERE { @Override public ERE derive(Symbol s) { return Empty.get(); } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Ov... |
@Test public void testContainsEpsilon() { assertTrue(epsilon.containsEpsilon()); } | @Override public boolean containsEpsilon() { return true; } | Epsilon extends ERE { @Override public boolean containsEpsilon() { return true; } } | Epsilon extends ERE { @Override public boolean containsEpsilon() { return true; } private Epsilon(); } | Epsilon extends ERE { @Override public boolean containsEpsilon() { return true; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Over... | Epsilon extends ERE { @Override public boolean containsEpsilon() { return true; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Over... |
@Test public void testCopy() { ERE copy = epsilon.copy(); assertEquals(epsilon, copy); } | @Override public ERE copy() { return this; } | Epsilon extends ERE { @Override public ERE copy() { return this; } } | Epsilon extends ERE { @Override public ERE copy() { return this; } private Epsilon(); } | Epsilon extends ERE { @Override public ERE copy() { return this; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE derive... | Epsilon extends ERE { @Override public ERE copy() { return this; } private Epsilon(); static Epsilon get(); @Override EREType getEREType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override ERE copy(); @Override String toString(); @Override boolean containsEpsilon(); @Override ERE derive... |
@Test public void testToString() { assertEquals("a", a.toString()); assertEquals("b", b.toString()); } | @Override public String toString(){ return LTLFormula.refToString.get(this); } | Atom extends LTLFormula { @Override public String toString(){ return LTLFormula.refToString.get(this); } } | Atom extends LTLFormula { @Override public String toString(){ return LTLFormula.refToString.get(this); } private Atom(); } | Atom extends LTLFormula { @Override public String toString(){ return LTLFormula.refToString.get(this); } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Overri... | Atom extends LTLFormula { @Override public String toString(){ return LTLFormula.refToString.get(this); } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Overri... |
@Test public void stringTest() { assertEquals("#epsilon", empty.toString()); assertEquals("a b ", sequenceAB.toString()); assertEquals("a b c ", sequenceABC.toString()); } | public String toString() { if(size() == 0) return "#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toString()); sb.append(" "); } return sb.toString(); } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toString() { if(size() == 0) return "#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toString()); sb.append(" "); } return sb.toString(); } } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toString() { if(size() == 0) return "#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toString()); sb.append(" "); } return sb.toString(); } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> sy... | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toString() { if(size() == 0) return "#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toString()); sb.append(" "); } return sb.toString(); } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> sy... | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toString() { if(size() == 0) return "#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toString()); sb.append(" "); } return sb.toString(); } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> sy... |
@Test public void dotStringTest() { assertEquals("\\#epsilon", empty.toDotString()); assertEquals("a\\ b", sequenceAB.toDotString()); assertEquals("a\\ b\\ c", sequenceABC.toDotString()); } | public String toDotString() { if(size() == 0) return "\\#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toDotString()); sb.append("\\ "); } String ret = sb.toString(); return ret.substring(0,ret.length() - 2); } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toDotString() { if(size() == 0) return "\\#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toDotString()); sb.append("\\ "); } String ret = sb.toString(); return ret.substring(0,ret.length() - 2); } } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toDotString() { if(size() == 0) return "\\#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toDotString()); sb.append("\\ "); } String ret = sb.toString(); return ret.substring(0,ret.length() - 2); } Seque... | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toDotString() { if(size() == 0) return "\\#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toDotString()); sb.append("\\ "); } String ret = sb.toString(); return ret.substring(0,ret.length() - 2); } Seque... | Sequence extends ArrayList<Symbol> implements AbstractSequence { public String toDotString() { if(size() == 0) return "\\#epsilon"; StringBuilder sb = new StringBuilder(); for(Symbol s : this) { sb.append(s.toDotString()); sb.append("\\ "); } String ret = sb.toString(); return ret.substring(0,ret.length() - 2); } Seque... |
@Test public void testCopy() { Sequence[] copies = { new Sequence(sequenceABC), sequenceABC.copy() }; for(Sequence sequenceABCD : copies) { assertEquals(3, sequenceABCD.size()); assertEquals(sequenceABC, sequenceABCD); sequenceABCD.add(d); assertEquals(4, sequenceABCD.size()); assertEquals(3, sequenceABC.size()); asser... | public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); } | Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(); static void p... | Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(); static void p... |
@Test public void testDotLength() { assertEquals(8, empty.dotLength()); assertEquals(2, sequenceAB.dotLength()); assertEquals(3, sequenceABC.dotLength()); } | @Override public int dotLength() { if(isEmpty()) return 8; int len = 0; for(Symbol s: this) { len += s.length(); } return len; } | Sequence extends ArrayList<Symbol> implements AbstractSequence { @Override public int dotLength() { if(isEmpty()) return 8; int len = 0; for(Symbol s: this) { len += s.length(); } return len; } } | Sequence extends ArrayList<Symbol> implements AbstractSequence { @Override public int dotLength() { if(isEmpty()) return 8; int len = 0; for(Symbol s: this) { len += s.length(); } return len; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); } | Sequence extends ArrayList<Symbol> implements AbstractSequence { @Override public int dotLength() { if(isEmpty()) return 8; int len = 0; for(Symbol s: this) { len += s.length(); } return len; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(... | Sequence extends ArrayList<Symbol> implements AbstractSequence { @Override public int dotLength() { if(isEmpty()) return 8; int len = 0; for(Symbol s: this) { len += s.length(); } return len; } Sequence(int size); Sequence(); Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(... |
@Test public void testInit() { assertEquals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]", l.toString()); int i = 1; for(String s : l) { assertEquals(Integer.toString(i), s); i++; } } | @Override public String toString() { if(head == null) return "#epsilon"; StringBuilder sb = new StringBuilder("["); Node node = head; while(node != null) { sb.append(node.element.toString()); sb.append(", "); node = node.next; } String ret = sb.substring(0, sb.length() - 2); return ret + "]"; } | SinglyLinkedList implements Iterable<E> { @Override public String toString() { if(head == null) return "#epsilon"; StringBuilder sb = new StringBuilder("["); Node node = head; while(node != null) { sb.append(node.element.toString()); sb.append(", "); node = node.next; } String ret = sb.substring(0, sb.length() - 2); re... | SinglyLinkedList implements Iterable<E> { @Override public String toString() { if(head == null) return "#epsilon"; StringBuilder sb = new StringBuilder("["); Node node = head; while(node != null) { sb.append(node.element.toString()); sb.append(", "); node = node.next; } String ret = sb.substring(0, sb.length() - 2); re... | SinglyLinkedList implements Iterable<E> { @Override public String toString() { if(head == null) return "#epsilon"; StringBuilder sb = new StringBuilder("["); Node node = head; while(node != null) { sb.append(node.element.toString()); sb.append(", "); node = node.next; } String ret = sb.substring(0, sb.length() - 2); re... | SinglyLinkedList implements Iterable<E> { @Override public String toString() { if(head == null) return "#epsilon"; StringBuilder sb = new StringBuilder("["); Node node = head; while(node != null) { sb.append(node.element.toString()); sb.append(", "); node = node.next; } String ret = sb.substring(0, sb.length() - 2); re... |
@Test public void testRemove() { Iterator<String> I = arr.iterator(); removeOdd(I); I = l.iterator(); removeOdd(I); assertEquals(arr.toString(), l.toString()); assertEquals(arr.size(), l.size()); assertEquals("<12, <>>", "" + l.getTail()); } | public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } | SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } } | SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList(); SinglyLinkedList(Iterable<E> c); } | SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList(); SinglyLinkedList(Iterable<E> c); boolean add(E e); boolean addAll(Iterable<E> c); boolean conta... | SinglyLinkedList implements Iterable<E> { public boolean remove(Object o) { Iterator<E> I = iterator(); while(I.hasNext()) { E e = I.next(); if(e.equals(o)) { I.remove(); return true; } } return false; } SinglyLinkedList(); SinglyLinkedList(Iterable<E> c); boolean add(E e); boolean addAll(Iterable<E> c); boolean conta... |
@Test public void testEquality() { Symbol foo_again = Symbol.get("foo"); Symbol bar_again = Symbol.get("bar"); assertEquals(foo, foo_again); assertEquals(bar, bar_again); assertFalse(foo.equals(bar)); assertFalse(foo.equals(bar_again)); assertEquals(foo.hashCode(), foo_again.hashCode()); assertEquals(bar.hashCode(), ba... | public static Symbol get(String name) { Symbol ret = symbolTable.get(name); if(ret == null) { ret = new Symbol(name); symbolTable.put(name, ret); } return ret; } | Symbol { public static Symbol get(String name) { Symbol ret = symbolTable.get(name); if(ret == null) { ret = new Symbol(name); symbolTable.put(name, ret); } return ret; } } | Symbol { public static Symbol get(String name) { Symbol ret = symbolTable.get(name); if(ret == null) { ret = new Symbol(name); symbolTable.put(name, ret); } return ret; } protected Symbol(); protected Symbol(String name); } | Symbol { public static Symbol get(String name) { Symbol ret = symbolTable.get(name); if(ret == null) { ret = new Symbol(name); symbolTable.put(name, ret); } return ret; } protected Symbol(); protected Symbol(String name); static Symbol get(String name); String toString(); String toDotString(); int length(); } | Symbol { public static Symbol get(String name) { Symbol ret = symbolTable.get(name); if(ret == null) { ret = new Symbol(name); symbolTable.put(name, ret); } return ret; } protected Symbol(); protected Symbol(String name); static Symbol get(String name); String toString(); String toDotString(); int length(); } |
@Test public void testString() { assertEquals("foo", foo.toString()); assertEquals("bar", bar.toString()); } | public String toString() { return name; } | Symbol { public String toString() { return name; } } | Symbol { public String toString() { return name; } protected Symbol(); protected Symbol(String name); } | Symbol { public String toString() { return name; } protected Symbol(); protected Symbol(String name); static Symbol get(String name); String toString(); String toDotString(); int length(); } | Symbol { public String toString() { return name; } protected Symbol(); protected Symbol(String name); static Symbol get(String name); String toString(); String toDotString(); int length(); } |
@Test public void testInit() { assertFalse(ab_a.getNumber() == ab_cd.getNumber()); } | public int getNumber() { return number; } | Rule { public int getNumber() { return number; } } | Rule { public int getNumber() { return number; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); } | Rule { public int getNumber() { return number; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Override boolean equals(Object o); @Override int ... | Rule { public int getNumber() { return number; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Override boolean equals(Object o); @Override int ... |
@Test public void testTerminals() { assertTrue(ab_a.getTerminals().contains(a)); assertTrue(ab_a.getTerminals().contains(b)); assertFalse(ab_a.getTerminals().contains(c)); assertFalse(ab_a.getTerminals().contains(d)); assertTrue(ab_cd.getTerminals().contains(a)); assertTrue(ab_cd.getTerminals().contains(b)); assertTrue... | public Set<Symbol> getTerminals() { return terminals; } | Rule { public Set<Symbol> getTerminals() { return terminals; } } | Rule { public Set<Symbol> getTerminals() { return terminals; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); } | Rule { public Set<Symbol> getTerminals() { return terminals; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Override boolean equals(Object o); ... | Rule { public Set<Symbol> getTerminals() { return terminals; } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Override boolean equals(Object o); ... |
@Test public void testType() { assertEquals(LTLType.A, a.getLTLType()); assertEquals(LTLType.A, b.getLTLType()); } | @Override public LTLType getLTLType(){ return LTLType.A; } | Atom extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.A; } } | Atom extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.A; } private Atom(); } | Atom extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.A; } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Override void subFormulae(... | Atom extends LTLFormula { @Override public LTLType getLTLType(){ return LTLType.A; } private Atom(); static Atom get(String name); @Override LTLType getLTLType(); @Override boolean equals(Object o); @Override int compareTo(Object o); @Override LTLFormula copy(); @Override String toString(); @Override void subFormulae(... |
@Test public void testString() { assertEquals("a b -> a ", ab_a.toString()); assertEquals("a b -> c d ", ab_cd.toString()); } | @Override public String toString() { return lhs.toString() + " -> " + rhs.toString(); } | Rule { @Override public String toString() { return lhs.toString() + " -> " + rhs.toString(); } } | Rule { @Override public String toString() { return lhs.toString() + " -> " + rhs.toString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); } | Rule { @Override public String toString() { return lhs.toString() + " -> " + rhs.toString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Ove... | Rule { @Override public String toString() { return lhs.toString() + " -> " + rhs.toString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Ove... |
@Test public void testDotString() { assertEquals("a\\ b \\rightarrow a", ab_a.toDotString()); assertEquals("a\\ b \\rightarrow c\\ d", ab_cd.toDotString()); } | public String toDotString() { return lhs.toDotString() + " \\rightarrow " + rhs.toDotString(); } | Rule { public String toDotString() { return lhs.toDotString() + " \\rightarrow " + rhs.toDotString(); } } | Rule { public String toDotString() { return lhs.toDotString() + " \\rightarrow " + rhs.toDotString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); } | Rule { public String toDotString() { return lhs.toDotString() + " \\rightarrow " + rhs.toDotString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLengt... | Rule { public String toDotString() { return lhs.toDotString() + " \\rightarrow " + rhs.toDotString(); } protected Rule(); Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLengt... |
@Test public void testString() { String pmaStr = pma.toString(); String zeroAtZero = pmaStr.substring(pmaStr.indexOf("\n<0 @ 0"), pmaStr.indexOf("\n<1 @ 1")); assertTrue(zeroAtZero.contains("d -> [0] <0 @ 0>")); assertTrue(zeroAtZero.contains("c -> [0] <0 @ 0>")); assertTrue(zeroAtZero.contains("b -> [0] <0 @ 0>")); as... | @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symbol, ActionState> transition = get(state); for(Symbol symbol : transition.keySet()) ... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symb... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symb... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symb... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { @Override public String toString() { StringBuilder sb = new StringBuilder("\n"); sb.append(needsBegin); sb.append("\n"); sb.append(needsEnd); sb.append("\n"); for(State state : keySet()) { sb.append(state); sb.append("\n["); HashMap<Symb... |
@Test public void testDotSring() { String pmaDotStr = pma.toDotString(); System.out.println(pmaDotStr); assertTrue(pmaDotStr.contains("s_0 [texlbl=\"$\\begin{array}{c}0 : 0\\end{array}$\" label=\" \"];")); assertTrue(pmaDotStr.contains("s_1 [texlbl=\"$\\begin{array}{c}1 : 1\\end{array}$\" label=\" \"];")); assertTrue(p... | public String toDotString() { StringBuilder sb = new StringBuilder("digraph A"); sb.append((long) (Math.random()* 2e61d)); sb.append("{\n rankdir=TB;\n node [shape=circle];\n"); for(State state : keySet()) { sb.append(" "); sb.append(state.toFullDotString()); sb.append("\n"); } for(State state : keySet()) { HashMap<Sym... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { public String toDotString() { StringBuilder sb = new StringBuilder("digraph A"); sb.append((long) (Math.random()* 2e61d)); sb.append("{\n rankdir=TB;\n node [shape=circle];\n"); for(State state : keySet()) { sb.append(" "); sb.append(sta... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { public String toDotString() { StringBuilder sb = new StringBuilder("digraph A"); sb.append((long) (Math.random()* 2e61d)); sb.append("{\n rankdir=TB;\n node [shape=circle];\n"); for(State state : keySet()) { sb.append(" "); sb.append(sta... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { public String toDotString() { StringBuilder sb = new StringBuilder("digraph A"); sb.append((long) (Math.random()* 2e61d)); sb.append("{\n rankdir=TB;\n node [shape=circle];\n"); for(State state : keySet()) { sb.append(" "); sb.append(sta... | PatternMatchAutomaton extends LinkedHashMap<State, HashMap<Symbol, ActionState>> { public String toDotString() { StringBuilder sb = new StringBuilder("digraph A"); sb.append((long) (Math.random()* 2e61d)); sb.append("{\n rankdir=TB;\n node [shape=circle];\n"); for(State state : keySet()) { sb.append(" "); sb.append(sta... |
@Test public void testType() { assertEquals(LTLType.OR, a_or_b.getLTLType()); assertEquals(LTLType.OR, a_or_c.getLTLType()); } | public LTLType getLTLType(){ return LTLType.OR; } | Or extends LTLFormula { public LTLType getLTLType(){ return LTLType.OR; } } | Or extends LTLFormula { public LTLType getLTLType(){ return LTLType.OR; } Or(ArrayList<LTLFormula> children); } | Or extends LTLFormula { public LTLType getLTLType(){ return LTLType.OR; } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); ATransition d(HashMap<LTLFormula, ATransition> D); static void main(String args[]); } | Or extends LTLFormula { public LTLType getLTLType(){ return LTLType.OR; } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); ATransition d(HashMap<LTLFormula, ATransition> D); static void main(String args[]); } |
@Test public void testNormalize() { { ArrayList<LTLFormula> orElements = new ArrayList<LTLFormula>( Arrays.asList(new Negation(a), new Negation(b))); Collections.sort(orElements); And expected = new And(orElements); assertEquals(expected, a_or_b.copy().normalize(true)); } assertEquals(makeOr(a, c), a_or_c.normalize(fal... | protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } | Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } } | Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<L... | Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<L... | Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<L... |
@Test public void testReduce() { { Or duplicate = makeOr(a, b, c, a, b, c); assertEquals(makeOr(a, b, c), duplicate.reduce()); } { Or combined = makeOr(a_or_b,a_or_c); assertEquals(makeOr(a, b, c), combined.reduce()); } { Or withTrue = makeOr(a, b, True.get()); assertEquals(True.get(), withTrue.reduce()); } { Or withFa... | @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == True.get()){ return True.get(); } if(children.get(i) == False.get()){ ... | Or extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == True.get()){ return True.get(); } if(children.... | Or extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == True.get()){ return True.get(); } if(children.... | Or extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == True.get()){ return True.get(); } if(children.... | Or extends LTLFormula { @Override protected LTLFormula reduce(){ for(int i = 0; i < children.size(); ++i){ children.set(i, children.get(i).reduce()); } flatten(); Collections.sort(children); for(int i = 0; ; ++i){ if(i >= children.size()) return this; if(children.get(i) == True.get()){ return True.get(); } if(children.... |
@Test public void shouldGet() throws Exception { mockMvc.perform(get("/foos/{id}", "cafe")) .andDo(print()) .andExpect(status().isOk()) .andExpect(content().contentType("application/hal+json")) .andExpect(jsonPath("$.uuid", is("cafe"))) .andExpect(jsonPath("$._links.self.href", is("http: } | @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } | FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } } | FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); } | FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); @GetMapping("/{id}") FooResource get(@PathVariable UUID id); @PutMapping("/{id}") HttpEntity<FooResource> up... | FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); @GetMapping("/{id}") FooResource get(@PathVariable UUID id); @PutMapping("/{id}") HttpEntity<FooResource> up... |
@Test public void update() throws Exception { mockMvc.perform(put("/foos/{id}", "foo") .content("{\"uuid\":\"foo\",\"name\":\"Sample Foo\"}") .contentType("application/hal+json;charset=UTF-8")) .andDo(print()) .andExpect(status().isOk()); } | @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } } | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... |
@Test public void shouldGet() throws Exception { mockMvc.perform(get("/foos/{id}", "cafe")) .andDo(print()) .andExpect(status().isOk()) .andExpect(content().contentType("application/hal+json")) .andExpect(jsonPath("$.uuid", is("cafe"))) .andExpect(jsonPath("$._links.self.href", is("http: } | @GetMapping("/{id}") public HttpEntity<FooResource> get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); FooResource fooResource = assembler.toModel(foo); return ResponseEntity.ok(fooResource); } | FooController { @GetMapping("/{id}") public HttpEntity<FooResource> get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); FooResource fooResource = assembler.toModel(foo); return ResponseEntity.ok(fooResource); } } | FooController { @GetMapping("/{id}") public HttpEntity<FooResource> get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); FooResource fooResource = assembler.toModel(foo); return ResponseEntity.ok(fooResource); } FooController(FooResourceAssembler assembler); } | FooController { @GetMapping("/{id}") public HttpEntity<FooResource> get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); FooResource fooResource = assembler.toModel(foo); return ResponseEntity.ok(fooResource); } FooController(FooResourceAssembler assembler); @GetMapping("/{id}") HttpEntity... | FooController { @GetMapping("/{id}") public HttpEntity<FooResource> get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); FooResource fooResource = assembler.toModel(foo); return ResponseEntity.ok(fooResource); } FooController(FooResourceAssembler assembler); @GetMapping("/{id}") HttpEntity... |
@Test public void update() throws Exception { mockMvc.perform(put("/foos/{id}", "foo") .content("{\"uuid\":\"foo\",\"name\":\"Sample Foo\"}") .contentType("application/hal+json")) .andDo(print()) .andExpect(status().isOk()); } | @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } } | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... | FooController { @PutMapping("/{id}") public HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource) { log.info("Update {} : {}", id, fooResource); Foo entity = new Foo(fooResource.getUuid(), fooResource.getName()); return ResponseEntity.ok(assembler.toModel(entity)); } FooController(... |
@Test public void shouldExplodeWhenContainsIllegalCharacters() { assertThatThrownBy(() -> Url62.decode("Foo Bar")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("contains illegal characters"); } | static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } |
@Test public void shouldFaildOnEmptyString() { assertThatThrownBy(() -> Url62.decode("")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("must not be empty"); } | static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } |
@Test public void shouldFailsOnNullString() { assertThatThrownBy(() -> Url62.decode(null)) .isInstanceOf(NullPointerException.class) .hasMessageContaining("must not be null"); } | static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } |
@Test public void shouldFailsWhenStringContainsMoreThan128bitInformation() { assertThatThrownBy(() -> Url62.decode("7NLCAyd6sKR7kDHxgAWFPas")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("contains more than 128bit information"); } | static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } | Url62 { static UUID decode(String id) { BigInteger decoded = Base62.decode(id); return UuidConverter.toUuid(decoded); } } |
@Test public void shouldCheck128BitLimits() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> Base62.decode("1Vkp6axDWu5pI3q1xQO3oO0")); } | static BigInteger decode(final String string) { return decode(string, 128); } | Base62 { static BigInteger decode(final String string) { return decode(string, 128); } } | Base62 { static BigInteger decode(final String string) { return decode(string, 128); } } | Base62 { static BigInteger decode(final String string) { return decode(string, 128); } } | Base62 { static BigInteger decode(final String string) { return decode(string, 128); } } |
@Test public void pairingLongsShouldBeReversible() { def("Arrays.equals(unpair(pair(longs)), asArray(longs))") .forAll(DataProvider.LONG_PAIRS) .suchThat(longs -> Arrays.equals(unpair(makePair(longs)), asArray(longs))) .check(-1, 100_000) .assertIsSatisfied(); } | static BigInteger[] unpair(BigInteger value) { BigInteger[] parts = value.divideAndRemainder(HALF); BigInteger signedHi = toSigned.apply(parts[0]); BigInteger signedLo = toSigned.apply(parts[1]); return new BigInteger[]{signedHi, signedLo}; } | BigIntegerPairing { static BigInteger[] unpair(BigInteger value) { BigInteger[] parts = value.divideAndRemainder(HALF); BigInteger signedHi = toSigned.apply(parts[0]); BigInteger signedLo = toSigned.apply(parts[1]); return new BigInteger[]{signedHi, signedLo}; } } | BigIntegerPairing { static BigInteger[] unpair(BigInteger value) { BigInteger[] parts = value.divideAndRemainder(HALF); BigInteger signedHi = toSigned.apply(parts[0]); BigInteger signedLo = toSigned.apply(parts[1]); return new BigInteger[]{signedHi, signedLo}; } } | BigIntegerPairing { static BigInteger[] unpair(BigInteger value) { BigInteger[] parts = value.divideAndRemainder(HALF); BigInteger signedHi = toSigned.apply(parts[0]); BigInteger signedLo = toSigned.apply(parts[1]); return new BigInteger[]{signedHi, signedLo}; } } | BigIntegerPairing { static BigInteger[] unpair(BigInteger value) { BigInteger[] parts = value.divideAndRemainder(HALF); BigInteger signedHi = toSigned.apply(parts[0]); BigInteger signedLo = toSigned.apply(parts[1]); return new BigInteger[]{signedHi, signedLo}; } } |
@Test public void testGenerateLogoutResponse() { ServerMessageFactory serverMessageFactory = new ServerMessageFactory(); Message message = serverMessageFactory.generateLogoutResponse(true); assertEquals(message.name, "LogoutResponse"); assertEquals(message.getArgument("success"), true); } | public Message generateLogoutResponse(boolean success) { Message logoutResponse = MessageRegistry.getInstance().createMessage("LogoutResponse"); logoutResponse.setArgument("success", success); return logoutResponse; } | ServerMessageFactory { public Message generateLogoutResponse(boolean success) { Message logoutResponse = MessageRegistry.getInstance().createMessage("LogoutResponse"); logoutResponse.setArgument("success", success); return logoutResponse; } } | ServerMessageFactory { public Message generateLogoutResponse(boolean success) { Message logoutResponse = MessageRegistry.getInstance().createMessage("LogoutResponse"); logoutResponse.setArgument("success", success); return logoutResponse; } } | ServerMessageFactory { public Message generateLogoutResponse(boolean success) { Message logoutResponse = MessageRegistry.getInstance().createMessage("LogoutResponse"); logoutResponse.setArgument("success", success); return logoutResponse; } Message generateLogoutResponse(boolean success); Message generateLoginResponse... | ServerMessageFactory { public Message generateLogoutResponse(boolean success) { Message logoutResponse = MessageRegistry.getInstance().createMessage("LogoutResponse"); logoutResponse.setArgument("success", success); return logoutResponse; } Message generateLogoutResponse(boolean success); Message generateLoginResponse... |
@Test public void testSendLogoutStatus() throws Exception { AuthServer server = mock(AuthServer.class); MessageInputStream mis = mock(MessageInputStream.class); MessageOutputStream mos = mock(MessageOutputStream.class); MessageIO messageIO = new MessageIO(mis, mos); ClientHandler clientHandler = new ClientHandler(serve... | public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } | ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } } | ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); } | ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); void setHandlerId(int id); void update(); @Override vo... | ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); void setHandlerId(int id); void update(); @Override vo... |
@Test public void testShutDown() throws Exception { Authenticator authenticator = mock(Authenticator.class); User user = mock(User.class); AuthServer server = mock(AuthServer.class); MessageInputStream mis = mock(MessageInputStream.class); MessageOutputStream mos = mock(MessageOutputStream.class); MessageIO messageIO =... | @Override public void shutdown() { if (getUser() != null) { try { server.getAuthenticator().logOutUser(user.getUsername()); } catch (LoginException e) { LOGGER.log(Level.WARNING, "Unable to perform emergency logout.", e); } } getServer().removeClient(this); } | ClientHandler extends Connection { @Override public void shutdown() { if (getUser() != null) { try { server.getAuthenticator().logOutUser(user.getUsername()); } catch (LoginException e) { LOGGER.log(Level.WARNING, "Unable to perform emergency logout.", e); } } getServer().removeClient(this); } } | ClientHandler extends Connection { @Override public void shutdown() { if (getUser() != null) { try { server.getAuthenticator().logOutUser(user.getUsername()); } catch (LoginException e) { LOGGER.log(Level.WARNING, "Unable to perform emergency logout.", e); } } getServer().removeClient(this); } ClientHandler(AuthServer ... | ClientHandler extends Connection { @Override public void shutdown() { if (getUser() != null) { try { server.getAuthenticator().logOutUser(user.getUsername()); } catch (LoginException e) { LOGGER.log(Level.WARNING, "Unable to perform emergency logout.", e); } } getServer().removeClient(this); } ClientHandler(AuthServer ... | ClientHandler extends Connection { @Override public void shutdown() { if (getUser() != null) { try { server.getAuthenticator().logOutUser(user.getUsername()); } catch (LoginException e) { LOGGER.log(Level.WARNING, "Unable to perform emergency logout.", e); } } getServer().removeClient(this); } ClientHandler(AuthServer ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.