Skip to main content

ArchiMate Quick Test Reference

๐Ÿš€ One-Line Full Testโ€‹

cd /home/rubenlinde/nextcloud-docker-dev && docker-compose exec nextcloud php /var/www/html/apps-extra/softwarecatalog/compare_archimate.php

This command will:

  • โœ… Import the GEMMA_release.xml file
  • โœ… Export the imported data
  • โœ… Compare original vs exported XML
  • โœ… Report any differences found
  • โœ… Save detailed report to /tmp/archimate_comparison_report.json

๐Ÿ“‹ Quick Commandsโ€‹

Import Testโ€‹

docker-compose exec nextcloud curl -X POST "http://localhost/index.php/apps/softwarecatalog/api/archimate/import" -H "Content-Type: application/json" -u admin:admin -d '{"file_path": "/var/www/html/apps-extra/softwarecatalog/lib/Settings/GEMMA_release.xml"}'

Export Testโ€‹

docker-compose exec nextcloud curl -X POST "http://localhost/index.php/apps/softwarecatalog/api/archimate/export" -H "Content-Type: application/json" -u admin:admin -d '{}' > /tmp/test_export.xml

Database Inspectionโ€‹

docker-compose exec nextcloud php /var/www/html/apps-extra/softwarecatalog/debug_db.php

Clear Statusโ€‹

docker-compose exec nextcloud curl -X POST "http://localhost/index.php/apps/softwarecatalog/api/archimate/import/cancel" -u admin:admin

๐ŸŽฏ Expected Resultsโ€‹

Perfect Round-Tripโ€‹

=== COMPARISON REPORT ===
Total differences found: 0
Elements compared: 2765
Relationships compared: 5696
Views compared: 242
Property definitions compared: 77
Folders compared: X

๐ŸŽ‰ NO DIFFERENCES FOUND! Perfect round-trip compatibility achieved!

Import Successโ€‹

{
"success": true,
"statistics": {
"elements": {"created": 2765, "updated": 0, "skipped": 0},
"organizations": {"created": 71, "updated": 0, "skipped": 0},
"relationships": {"created": 5696, "updated": 0, "skipped": 0},
"views": {"created": 242, "updated": 0, "skipped": 0},
"property_definitions": {"created": 77, "updated": 0, "skipped": 0}
}
}

๐Ÿ”ง Troubleshootingโ€‹

If Import Failsโ€‹

  1. Check file exists: docker-compose exec nextcloud ls -la /var/www/html/apps-extra/softwarecatalog/lib/Settings/GEMMA_release.xml
  2. Clear status: docker-compose exec nextcloud curl -X POST "http://localhost/index.php/apps/softwarecatalog/api/archimate/import/cancel" -u admin:admin
  3. Check logs: docker-compose exec nextcloud tail -n 50 /var/www/html/data/nextcloud.log

If Export is Emptyโ€‹

  1. Verify import worked: docker-compose exec nextcloud php /var/www/html/apps-extra/softwarecatalog/debug_db.php
  2. Check object counts in database
  3. Re-run import if needed

If Comparison Shows Differencesโ€‹

  1. Check specific sections (elements, relationships, etc.)
  2. Look for patterns in the differences
  3. Verify property definitions are correct
  4. Check source/target values in relationships

๐Ÿ“Š File Sizes Referenceโ€‹

  • GEMMA_release.xml: ~13MB (254,814 lines)
  • Exported XML: Should be similar size
  • Comparison report: JSON file with detailed differences

๐Ÿ” Manual Inspection Commandsโ€‹

# Check first 50 lines of export
docker-compose exec nextcloud head -n 50 /tmp/test_export.xml

# Count elements
docker-compose exec nextcloud grep -c '<element ' /tmp/test_export.xml

# Count relationships
docker-compose exec nextcloud grep -c '<relationship ' /tmp/test_export.xml

# Check specific element
docker-compose exec nextcloud grep -A 10 'id-009fa62f25844aa3a87d252bf2b6bb0c' /tmp/test_export.xml