<commit_before><commit_msg>Add combined messaging/iotivity client test<commit_after>/*
 * Package : dartivity
 * Author : <NAME> <<EMAIL>>
 * Date   : 28/09/2015
 * Copyright :  S.Hamblett 2015
 */

library dartivity.test;

import 'dart:async';
import 'dart:io';

import 'package:dartivity/dartivity.dart';

Future main() async {
  final int badExitCode = -1;

  // Instantiate a Dartivity client and initialise for
  // both messaging and iotivity, ie a normal client configuration.
  Dartivity dartivity = new Dartivity(Mode.both);

  DartivityIotivityCfg iotCfg = new DartivityIotivityCfg(
      qos: DartivityIotivityCfg.QualityOfService_LowQos);

  await dartivity.initialise(
      DartivityCfg.MESS_CRED_PATH, DartivityCfg.MESS_PROJECT_ID, iotCfg);

  if (dartivity.initialised) {
    print("Initialse Status is true - OK");
  } else {
    print("Oops Initialse Status is false - ERROR");
    exit(badExitCode);
  }


  // Message monitoring
  var subscription = dartivity.nextMessage.listen((DartivityMessage message) {
    print("Message received ${message.toString()}");

  });

  // Close down
  //dartivity.close();


}
{'fraction_non_alphanumeric': 0.11405835543766578, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 4.008849557522124, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1187564', 'n_tokens_mistral': 393, 'n_tokens_neox': 360, 'n_words': 88}